address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xdea0a6d88a21aa5d8aa5e0231efd709ce381e2aa
|
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
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)
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)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract TitaToken is BurnableToken, Ownable {
string public constant name = "Tita";
string public constant symbol = "TTN";
uint public constant decimals = 18;
uint256 public constant initialSupply = 250000000 * (10 ** uint256(decimals));
// Constructor
function TitaToken () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
}
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610a4c565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610a51565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610a5f565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc2565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e53565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610e9c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610ec2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efb565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110d1565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112cd565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611354565b005b6040805190810160405280600481526020017f546974610000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561079f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b83826114ac90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a630ee6b2800281565b60008082111515610a6f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610abd57600080fd5b339050610b1282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b6a826000546114ac90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cd3576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67565b610ce683826114ac90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f54544e000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3857600080fd5b610f8a82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061116282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113ec57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114ba57fe5b818303905092915050565b60008082840190508381101515156114d957fe5b80915050929150505600a165627a7a72305820e450afc0d83cacd9c7909a6604f3ccb0c566be92545b9e7c93404d92bb9ab92c0029
|
{"success": true, "error": null, "results": {}}
| 2,300 |
0x45a3f4995d7f32ebe9ed0fccc0b51194febfc8a3
|
/**
*Submitted for verification at Etherscan.io on 2021-11-24
*/
//t.me/miniLOBI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract miniLOBI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "miniLOBI";
string private constant _symbol = "miniLOBI";
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; // 0%
uint256 private _buytax = 10; // Buy tax 10%
uint256 private _teamFee;
uint256 private _sellTax = 30; // Launch sell tax 30% for first 24 hours. Then Sell tax down to 10%.
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => bool) private whitelist;
mapping(address => uint256) private cooldown;
address payable private _MarketTax;
address payable private _Dev;
address payable private _DevTax;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable markettax, address payable devtax, address payable dev) {
_MarketTax = markettax;
_Dev = dev;
_DevTax = devtax;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MarketTax] = true;
_isExcludedFromFee[_DevTax] = true;
_isExcludedFromFee[_Dev] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if(from != address(this)){
require(amount <= _maxTxAmount);
}
if(from != owner() && to != owner()){
_teamFee = _buytax;
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
_teamFee = _sellTax;
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function isWhiteListed(address account) public view returns (bool) {
return whitelist[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MarketTax.transfer(amount.div(10).mul(3));
_DevTax.transfer(amount.div(10).mul(7));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
_maxTxAmount = 20000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Dev);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualswapcustom(uint256 percentage) external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
uint256 swapbalance = contractBalance.div(10**5).mul(percentage);
swapTokensForEth(swapbalance);
}
function manualsend() external {
require(_msgSender() == _Dev);
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**3);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Dev);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setSellTax(uint256 selltax) external onlyOwner() {
require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 40');
_sellTax = selltax;
}
function _setBuyTax(uint256 buytax) external onlyOwner() {
require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 10');
_buytax = buytax;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarket(address payable account) external {
require(_msgSender() == _Dev);
_MarketTax = account;
}
function setDev(address payable account) external {
require(_msgSender() == _Dev);
_Dev = account;
}
function setDevpay(address payable account) external {
require(_msgSender() == _Dev);
_DevTax = account;
}
function _ZeroSellTax() external {
require(_msgSender() == _Dev);
_sellTax = 0;
}
function _ZeroBuyTax() external {
require(_msgSender() == _Dev);
_buytax = 0;
}
}
|
0x6080604052600436106101e75760003560e01c806395d89b4111610102578063d00efb2f11610095578063dd62ed3e11610064578063dd62ed3e14610580578063e01af92c146105c6578063e47d6060146105e6578063e850fe381461061f57600080fd5b8063d00efb2f1461050a578063d477f05f14610520578063d543dbeb14610540578063dbe8272c1461056057600080fd5b8063c3c8cd80116100d1578063c3c8cd8014610487578063c9567bf91461049c578063cba0e996146104b1578063cf27e7d5146104ea57600080fd5b806395d89b41146101f3578063a9059cbb14610427578063b515566a14610447578063c0e6b46e1461046757600080fd5b80636dcea85f1161017a578063715018a611610149578063715018a6146103b557806384e1879d146103ca57806389e7b81b146103df5780638da5cb5b146103ff57600080fd5b80636dcea85f146103275780636f9170f6146103475780636fc3eaec1461038057806370a082311461039557600080fd5b8063273123b7116101b6578063273123b7146102a95780632b7581b2146102cb578063313ce567146102eb578063437823ec1461030757600080fd5b806306fdde03146101f3578063095ea7b31461023357806318160ddd1461026357806323b872dd1461028957600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5060408051808201825260088152676d696e694c4f424960c01b6020820152905161022a9190611ee8565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004611d79565b610634565b604051901515815260200161022a565b34801561026f57600080fd5b50683635c9adc5dea000005b60405190815260200161022a565b34801561029557600080fd5b506102536102a4366004611d39565b61064b565b3480156102b557600080fd5b506102c96102c4366004611cc9565b6106b4565b005b3480156102d757600080fd5b506102c96102e6366004611ea3565b610708565b3480156102f757600080fd5b506040516009815260200161022a565b34801561031357600080fd5b506102c9610322366004611cc9565b610788565b34801561033357600080fd5b506102c9610342366004611cc9565b6107d6565b34801561035357600080fd5b50610253610362366004611cc9565b6001600160a01b031660009081526011602052604090205460ff1690565b34801561038c57600080fd5b506102c9610818565b3480156103a157600080fd5b5061027b6103b0366004611cc9565b610845565b3480156103c157600080fd5b506102c9610867565b3480156103d657600080fd5b506102c96108db565b3480156103eb57600080fd5b506102c96103fa366004611ea3565b610902565b34801561040b57600080fd5b506000546040516001600160a01b03909116815260200161022a565b34801561043357600080fd5b50610253610442366004611d79565b610958565b34801561045357600080fd5b506102c9610462366004611da4565b610965565b34801561047357600080fd5b506102c9610482366004611ea3565b610a09565b34801561049357600080fd5b506102c9610a9e565b3480156104a857600080fd5b506102c9610ad4565b3480156104bd57600080fd5b506102536104cc366004611cc9565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156104f657600080fd5b506102c9610505366004611cc9565b610e9a565b34801561051657600080fd5b5061027b60195481565b34801561052c57600080fd5b506102c961053b366004611cc9565b610edc565b34801561054c57600080fd5b506102c961055b366004611ea3565b610f1e565b34801561056c57600080fd5b506102c961057b366004611ea3565b610fec565b34801561058c57600080fd5b5061027b61059b366004611d01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d257600080fd5b506102c96105e1366004611e6b565b61106c565b3480156105f257600080fd5b50610253610601366004611cc9565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561062b57600080fd5b506102c96110aa565b60006106413384846110d1565b5060015b92915050565b60006106588484846111f5565b6106aa84336106a5856040518060600160405280602881526020016120b9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611515565b6110d1565b5060019392505050565b6000546001600160a01b031633146106e75760405162461bcd60e51b81526004016106de90611f3b565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107325760405162461bcd60e51b81526004016106de90611f3b565b600a8111156107835760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d20313000000000000060448201526064016106de565b600955565b6000546001600160a01b031633146107b25760405162461bcd60e51b81526004016106de90611f3b565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b0316146107f657600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461083857600080fd5b476108428161154f565b50565b6001600160a01b038116600090815260026020526040812054610645906115de565b6000546001600160a01b031633146108915760405162461bcd60e51b81526004016106de90611f3b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b0316146108fb57600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b03161461092257600080fd5b600061092d30610845565b905060006109488361094284620186a0611662565b906116a4565b905061095381611723565b505050565b60006106413384846111f5565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016106de90611f3b565b60005b8151811015610a05576001601060008484815181106109c157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806109fd8161204e565b915050610992565b5050565b6014546001600160a01b0316336001600160a01b031614610a2957600080fd5b60008111610a795760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106de565b610a98612710610a92683635c9adc5dea00000846116a4565b90611662565b600f5550565b6014546001600160a01b0316336001600160a01b031614610abe57600080fd5b6000610ac930610845565b905061084281611723565b6000546001600160a01b03163314610afe5760405162461bcd60e51b81526004016106de90611f3b565b601754600160a01b900460ff1615610b585760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016106de565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b953082683635c9adc5dea000006110d1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bce57600080fd5b505afa158015610be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c069190611ce5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4e57600080fd5b505afa158015610c62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c869190611ce5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610cce57600080fd5b505af1158015610ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d069190611ce5565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d7194730610d3681610845565b600080610d4b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610dae57600080fd5b505af1158015610dc2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610de79190611ebb565b5050601780546801158e460913d000006018554360195562ff00ff60a01b1981166201000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610e6257600080fd5b505af1158015610e76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a059190611e87565b6014546001600160a01b0316336001600160a01b031614610eba57600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b031614610efc57600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f485760405162461bcd60e51b81526004016106de90611f3b565b60008111610f985760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106de565b610fb16103e8610a92683635c9adc5dea00000846116a4565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146110165760405162461bcd60e51b81526004016106de90611f3b565b60288111156110675760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d203430000000000060448201526064016106de565b600b55565b6014546001600160a01b0316336001600160a01b03161461108c57600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b0316146110ca57600080fd5b6000600955565b6001600160a01b0383166111335760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106de565b6001600160a01b0382166111945760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106de565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112595760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106de565b6001600160a01b0382166112bb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106de565b6000811161131d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106de565b6000546001600160a01b0384811691161480159061134957506000546001600160a01b03838116911614155b156114b8576001600160a01b038316301461136d5760185481111561136d57600080fd5b6000546001600160a01b0384811691161480159061139957506000546001600160a01b03838116911614155b156113a557600954600a555b6001600160a01b03831660009081526010602052604090205460ff161580156113e757506001600160a01b03821660009081526010602052604090205460ff16155b801561140357503360009081526010602052604090205460ff16155b61140c57600080fd5b600061141730610845565b9050600f5481106114275750600f545b600e546017549082101590600160a81b900460ff161580156114525750601754600160b01b900460ff165b801561145b5750805b801561147557506017546001600160a01b03868116911614155b801561148f57506016546001600160a01b03868116911614155b156114b557600b54600a556114a382611723565b4780156114b3576114b34761154f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806114fa57506001600160a01b03831660009081526005602052604090205460ff165b15611503575060005b61150f848484846118c8565b50505050565b600081848411156115395760405162461bcd60e51b81526004016106de9190611ee8565b5060006115468486612037565b95945050505050565b6013546001600160a01b03166108fc61156e600361094285600a611662565b6040518115909202916000818181858888f19350505050158015611596573d6000803e3d6000fd5b506015546001600160a01b03166108fc6115b6600761094285600a611662565b6040518115909202916000818181858888f19350505050158015610a05573d6000803e3d6000fd5b60006006548211156116455760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106de565b600061164f6118f6565b905061165b8382611662565b9392505050565b600061165b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611919565b6000826116b357506000610645565b60006116bf8385612018565b9050826116cc8583611ff8565b1461165b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106de565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061177957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117cd57600080fd5b505afa1580156117e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118059190611ce5565b8160018151811061182657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260165461184c91309116846110d1565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611885908590600090869030904290600401611f70565b600060405180830381600087803b15801561189f57600080fd5b505af11580156118b3573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b806118d5576118d5611947565b6118e0848484611975565b8061150f5761150f600c54600855600d54600a55565b6000806000611903611a6c565b90925090506119128282611662565b9250505090565b6000818361193a5760405162461bcd60e51b81526004016106de9190611ee8565b5060006115468486611ff8565b6008541580156119575750600a54155b1561195e57565b60088054600c55600a8054600d5560009182905555565b60008060008060008061198787611aae565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119b99087611b0b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119e89086611b4d565b6001600160a01b038916600090815260026020526040902055611a0a81611bac565b611a148483611bf6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a5991815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611a888282611662565b821015611aa557505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611acb8a600854600a54611c1a565b9250925092506000611adb6118f6565b90506000806000611aee8e878787611c69565b919e509c509a509598509396509194505050505091939550919395565b600061165b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611515565b600080611b5a8385611fe0565b90508381101561165b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106de565b6000611bb66118f6565b90506000611bc483836116a4565b30600090815260026020526040902054909150611be19082611b4d565b30600090815260026020526040902055505050565b600654611c039083611b0b565b600655600754611c139082611b4d565b6007555050565b6000808080611c2e6064610a9289896116a4565b90506000611c416064610a928a896116a4565b90506000611c5982611c538b86611b0b565b90611b0b565b9992985090965090945050505050565b6000808080611c7888866116a4565b90506000611c8688876116a4565b90506000611c9488886116a4565b90506000611ca682611c538686611b0b565b939b939a50919850919650505050505050565b8035611cc481612095565b919050565b600060208284031215611cda578081fd5b813561165b81612095565b600060208284031215611cf6578081fd5b815161165b81612095565b60008060408385031215611d13578081fd5b8235611d1e81612095565b91506020830135611d2e81612095565b809150509250929050565b600080600060608486031215611d4d578081fd5b8335611d5881612095565b92506020840135611d6881612095565b929592945050506040919091013590565b60008060408385031215611d8b578182fd5b8235611d9681612095565b946020939093013593505050565b60006020808385031215611db6578182fd5b823567ffffffffffffffff80821115611dcd578384fd5b818501915085601f830112611de0578384fd5b813581811115611df257611df261207f565b8060051b604051601f19603f83011681018181108582111715611e1757611e1761207f565b604052828152858101935084860182860187018a1015611e35578788fd5b8795505b83861015611e5e57611e4a81611cb9565b855260019590950194938601938601611e39565b5098975050505050505050565b600060208284031215611e7c578081fd5b813561165b816120aa565b600060208284031215611e98578081fd5b815161165b816120aa565b600060208284031215611eb4578081fd5b5035919050565b600080600060608486031215611ecf578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611f1457858101830151858201604001528201611ef8565b81811115611f255783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611fbf5784516001600160a01b031683529383019391830191600101611f9a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ff357611ff3612069565b500190565b60008261201357634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561203257612032612069565b500290565b60008282101561204957612049612069565b500390565b600060001982141561206257612062612069565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461084257600080fd5b801515811461084257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202e4a00f93ffc04051cb9a3d6380e43a9659dacd84fb0044e0fe584fb0814bfbf64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,301 |
0x07e29222571206b173b472e2e1ccd0d0ba8562b9
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
//Flokidoo
//Telegram: https://t.me/Flokidoo
//2% Deflationary yes
//Fair Launch
//Community Driven - 100% Community Owned!
// 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 Flokidoo is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Flokidoo | t.me/Flokidoo";
string private constant _symbol = "Flokidoo";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 12);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f01565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a24565b61045e565b6040516101789190612ee6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d5565b61048c565b6040516101e09190612ee6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612947565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190613118565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa1565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612947565b610782565b6040516102b191906130a3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612e18565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612f01565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a24565b61098c565b60405161035b9190612ee6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a60565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af3565b6110d3565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612999565b61121b565b60405161041891906130a3565b60405180910390f35b60606040518060400160405280601881526020017f466c6f6b69646f6f207c20742e6d652f466c6f6b69646f6f0000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610499848484611475565b61055a846104a56112a2565b610555856040518060600160405280602881526020016137dc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fe3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106666112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fe3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107516112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c98565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466c6f6b69646f6f000000000000000000000000000000000000000000000000815250905090565b60006109a06109996112a2565b8484611475565b6001905092915050565b6109b26112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fe3565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee906133b9565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611e27565b50565b610b7c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fe3565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090613063565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612970565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612970565b6040518363ffffffff1660e01b8152600401610e1d929190612e33565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612970565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e85565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612b1c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107d929190612e5c565b602060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612aca565b5050565b6110db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612fe3565b60405180910390fd5b600081116111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a290612fa3565b60405180910390fd5b6111d960646111cb83670de0b6b3a764000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a3565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613043565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f63565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f23565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613003565b60405180910390fd5b6115a0610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613083565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131d9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610782565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f01565b60405180910390fd5b5060008385611c8b91906132ba565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60048661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60068661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f43565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612970565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130be565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613260565b9050828482612151919061322f565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc3565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f01565b60405180910390fd5b5060008385612294919061322f565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e48761250e565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124238161261d565b61242d84836126da565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a3565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000670de0b6b3a764000090506124e3670de0b6b3a764000060065461219c90919063ffffffff16565b82101561250157600654670de0b6b3a764000093509350505061250a565b81819350935050505b9091565b600080600080600080600080600061252a8a600854600c612714565b925092509250600061253a612213565b9050600080600061254d8e8787876127aa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ce91906131d9565b905083811015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90612f83565b60405180910390fd5b8091505092915050565b6000612627612213565b9050600061263e828461212190919063ffffffff16565b905061269281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ef8260065461257590919063ffffffff16565b60068190555061270a816007546125bf90919063ffffffff16565b6007819055505050565b6000806000806127406064612732888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276a606461275c888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279382612785858c61257590919063ffffffff16565b61257590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c3858961212190919063ffffffff16565b905060006127da868961212190919063ffffffff16565b905060006127f1878961212190919063ffffffff16565b9050600061281a8261280c858761257590919063ffffffff16565b61257590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284661284184613158565b613133565b9050808382526020820190508285602086028201111561286557600080fd5b60005b85811015612895578161287b888261289f565b845260208401935060208301925050600181019050612868565b5050509392505050565b6000813590506128ae81613796565b92915050565b6000815190506128c381613796565b92915050565b600082601f8301126128da57600080fd5b81356128ea848260208601612833565b91505092915050565b600081359050612902816137ad565b92915050565b600081519050612917816137ad565b92915050565b60008135905061292c816137c4565b92915050565b600081519050612941816137c4565b92915050565b60006020828403121561295957600080fd5b60006129678482850161289f565b91505092915050565b60006020828403121561298257600080fd5b6000612990848285016128b4565b91505092915050565b600080604083850312156129ac57600080fd5b60006129ba8582860161289f565b92505060206129cb8582860161289f565b9150509250929050565b6000806000606084860312156129ea57600080fd5b60006129f88682870161289f565b9350506020612a098682870161289f565b9250506040612a1a8682870161291d565b9150509250925092565b60008060408385031215612a3757600080fd5b6000612a458582860161289f565b9250506020612a568582860161291d565b9150509250929050565b600060208284031215612a7257600080fd5b600082013567ffffffffffffffff811115612a8c57600080fd5b612a98848285016128c9565b91505092915050565b600060208284031215612ab357600080fd5b6000612ac1848285016128f3565b91505092915050565b600060208284031215612adc57600080fd5b6000612aea84828501612908565b91505092915050565b600060208284031215612b0557600080fd5b6000612b138482850161291d565b91505092915050565b600080600060608486031215612b3157600080fd5b6000612b3f86828701612932565b9350506020612b5086828701612932565b9250506040612b6186828701612932565b9150509250925092565b6000612b778383612b83565b60208301905092915050565b612b8c816132ee565b82525050565b612b9b816132ee565b82525050565b6000612bac82613194565b612bb681856131b7565b9350612bc183613184565b8060005b83811015612bf2578151612bd98882612b6b565b9750612be4836131aa565b925050600181019050612bc5565b5085935050505092915050565b612c0881613300565b82525050565b612c1781613343565b82525050565b6000612c288261319f565b612c3281856131c8565b9350612c42818560208601613355565b612c4b8161348f565b840191505092915050565b6000612c636023836131c8565b9150612c6e826134a0565b604082019050919050565b6000612c86602a836131c8565b9150612c91826134ef565b604082019050919050565b6000612ca96022836131c8565b9150612cb48261353e565b604082019050919050565b6000612ccc601b836131c8565b9150612cd78261358d565b602082019050919050565b6000612cef601d836131c8565b9150612cfa826135b6565b602082019050919050565b6000612d126021836131c8565b9150612d1d826135df565b604082019050919050565b6000612d356020836131c8565b9150612d408261362e565b602082019050919050565b6000612d586029836131c8565b9150612d6382613657565b604082019050919050565b6000612d7b6025836131c8565b9150612d86826136a6565b604082019050919050565b6000612d9e6024836131c8565b9150612da9826136f5565b604082019050919050565b6000612dc16017836131c8565b9150612dcc82613744565b602082019050919050565b6000612de46011836131c8565b9150612def8261376d565b602082019050919050565b612e038161332c565b82525050565b612e1281613336565b82525050565b6000602082019050612e2d6000830184612b92565b92915050565b6000604082019050612e486000830185612b92565b612e556020830184612b92565b9392505050565b6000604082019050612e716000830185612b92565b612e7e6020830184612dfa565b9392505050565b600060c082019050612e9a6000830189612b92565b612ea76020830188612dfa565b612eb46040830187612c0e565b612ec16060830186612c0e565b612ece6080830185612b92565b612edb60a0830184612dfa565b979650505050505050565b6000602082019050612efb6000830184612bff565b92915050565b60006020820190508181036000830152612f1b8184612c1d565b905092915050565b60006020820190508181036000830152612f3c81612c56565b9050919050565b60006020820190508181036000830152612f5c81612c79565b9050919050565b60006020820190508181036000830152612f7c81612c9c565b9050919050565b60006020820190508181036000830152612f9c81612cbf565b9050919050565b60006020820190508181036000830152612fbc81612ce2565b9050919050565b60006020820190508181036000830152612fdc81612d05565b9050919050565b60006020820190508181036000830152612ffc81612d28565b9050919050565b6000602082019050818103600083015261301c81612d4b565b9050919050565b6000602082019050818103600083015261303c81612d6e565b9050919050565b6000602082019050818103600083015261305c81612d91565b9050919050565b6000602082019050818103600083015261307c81612db4565b9050919050565b6000602082019050818103600083015261309c81612dd7565b9050919050565b60006020820190506130b86000830184612dfa565b92915050565b600060a0820190506130d36000830188612dfa565b6130e06020830187612c0e565b81810360408301526130f28186612ba1565b90506131016060830185612b92565b61310e6080830184612dfa565b9695505050505050565b600060208201905061312d6000830184612e09565b92915050565b600061313d61314e565b90506131498282613388565b919050565b6000604051905090565b600067ffffffffffffffff82111561317357613172613460565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e48261332c565b91506131ef8361332c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322457613223613402565b5b828201905092915050565b600061323a8261332c565b91506132458361332c565b92508261325557613254613431565b5b828204905092915050565b600061326b8261332c565b91506132768361332c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132af576132ae613402565b5b828202905092915050565b60006132c58261332c565b91506132d08361332c565b9250828210156132e3576132e2613402565b5b828203905092915050565b60006132f98261330c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334e8261332c565b9050919050565b60005b83811015613373578082015181840152602081019050613358565b83811115613382576000848401525b50505050565b6133918261348f565b810181811067ffffffffffffffff821117156133b0576133af613460565b5b80604052505050565b60006133c48261332c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f7576133f6613402565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61379f816132ee565b81146137aa57600080fd5b50565b6137b681613300565b81146137c157600080fd5b50565b6137cd8161332c565b81146137d857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d08ea3b2239654662b63d804020e8ba23eb3621d3e33aaadb8de4665db682a5c64736f6c63430008040033
|
{"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"}]}}
| 2,302 |
0x03fb0c3b86086170b81b9c8bea0a74775f90a314
|
pragma solidity ^0.4.24;
/**
* @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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
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 AWAXToken is MintableToken, DetailedERC20 {
constructor(string _name, string _symbol, uint8 _decimals)
DetailedERC20(_name, _symbol, _decimals)
public {}
}
|
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100f557806306fdde031461011e578063095ea7b3146101a857806318160ddd146101cc57806323b872dd146101f3578063313ce5671461021d57806340c10f1914610248578063661884631461026c57806370a0823114610290578063715018a6146102b15780637d64bcb4146102c85780638da5cb5b146102dd57806395d89b411461030e578063a9059cbb14610323578063d73dd62314610347578063dd62ed3e1461036b578063f2fde38b14610392575b600080fd5b34801561010157600080fd5b5061010a6103b3565b604080519115158252519081900360200190f35b34801561012a57600080fd5b506101336103d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016d578181015183820152602001610155565b50505050905090810190601f16801561019a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b457600080fd5b5061010a600160a060020a0360043516602435610462565b3480156101d857600080fd5b506101e16104c8565b60408051918252519081900360200190f35b3480156101ff57600080fd5b5061010a600160a060020a03600435811690602435166044356104ce565b34801561022957600080fd5b50610232610643565b6040805160ff9092168252519081900360200190f35b34801561025457600080fd5b5061010a600160a060020a036004351660243561064c565b34801561027857600080fd5b5061010a600160a060020a0360043516602435610767565b34801561029c57600080fd5b506101e1600160a060020a0360043516610856565b3480156102bd57600080fd5b506102c6610871565b005b3480156102d457600080fd5b5061010a6108df565b3480156102e957600080fd5b506102f2610985565b60408051600160a060020a039092168252519081900360200190f35b34801561031a57600080fd5b50610133610994565b34801561032f57600080fd5b5061010a600160a060020a03600435166024356109ef565b34801561035357600080fd5b5061010a600160a060020a0360043516602435610ace565b34801561037757600080fd5b506101e1600160a060020a0360043581169060243516610b67565b34801561039e57600080fd5b506102c6600160a060020a0360043516610b92565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561045a5780601f1061042f5761010080835404028352916020019161045a565b820191906000526020600020905b81548152906001019060200180831161043d57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156104f357600080fd5b600160a060020a038416600090815260016020908152604080832033845290915290205482111561052357600080fd5b600160a060020a038316151561053857600080fd5b600160a060020a038416600090815260208190526040902054610561908363ffffffff610bb516565b600160a060020a038086166000908152602081905260408082209390935590851681522054610596908363ffffffff610bcc16565b600160a060020a038085166000908152602081815260408083209490945591871681526001825282812033825290915220546105d8908363ffffffff610bb516565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b600354600090600160a060020a0316331461066657600080fd5b60035474010000000000000000000000000000000000000000900460ff161561068e57600080fd5b6002546106a1908363ffffffff610bcc16565b600255600160a060020a0383166000908152602081905260409020546106cd908363ffffffff610bcc16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083106107bb57336000908152600160209081526040808320600160a060020a03881684529091528120556107f0565b6107cb818463ffffffff610bb516565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461088857600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146108f957600080fd5b60035474010000000000000000000000000000000000000000900460ff161561092157600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561045a5780601f1061042f5761010080835404028352916020019161045a565b33600090815260208190526040812054821115610a0b57600080fd5b600160a060020a0383161515610a2057600080fd5b33600090815260208190526040902054610a40908363ffffffff610bb516565b3360009081526020819052604080822092909255600160a060020a03851681522054610a72908363ffffffff610bcc16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610b02908363ffffffff610bcc16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610ba957600080fd5b610bb281610be5565b50565b60008083831115610bc557600080fd5b5050900390565b600082820183811015610bde57600080fd5b9392505050565b600160a060020a0381161515610bfa57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582082ec931917c1f653e90574fff0d09d981411a45c4115f6274d52d7054eae26040029
|
{"success": true, "error": null, "results": {}}
| 2,303 |
0xe2492f8d2a2618d8709ca99b1d8d75713bd84089
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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;
}
function () public payable {
revert();
}
}
/**
* @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;
address public agent;
/**
* @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);
_;
}
modifier onlyAgentOrOwner() {
require(msg.sender == owner || msg.sender == agent);
_;
}
function setSaleAgent(address addr) public onlyOwner {
agent = addr;
}
}
contract HeartBoutToken is StandardToken, Ownable {
string public constant name = "HeartBout";
string public constant symbol = "HB";
uint32 public constant decimals = 18;
uint256 public constant totalSupply = 63695267 * (10 ** 18);
uint256 public constant Sale = totalSupply * 785 / 1000; // 78.5%
uint256 constant FirstInvestment = totalSupply * 5 / 100; // 5%
uint256 constant DevelopmentTeam = totalSupply * 6 / 100; // 6%
uint256 constant Bounty = totalSupply * 4 / 100; // 4%
uint256 constant Advisers = totalSupply * 5 / 100; // 5%
uint256 constant Marketing = totalSupply * 15 / 1000; // 1.5%
function HeartBoutToken() public {
address contractAddress = address(this);
balances[contractAddress] = totalSupply;
Transfer(0x0, contractAddress, totalSupply);
}
function SaleCount() public pure returns (uint256) {
return Sale;
}
function transferTokents(address addr, uint256 tokens) public onlyAgentOrOwner {
require(addr != address(0));
require(balances[address(this)] >= tokens);
balances[addr] = balances[addr].add(tokens);
balances[address(this)] = balances[address(this)].sub(tokens);
Transfer(address(this), addr, tokens);
}
}
|
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806314133a7c146101b557806317135b7b146101d657806318160ddd146101f857806323b872dd1461021d578063313ce56714610245578063661884631461027157806370a08231146102935780638da5cb5b146102b257806395d89b41146102e1578063967b2692146102f4578063a9059cbb14610307578063b78f9de714610329578063d73dd6231461033c578063dd62ed3e1461035e578063f5ff5c7614610383575b600080fd5b341561010057600080fd5b610108610396565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014457808201518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018a57600080fd5b6101a1600160a060020a03600435166024356103cd565b604051901515815260200160405180910390f35b34156101c057600080fd5b6101d4600160a060020a0360043516610439565b005b34156101e157600080fd5b6101d4600160a060020a0360043516602435610483565b341561020357600080fd5b61020b6105ad565b60405190815260200160405180910390f35b341561022857600080fd5b6101a1600160a060020a03600435811690602435166044356105bc565b341561025057600080fd5b61025861073e565b60405163ffffffff909116815260200160405180910390f35b341561027c57600080fd5b6101a1600160a060020a0360043516602435610743565b341561029e57600080fd5b61020b600160a060020a036004351661083d565b34156102bd57600080fd5b6102c5610858565b604051600160a060020a03909116815260200160405180910390f35b34156102ec57600080fd5b610108610867565b34156102ff57600080fd5b61020b61089e565b341561031257600080fd5b6101a1600160a060020a03600435166024356108ad565b341561033457600080fd5b61020b6109a8565b341561034757600080fd5b6101a1600160a060020a03600435166024356109b7565b341561036957600080fd5b61020b600160a060020a0360043581169060243516610a5b565b341561038e57600080fd5b6102c5610a86565b60408051908101604052600981527f4865617274426f75740000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035433600160a060020a0390811691161461045457600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035433600160a060020a03908116911614806104ae575060045433600160a060020a039081169116145b15156104b957600080fd5b600160a060020a03821615156104ce57600080fd5b600160a060020a033016600090815260016020526040902054819010156104f457600080fd5b600160a060020a03821660009081526001602052604090205461051d908263ffffffff610a9516565b600160a060020a03808416600090815260016020526040808220939093553090911681522054610553908263ffffffff610aab16565b600160a060020a033081166000818152600160205260409081902093909355908416917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050565b6a34afff57c9c00998ac000081565b6000600160a060020a03831615156105d357600080fd5b600160a060020a0384166000908152600160205260409020548211156105f857600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561062b57600080fd5b600160a060020a038416600090815260016020526040902054610654908363ffffffff610aab16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610689908363ffffffff610a9516565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546106d1908363ffffffff610aab16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107a057600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107d7565b6107b0818463ffffffff610aab16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60408051908101604052600281527f4842000000000000000000000000000000000000000000000000000000000000602082015281565b6a295c13f6d569f30d9b800090565b6000600160a060020a03831615156108c457600080fd5b600160a060020a0333166000908152600160205260409020548211156108e957600080fd5b600160a060020a033316600090815260016020526040902054610912908363ffffffff610aab16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610947908363ffffffff610a9516565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6a295c13f6d569f30d9b800081565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546109ef908363ffffffff610a9516565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600454600160a060020a031681565b600082820183811015610aa457fe5b9392505050565b600082821115610ab757fe5b509003905600a165627a7a72305820636ad2458eb1383875920414c09013fc0e88a84c6960292cc59164ae54ffff5f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 2,304 |
0x0530e70731430b2a60413b22cefc6648f649b3d7
|
pragma solidity ^0.4.24;
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) 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 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 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 Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract Controller is MintableToken, PausableToken {
address public thisAddr; // matches delegation slot in proxy
uint256 public cap; // the max cap of this token
string public constant name = "KleanCoin"; // solium-disable-line uppercase
string public constant symbol = "KLEAN"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
constructor() public {}
/**
* @dev Function to initialize storage, only callable from proxy.
* @param _controller The address where code is loaded from through delegatecall
* @param _cap The cap that should be set for the token
*/
function initialize(address _controller, uint256 _cap) public onlyOwner {
require(cap == 0, "Cap is already set");
require(_cap > 0, "Trying to set an invalid cap");
require(thisAddr == _controller, "Not calling from proxy");
cap = _cap;
totalSupply_ = 0;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) {
require(cap > 0, "Cap not set, not initialized");
require(totalSupply_.add(_amount) <= cap, "Trying to mint over the cap");
return super.mint(_to, _amount);
}
}
contract LockedToken is Controller {
mapping(address => bool) public authorized;
bool public unlocked;
/**
* @dev Modified modifier to make a function callable only when the contract
* is not paused or if the msg.sender is the defined sale contract.
*/
modifier whenNotLockedOrAuthorized() {
require(msg.sender == owner || unlocked || authorized[msg.sender], "Token locked or sender unauthorized");
_;
}
constructor() public {}
function setAuthorized(address _addr, bool _status) public onlyOwner returns (bool) {
require(authorized[_addr] != _status, "That is already the current status");
authorized[_addr] = _status;
}
function setUnlock(bool _status) public onlyOwner returns (bool) {
require(unlocked != _status, "That is already the current status");
unlocked = _status;
}
function transfer(address _to, uint256 _value) public whenNotLockedOrAuthorized returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotLockedOrAuthorized returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotLockedOrAuthorized returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue)
public whenNotLockedOrAuthorized returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue)
public whenNotLockedOrAuthorized returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
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;
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016457806306fdde0314610193578063095ea7b31461022357806318160ddd1461028857806323b872dd146102b3578063313ce56714610338578063355274ea146103695780633f4ba83a1461039457806340c10f19146103ab5780635c975abb14610410578063661884631461043f5780636a5e2650146104a457806370a08231146104d3578063711bf9b21461052a578063715018a61461059157806378d8fed8146105a85780637d64bcb4146105ef5780638456cb591461061e5780638da5cb5b1461063557806395d89b411461068c578063a9059cbb1461071c578063b918161114610781578063cd6dc687146107dc578063d73dd62314610829578063d9ef58a51461088e578063dd62ed3e146108e5578063f2fde38b1461095c575b600080fd5b34801561017057600080fd5b5061017961099f565b604051808215151515815260200191505060405180910390f35b34801561019f57600080fd5b506101a86109b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e85780820151818401526020810190506101cd565b50505050905090810190601f1680156102155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022f57600080fd5b5061026e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109eb565b604051808215151515815260200191505060405180910390f35b34801561029457600080fd5b5061029d610b55565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b5061031e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5f565b604051808215151515815260200191505060405180910390f35b34801561034457600080fd5b5061034d610ccb565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037557600080fd5b5061037e610cd0565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610cd6565b005b3480156103b757600080fd5b506103f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d96565b604051808215151515815260200191505060405180910390f35b34801561041c57600080fd5b50610425610f2a565b604051808215151515815260200191505060405180910390f35b34801561044b57600080fd5b5061048a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f3d565b604051808215151515815260200191505060405180910390f35b3480156104b057600080fd5b506104b96110a7565b604051808215151515815260200191505060405180910390f35b3480156104df57600080fd5b50610514600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ba565b6040518082815260200191505060405180910390f35b34801561053657600080fd5b50610577600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611102565b604051808215151515815260200191505060405180910390f35b34801561059d57600080fd5b506105a66112ab565b005b3480156105b457600080fd5b506105d56004803603810190808035151590602001909291905050506113b0565b604051808215151515815260200191505060405180910390f35b3480156105fb57600080fd5b506106046114de565b604051808215151515815260200191505060405180910390f35b34801561062a57600080fd5b506106336115a6565b005b34801561064157600080fd5b5061064a611667565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069857600080fd5b506106a161168d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106e15780820151818401526020810190506106c6565b50505050905090810190601f16801561070e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561072857600080fd5b50610767600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116c6565b604051808215151515815260200191505060405180910390f35b34801561078d57600080fd5b506107c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611830565b604051808215151515815260200191505060405180910390f35b3480156107e857600080fd5b50610827600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611850565b005b34801561083557600080fd5b50610874600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a76565b604051808215151515815260200191505060405180910390f35b34801561089a57600080fd5b506108a3611be0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108f157600080fd5b50610946600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c06565b6040518082815260200191505060405180910390f35b34801561096857600080fd5b5061099d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c8d565b005b600360149054906101000a900460ff1681565b6040805190810160405280600981526020017f4b6c65616e436f696e000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a555750600760009054906101000a900460ff165b80610aa95750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610b43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610b4d8383611cf5565b905092915050565b6000600154905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bc95750600760009054906101000a900460ff165b80610c1d5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610cb7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cc2848484611d25565b90509392505050565b601281565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3257600080fd5b600360159054906101000a900460ff161515610d4d57600080fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df457600080fd5b600360149054906101000a900460ff16151515610e1057600080fd5b6000600554111515610e8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f436170206e6f74207365742c206e6f7420696e697469616c697a65640000000081525060200191505060405180910390fd5b600554610ea283600154611d5790919063ffffffff16565b11151515610f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f547279696e6720746f206d696e74206f7665722074686520636170000000000081525060200191505060405180910390fd5b610f228383611d73565b905092915050565b600360159054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fa75750600760009054906101000a900460ff165b80610ffb5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611095576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61109f8383611f59565b905092915050565b600760009054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561116057600080fd5b811515600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415151561124e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f5468617420697320616c7265616479207468652063757272656e74207374617481526020017f757300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561130757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140e57600080fd5b811515600760009054906101000a900460ff161515141515156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f5468617420697320616c7265616479207468652063757272656e74207374617481526020017f757300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600760006101000a81548160ff021916908315150217905550919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153c57600080fd5b600360149054906101000a900460ff1615151561155857600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160257600080fd5b600360159054906101000a900460ff1615151561161e57600080fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4b4c45414e00000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117305750600760009054906101000a900460ff165b806117845750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561181e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6118288383611f89565b905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ac57600080fd5b6000600554141515611926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f43617020697320616c726561647920736574000000000000000000000000000081525060200191505060405180910390fd5b60008111151561199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f547279696e6720746f2073657420616e20696e76616c6964206361700000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4e6f742063616c6c696e672066726f6d2070726f78790000000000000000000081525060200191505060405180910390fd5b8060058190555060006001819055505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ae05750600760009054906101000a900460ff165b80611b345750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611bce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e206c6f636b6564206f722073656e64657220756e617574686f726981526020017f7a6564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611bd88383611fb9565b905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce957600080fd5b611cf281611fe9565b50565b6000600360159054906101000a900460ff16151515611d1357600080fd5b611d1d83836120e5565b905092915050565b6000600360159054906101000a900460ff16151515611d4357600080fd5b611d4e8484846121d7565b90509392505050565b60008183019050828110151515611d6a57fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd157600080fd5b600360149054906101000a900460ff16151515611ded57600080fd5b611e0282600154611d5790919063ffffffff16565b600181905550611e59826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360159054906101000a900460ff16151515611f7757600080fd5b611f818383612592565b905092915050565b6000600360159054906101000a900460ff16151515611fa757600080fd5b611fb18383612824565b905092915050565b6000600360159054906101000a900460ff16151515611fd757600080fd5b611fe18383612a44565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561202557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561222657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156122b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156122ed57600080fd5b61233e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156126a4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612738565b6126b78382612c4090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561287357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156128af57600080fd5b612900826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c4090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612993826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000612ad582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515612c4e57fe5b8183039050929150505600a165627a7a72305820b3feed977df504eca403fc44a09f3aff8e2acd1ee4abbce1750628efa4cee0c20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 2,305 |
0xd626547ec8f44e7075f36091e7fd898af4342ee6
|
/**
*Submitted for verification at Etherscan.io on 2020-12-22
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) 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
) 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();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212204330cf565ecebb144d7dce71e8dcb51e7aae3681c4a8600f9c568e8a073f0b9764736f6c63430007060033
|
{"success": true, "error": null, "results": {}}
| 2,306 |
0x6582a5b139fc1c6360846efdc4440d51aad4df7b
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,307 |
0xf4a4940651a711123ad5c8abd0a1ca8e756a3955
|
/*
* Official utility token of $SAITAMA
* Join our discord http://discord.gg/saitama
* _____ _ __ __ ___ __
* / ___/____ _(_) /_____ _/ |/ /___ _/ /_____ _____
* \__ \/ __ `/ / __/ __ `/ /|_/ / __ `/ //_/ _ \/ ___/
* ___/ / /_/ / / /_/ /_/ / / / / /_/ / ,< / __/ /
* /____/\__,_/_/\__/\__,_/_/ /_/\__,_/_/|_|\___/_/
*/
// 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 SaitaMKR 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 _isnotTaxed;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotalAmt = (MAX-(MAX%_tTotal));
uint256 private _tFeeTotalAmt;
uint256 private _feeForAddr1;
uint256 private _feeForAddr2;
address payable private _marketingWallet;
string private constant _name = "SaitaMaker";
string private constant _symbol = "SaitaMKR";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_marketingWallet = payable(0x6918f11D3bc7C8b9Ed705ecCf08059DCD62455fb);
_rOwned[_msgSender()] = _rTotalAmt;
_isnotTaxed[owner()] = true;
_isnotTaxed[address(this)] = true;
_isnotTaxed[_marketingWallet] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotalAmt, "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");
_feeForAddr1 = 2;
_feeForAddr2 = 3;
if (from != owner() && to != owner()) {
if (from != address(uniswapV2Router) && to == uniswapV2Pair && ! _isnotTaxed[from]) {
_feeForAddr1 = 2;
_feeForAddr2 = 4;
}
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 {
_marketingWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
_maxTxAmount = 1e11 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotalAmt = _rTotalAmt.sub(rFee);
_tFeeTotalAmt = _tFeeTotalAmt.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, _feeForAddr1, _feeForAddr2);
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 = _rTotalAmt;
uint256 tSupply = _tTotal;
if (rSupply < _rTotalAmt.div(_tTotal)) return (_rTotalAmt, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100ab5760003560e01c8063715018a611610064578063715018a6146101ef5780638da5cb5b1461020657806395d89b4114610231578063a9059cbb1461025c578063c9567bf914610299578063dd62ed3e146102b0576100b2565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011f57806323b872dd1461014a578063313ce5671461018757806370a08231146101b2576100b2565b366100b257005b600080fd5b3480156100c357600080fd5b506100cc6102ed565b6040516100d991906121c6565b60405180910390f35b3480156100ee57600080fd5b5061010960048036038101906101049190611dc2565b61032a565b60405161011691906121ab565b60405180910390f35b34801561012b57600080fd5b50610134610348565b6040516101419190612328565b60405180910390f35b34801561015657600080fd5b50610171600480360381019061016c9190611d73565b610359565b60405161017e91906121ab565b60405180910390f35b34801561019357600080fd5b5061019c610432565b6040516101a9919061239d565b60405180910390f35b3480156101be57600080fd5b506101d960048036038101906101d49190611ce5565b61043b565b6040516101e69190612328565b60405180910390f35b3480156101fb57600080fd5b5061020461048c565b005b34801561021257600080fd5b5061021b6105df565b60405161022891906120dd565b60405180910390f35b34801561023d57600080fd5b50610246610608565b60405161025391906121c6565b60405180910390f35b34801561026857600080fd5b50610283600480360381019061027e9190611dc2565b610645565b60405161029091906121ab565b60405180910390f35b3480156102a557600080fd5b506102ae610663565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190611d37565b610ba5565b6040516102e49190612328565b60405180910390f35b60606040518060400160405280600a81526020017f53616974614d616b657200000000000000000000000000000000000000000000815250905090565b600061033e610337610c2c565b8484610c34565b6001905092915050565b600068056bc75e2d63100000905090565b6000610366848484610dff565b61042784610372610c2c565b6104228560405180606001604052806028815260200161291560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103d8610c2c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118e9092919063ffffffff16565b610c34565b600190509392505050565b60006009905090565b6000610485600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111f2565b9050919050565b610494610c2c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610521576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051890612288565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f53616974614d4b52000000000000000000000000000000000000000000000000815250905090565b6000610659610652610c2c565b8484610dff565b6001905092915050565b61066b610c2c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ef90612288565b60405180910390fd5b600c60149054906101000a900460ff1615610748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073f90612308565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506107d830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000610c34565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561081e57600080fd5b505afa158015610832573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108569190611d0e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b857600080fd5b505afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f09190611d0e565b6040518363ffffffff1660e01b815260040161090d9291906120f8565b602060405180830381600087803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f9190611d0e565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306109e83061043b565b6000806109f36105df565b426040518863ffffffff1660e01b8152600401610a159695949392919061214a565b6060604051808303818588803b158015610a2e57600080fd5b505af1158015610a42573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a679190611e27565b5050506001600c60166101000a81548160ff02191690831515021790555068056bc75e2d63100000600d819055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b4f929190612121565b602060405180830381600087803b158015610b6957600080fd5b505af1158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611dfe565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9b906122e8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b90612228565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610df29190612328565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e66906122c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610edf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed6906121e8565b60405180910390fd5b60008111610f22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f19906122a8565b60405180910390fd5b60026008819055506003600981905550610f3a6105df565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610fa85750610f786105df565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561117e57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110585750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80156110ae5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156110c457600260088190555060046009819055505b60006110cf3061043b565b9050600c60159054906101000a900460ff1615801561113c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111545750600c60169054906101000a900460ff165b1561117c5761116281611260565b6000479050600081111561117a576111794761155a565b5b505b505b6111898383836115c6565b505050565b60008383111582906111d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cd91906121c6565b60405180910390fd5b50600083856111e591906124ee565b9050809150509392505050565b6000600654821115611239576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123090612208565b60405180910390fd5b60006112436115d6565b9050611258818461160190919063ffffffff16565b915050919050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112be577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156112ec5781602001602082028036833780820191505090505b509050308160008151811061132a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113cc57600080fd5b505afa1580156113e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114049190611d0e565b8160018151811061143e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506114a530600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610c34565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611509959493929190612343565b600060405180830381600087803b15801561152357600080fd5b505af1158015611537573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115c2573d6000803e3d6000fd5b5050565b6115d183838361164b565b505050565b60008060006115e3611816565b915091506115fa818361160190919063ffffffff16565b9250505090565b600061164383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611878565b905092915050565b60008060008060008061165d876118db565b9550955095509550955095506116bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061175085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179c816119eb565b6117a68483611aa8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118039190612328565b60405180910390a3505050505050505050565b60008060006006549050600068056bc75e2d63100000905061184c68056bc75e2d6310000060065461160190919063ffffffff16565b82101561186b5760065468056bc75e2d63100000935093505050611874565b81819350935050505b9091565b600080831182906118bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b691906121c6565b60405180910390fd5b50600083856118ce9190612463565b9050809150509392505050565b60008060008060008060008060006118f88a600854600954611ae2565b92509250925060006119086115d6565b9050600080600061191b8e878787611b78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061198583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061118e565b905092915050565b600080828461199c919061240d565b9050838110156119e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d890612248565b60405180910390fd5b8091505092915050565b60006119f56115d6565b90506000611a0c8284611c0190919063ffffffff16565b9050611a6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611abd8260065461194390919063ffffffff16565b600681905550611ad88160075461198d90919063ffffffff16565b6007819055505050565b600080600080611b0e6064611b00888a611c0190919063ffffffff16565b61160190919063ffffffff16565b90506000611b386064611b2a888b611c0190919063ffffffff16565b61160190919063ffffffff16565b90506000611b6182611b53858c61194390919063ffffffff16565b61194390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611b918589611c0190919063ffffffff16565b90506000611ba88689611c0190919063ffffffff16565b90506000611bbf8789611c0190919063ffffffff16565b90506000611be882611bda858761194390919063ffffffff16565b61194390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c145760009050611c76565b60008284611c229190612494565b9050828482611c319190612463565b14611c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6890612268565b60405180910390fd5b809150505b92915050565b600081359050611c8b816128cf565b92915050565b600081519050611ca0816128cf565b92915050565b600081519050611cb5816128e6565b92915050565b600081359050611cca816128fd565b92915050565b600081519050611cdf816128fd565b92915050565b600060208284031215611cf757600080fd5b6000611d0584828501611c7c565b91505092915050565b600060208284031215611d2057600080fd5b6000611d2e84828501611c91565b91505092915050565b60008060408385031215611d4a57600080fd5b6000611d5885828601611c7c565b9250506020611d6985828601611c7c565b9150509250929050565b600080600060608486031215611d8857600080fd5b6000611d9686828701611c7c565b9350506020611da786828701611c7c565b9250506040611db886828701611cbb565b9150509250925092565b60008060408385031215611dd557600080fd5b6000611de385828601611c7c565b9250506020611df485828601611cbb565b9150509250929050565b600060208284031215611e1057600080fd5b6000611e1e84828501611ca6565b91505092915050565b600080600060608486031215611e3c57600080fd5b6000611e4a86828701611cd0565b9350506020611e5b86828701611cd0565b9250506040611e6c86828701611cd0565b9150509250925092565b6000611e828383611e8e565b60208301905092915050565b611e9781612522565b82525050565b611ea681612522565b82525050565b6000611eb7826123c8565b611ec181856123eb565b9350611ecc836123b8565b8060005b83811015611efd578151611ee48882611e76565b9750611eef836123de565b925050600181019050611ed0565b5085935050505092915050565b611f1381612534565b82525050565b611f2281612577565b82525050565b6000611f33826123d3565b611f3d81856123fc565b9350611f4d818560208601612589565b611f568161261a565b840191505092915050565b6000611f6e6023836123fc565b9150611f798261262b565b604082019050919050565b6000611f91602a836123fc565b9150611f9c8261267a565b604082019050919050565b6000611fb46022836123fc565b9150611fbf826126c9565b604082019050919050565b6000611fd7601b836123fc565b9150611fe282612718565b602082019050919050565b6000611ffa6021836123fc565b915061200582612741565b604082019050919050565b600061201d6020836123fc565b915061202882612790565b602082019050919050565b60006120406029836123fc565b915061204b826127b9565b604082019050919050565b60006120636025836123fc565b915061206e82612808565b604082019050919050565b60006120866024836123fc565b915061209182612857565b604082019050919050565b60006120a96017836123fc565b91506120b4826128a6565b602082019050919050565b6120c881612560565b82525050565b6120d78161256a565b82525050565b60006020820190506120f26000830184611e9d565b92915050565b600060408201905061210d6000830185611e9d565b61211a6020830184611e9d565b9392505050565b60006040820190506121366000830185611e9d565b61214360208301846120bf565b9392505050565b600060c08201905061215f6000830189611e9d565b61216c60208301886120bf565b6121796040830187611f19565b6121866060830186611f19565b6121936080830185611e9d565b6121a060a08301846120bf565b979650505050505050565b60006020820190506121c06000830184611f0a565b92915050565b600060208201905081810360008301526121e08184611f28565b905092915050565b6000602082019050818103600083015261220181611f61565b9050919050565b6000602082019050818103600083015261222181611f84565b9050919050565b6000602082019050818103600083015261224181611fa7565b9050919050565b6000602082019050818103600083015261226181611fca565b9050919050565b6000602082019050818103600083015261228181611fed565b9050919050565b600060208201905081810360008301526122a181612010565b9050919050565b600060208201905081810360008301526122c181612033565b9050919050565b600060208201905081810360008301526122e181612056565b9050919050565b6000602082019050818103600083015261230181612079565b9050919050565b600060208201905081810360008301526123218161209c565b9050919050565b600060208201905061233d60008301846120bf565b92915050565b600060a08201905061235860008301886120bf565b6123656020830187611f19565b81810360408301526123778186611eac565b90506123866060830185611e9d565b61239360808301846120bf565b9695505050505050565b60006020820190506123b260008301846120ce565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061241882612560565b915061242383612560565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612458576124576125bc565b5b828201905092915050565b600061246e82612560565b915061247983612560565b925082612489576124886125eb565b5b828204905092915050565b600061249f82612560565b91506124aa83612560565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156124e3576124e26125bc565b5b828202905092915050565b60006124f982612560565b915061250483612560565b925082821015612517576125166125bc565b5b828203905092915050565b600061252d82612540565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061258282612560565b9050919050565b60005b838110156125a757808201518184015260208101905061258c565b838111156125b6576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6128d881612522565b81146128e357600080fd5b50565b6128ef81612534565b81146128fa57600080fd5b50565b61290681612560565b811461291157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e5ab664d0b71d551010874daeaaae32500e2b2aa972c42da3dc7f25fe3d893ad64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,308 |
0x433e6d2e5a2eb07a62885b3c1fb08d74e7927811
|
pragma solidity ^0.4.24;
/**
* @title DIETCoin
* @author DIETCoin
* @dev DIETCoin is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
/**
* @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.
*/
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 ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title DIETCoin
* @author BLACK DIA COIN TEAM
* @dev DIETCoin is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract DIETCoin is ERC223, Ownable {
using SafeMath for uint256;
string public name = "Diet Coin";
string public symbol = "DIET";
uint8 public decimals = 8;
uint256 public totalSupply = 1e10 * 2e8;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
function DIETCoin() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @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 success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @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;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6080604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610178578063095ea7b31461020257806318160ddd1461022657806323b872dd1461024d578063313ce5671461027757806340c10f19146102a25780634f25eced146102c657806364ddc605146102db57806370a08231146103695780637d64bcb41461038a5780638da5cb5b1461039f57806394594625146103d057806395d89b41146104275780639dc29fac1461043c578063a8f11eb914610145578063a9059cbb14610460578063b414d4b614610484578063be45fd62146104a5578063c341b9f61461050e578063cbbe974b14610567578063d39b1d4814610588578063dd62ed3e146105a0578063dd924594146105c7578063f0dc417114610655578063f2fde38b146106e3578063f6368f8a14610704575b61014d6107ab565b005b34801561015b57600080fd5b5061016461090f565b604080519115158252519081900360200190f35b34801561018457600080fd5b5061018d610918565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c75781810151838201526020016101af565b50505050905090810190601f1680156101f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020e57600080fd5b50610164600160a060020a03600435166024356109ab565b34801561023257600080fd5b5061023b610a11565b60408051918252519081900360200190f35b34801561025957600080fd5b50610164600160a060020a0360043581169060243516604435610a17565b34801561028357600080fd5b5061028c610c1b565b6040805160ff9092168252519081900360200190f35b3480156102ae57600080fd5b50610164600160a060020a0360043516602435610c24565b3480156102d257600080fd5b5061023b610d24565b3480156102e757600080fd5b506040805160206004803580820135838102808601850190965280855261014d95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d2a9650505050505050565b34801561037557600080fd5b5061023b600160a060020a0360043516610e8e565b34801561039657600080fd5b50610164610ea9565b3480156103ab57600080fd5b506103b4610f0f565b60408051600160a060020a039092168252519081900360200190f35b3480156103dc57600080fd5b5060408051602060048035808201358381028086018501909652808552610164953695939460249493850192918291850190849080828437509497505093359450610f1e9350505050565b34801561043357600080fd5b5061018d61118f565b34801561044857600080fd5b5061014d600160a060020a03600435166024356111f0565b34801561046c57600080fd5b50610164600160a060020a03600435166024356112d5565b34801561049057600080fd5b50610164600160a060020a0360043516611398565b3480156104b157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610164948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506113ad9650505050505050565b34801561051a57600080fd5b506040805160206004803580820135838102808601850190965280855261014d95369593946024949385019291829185019084908082843750949750505050913515159250611466915050565b34801561057357600080fd5b5061023b600160a060020a0360043516611570565b34801561059457600080fd5b5061014d600435611582565b3480156105ac57600080fd5b5061023b600160a060020a036004358116906024351661159e565b3480156105d357600080fd5b506040805160206004803580820135838102808601850190965280855261016495369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506115c99650505050505050565b34801561066157600080fd5b506040805160206004803580820135838102808601850190965280855261016495369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061187c9650505050505050565b3480156106ef57600080fd5b5061014d600160a060020a0360043516611b5c565b34801561071057600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610164948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611bf19650505050505050565b60006006541180156107d95750600654600154600160a060020a031660009081526008602052604090205410155b80156107f55750336000908152600a602052604090205460ff16155b801561080f5750336000908152600b602052604090205442115b151561081a57600080fd5b600034111561085e57600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561085c573d6000803e3d6000fd5b505b600654600154600160a060020a031660009081526008602052604090205461088b9163ffffffff611f0f16565b600154600160a060020a031660009081526008602052604080822092909255600654338252919020546108c39163ffffffff611f2116565b3360008181526008602090815260409182902093909355600154600654825190815291519293600160a060020a03909116926000805160206123038339815191529281900390910190a3565b60075460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109a15780601f10610976576101008083540402835291602001916109a1565b820191906000526020600020905b81548152906001019060200180831161098457829003601f168201915b5050505050905090565b336000818152600960209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055490565b6000600160a060020a03831615801590610a315750600082115b8015610a555750600160a060020a0384166000908152600860205260409020548211155b8015610a845750600160a060020a03841660009081526009602090815260408083203384529091529020548211155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f0f16565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611f2116565b600160a060020a038085166000908152600860209081526040808320949094559187168152600982528281203382529091522054610bc1908363ffffffff611f0f16565b600160a060020a0380861660008181526009602090815260408083203384528252918290209490945580518681529051928716939192600080516020612303833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b600154600090600160a060020a03163314610c3e57600080fd5b60075460ff1615610c4e57600080fd5b60008211610c5b57600080fd5b600554610c6e908363ffffffff611f2116565b600555600160a060020a038316600090815260086020526040902054610c9a908363ffffffff611f2116565b600160a060020a038416600081815260086020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206123038339815191529181900360200190a350600192915050565b60065481565b600154600090600160a060020a03163314610d4457600080fd5b60008351118015610d56575081518351145b1515610d6157600080fd5b5060005b8251811015610e89578181815181101515610d7c57fe5b90602001906020020151600b60008584815181101515610d9857fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610dc557600080fd5b8181815181101515610dd357fe5b90602001906020020151600b60008584815181101515610def57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610e2057fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610e6257fe5b906020019060200201516040518082815260200191505060405180910390a2600101610d65565b505050565b600160a060020a031660009081526008602052604090205490565b600154600090600160a060020a03163314610ec357600080fd5b60075460ff1615610ed357600080fd5b6007805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610f33575060008551115b8015610f4f5750336000908152600a602052604090205460ff16155b8015610f695750336000908152600b602052604090205442115b1515610f7457600080fd5b610f88846305f5e10063ffffffff611f3016565b9350610f9e855185611f3090919063ffffffff16565b33600090815260086020526040902054909250821115610fbd57600080fd5b5060005b8451811015611154578481815181101515610fd857fe5b90602001906020020151600160a060020a03166000141580156110305750600a6000868381518110151561100857fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156110775750600b6000868381518110151561104957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561108257600080fd5b6110c78460086000888581518110151561109857fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611f2116565b6008600087848151811015156110d957fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061110a57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612303833981519152866040518082815260200191505060405180910390a3600101610fc1565b33600090815260086020526040902054611174908363ffffffff611f0f16565b33600090815260086020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109a15780601f10610976576101008083540402835291602001916109a1565b600154600160a060020a0316331461120757600080fd5b60008111801561122f5750600160a060020a0382166000908152600860205260409020548111155b151561123a57600080fd5b600160a060020a038216600090815260086020526040902054611263908263ffffffff611f0f16565b600160a060020a03831660009081526008602052604090205560055461128f908263ffffffff611f0f16565b600555604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600060606000831180156112f95750336000908152600a602052604090205460ff16155b801561131e5750600160a060020a0384166000908152600a602052604090205460ff16155b80156113385750336000908152600b602052604090205442115b801561135b5750600160a060020a0384166000908152600b602052604090205442115b151561136657600080fd5b61136f84611f5b565b156113865761137f848483611f63565b9150611391565b61137f8484836121a7565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156113ce5750336000908152600a602052604090205460ff16155b80156113f35750600160a060020a0384166000908152600a602052604090205460ff16155b801561140d5750336000908152600b602052604090205442115b80156114305750600160a060020a0384166000908152600b602052604090205442115b151561143b57600080fd5b61144484611f5b565b1561145b57611454848484611f63565b9050610c14565b6114548484846121a7565b600154600090600160a060020a0316331461148057600080fd5b825160001061148e57600080fd5b5060005b8251811015610e895782818151811015156114a957fe5b60209081029091010151600160a060020a031615156114c757600080fd5b81600a600085848151811015156114da57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055825183908290811061151a57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a2600101611492565b600b6020526000908152604090205481565b600154600160a060020a0316331461159957600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b60008060008085511180156115df575083518551145b80156115fb5750336000908152600a602052604090205460ff16155b80156116155750336000908152600b602052604090205442115b151561162057600080fd5b5060009050805b8451811015611782576000848281518110151561164057fe5b906020019060200201511180156116785750848181518110151561166057fe5b90602001906020020151600160a060020a0316600014155b80156116b95750600a6000868381518110151561169157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156117005750600b600086838151811015156116d257fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561170b57600080fd5b6117376305f5e100858381518110151561172157fe5b602090810290910101519063ffffffff611f3016565b848281518110151561174557fe5b6020908102909101015283516117789085908390811061176157fe5b60209081029091010151839063ffffffff611f2116565b9150600101611627565b3360009081526008602052604090205482111561179e57600080fd5b5060005b8451811015611154576117d884828151811015156117bc57fe5b9060200190602002015160086000888581518110151561109857fe5b6008600087848151811015156117ea57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061181b57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612303833981519152868481518110151561185557fe5b906020019060200201516040518082815260200191505060405180910390a36001016117a2565b60015460009081908190600160a060020a0316331461189a57600080fd5b600085511180156118ac575083518551145b15156118b757600080fd5b5060009050805b8451811015611b3c57600084828151811015156118d757fe5b9060200190602002015111801561190f575084818151811015156118f757fe5b90602001906020020151600160a060020a0316600014155b80156119505750600a6000868381518110151561192857fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156119975750600b6000868381518110151561196957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119a257600080fd5b6119b86305f5e100858381518110151561172157fe5b84828151811015156119c657fe5b6020908102909101015283518490829081106119de57fe5b906020019060200201516008600087848151811015156119fa57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541015611a2857600080fd5b611a848482815181101515611a3957fe5b90602001906020020151600860008885815181101515611a5557fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611f0f16565b600860008784815181101515611a9657fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611acb9085908390811061176157fe5b915033600160a060020a03168582815181101515611ae557fe5b90602001906020020151600160a060020a03166000805160206123038339815191528684815181101515611b1557fe5b906020019060200201516040518082815260200191505060405180910390a36001016118be565b33600090815260086020526040902054611174908363ffffffff611f2116565b600154600160a060020a03163314611b7357600080fd5b600160a060020a0381161515611b8857600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c125750336000908152600a602052604090205460ff16155b8015611c375750600160a060020a0385166000908152600a602052604090205460ff16155b8015611c515750336000908152600b602052604090205442115b8015611c745750600160a060020a0385166000908152600b602052604090205442115b1515611c7f57600080fd5b611c8885611f5b565b15611ef95733600090815260086020526040902054841115611ca957600080fd5b33600090815260086020526040902054611cc9908563ffffffff611f0f16565b3360009081526008602052604080822092909255600160a060020a03871681522054611cfb908563ffffffff611f2116565b600160a060020a038616600081815260086020908152604080832094909455925185519293919286928291908401908083835b60208310611d4d5780518252601f199092019160209182019101611d2e565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611ddf578181015183820152602001611dc7565b50505050905090810190601f168015611e0c5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611e2c57fe5b826040518082805190602001908083835b60208310611e5c5780518252601f199092019160209182019101611e3d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206123038339815191529181900360200190a3506001611f07565b611f048585856121a7565b90505b949350505050565b600082821115611f1b57fe5b50900390565b600082820183811015610c1457fe5b600080831515611f435760009150611391565b50828202828482811515611f5357fe5b0414610c1457fe5b6000903b1190565b336000908152600860205260408120548190841115611f8157600080fd5b33600090815260086020526040902054611fa1908563ffffffff611f0f16565b3360009081526008602052604080822092909255600160a060020a03871681522054611fd3908563ffffffff611f2116565b600160a060020a03861660008181526008602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015612071578181015183820152602001612059565b50505050905090810190601f16801561209e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106121075780518252601f1990920191602091820191016120e8565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206123038339815191529181900360200190a3506001949350505050565b336000908152600860205260408120548311156121c357600080fd5b336000908152600860205260409020546121e3908463ffffffff611f0f16565b3360009081526008602052604080822092909255600160a060020a03861681522054612215908463ffffffff611f2116565b600160a060020a0385166000908152600860209081526040918290209290925551835184928291908401908083835b602083106122635780518252601f199092019160209182019101612244565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206123038339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ed1c9047ca7fbfd8559ea74109d500cba1fa70395a621b5e23caad9b6a1f766a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 2,309 |
0xfc38aa534e37394da32ba69ceaa41b9ef3ac4052
|
/*
*/
// 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 TowelieInu 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 = "Towelie Inu";
string private constant _symbol = 'TowelieINU';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 14;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610526565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610544565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610551565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105d8565b005b34801561029b57600080fd5b506102a4610651565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610656565b3480156102f257600080fd5b5061028d6106cc565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610700565b34801561033a57600080fd5b5061028d61076a565b34801561034f57600080fd5b5061035861080c565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081b565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561083f565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610853945050505050565b34801561047e57600080fd5b5061028d610907565b34801561049357600080fd5b5061028d610944565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d2b565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e30565b60408051808201909152600b81526a546f77656c696520496e7560a81b602082015290565b600061053a610533610e5b565b8484610e5f565b5060015b92915050565b683635c9adc5dea0000090565b600061055e848484610f4b565b6105ce8461056a610e5b565b6105c985604051806060016040528060288152602001611fc2602891396001600160a01b038a166000908152600460205260408120906105a8610e5b565b6001600160a01b031681526020810191909152604001600020549190611321565b610e5f565b5060019392505050565b6105e0610e5b565b6000546001600160a01b03908116911614610630576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b61065e610e5b565b6000546001600160a01b039081169116146106ae576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e0610e5b565b6001600160a01b0316146106f357600080fd5b476106fd816113b8565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074057506001600160a01b038116600090815260036020526040902054610765565b6001600160a01b0382166000908152600260205260409020546107629061143d565b90505b919050565b610772610e5b565b6000546001600160a01b039081169116146107c2576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600a815269546f77656c6965494e5560b01b602082015290565b600061053a61084c610e5b565b8484610f4b565b61085b610e5b565b6000546001600160a01b039081169116146108ab576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b60005b8151811015610903576001600760008484815181106108c957fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108ae565b5050565b6010546001600160a01b031661091b610e5b565b6001600160a01b03161461092e57600080fd5b600061093930610700565b90506106fd8161149d565b61094c610e5b565b6000546001600160a01b0390811691161461099c576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109fb576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a449030906001600160a01b0316683635c9adc5dea00000610e5f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7d57600080fd5b505afa158015610a91573d6000803e3d6000fd5b505050506040513d6020811015610aa757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af757600080fd5b505afa158015610b0b573d6000803e3d6000fd5b505050506040513d6020811015610b2157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7357600080fd5b505af1158015610b87573d6000803e3d6000fd5b505050506040513d6020811015610b9d57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bcf81610700565b600080610bda61080c565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4557600080fd5b505af1158015610c59573d6000803e3d6000fd5b50505050506040513d6060811015610c7057600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfc57600080fd5b505af1158015610d10573d6000803e3d6000fd5b505050506040513d6020811015610d2657600080fd5b505050565b610d33610e5b565b6000546001600160a01b03908116911614610d83576040805162461bcd60e51b81526020600482018190526024820152600080516020611fea833981519152604482015290519081900360640190fd5b60008111610dd8576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df66064610df0683635c9adc5dea000008461166b565b906116c4565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea45760405162461bcd60e51b81526004018080602001828103825260248152602001806120586024913960400191505060405180910390fd5b6001600160a01b038216610ee95760405162461bcd60e51b8152600401808060200182810382526022815260200180611f7f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f905760405162461bcd60e51b81526004018080602001828103825260258152602001806120336025913960400191505060405180910390fd5b6001600160a01b038216610fd55760405162461bcd60e51b8152600401808060200182810382526023815260200180611f326023913960400191505060405180910390fd5b600081116110145760405162461bcd60e51b815260040180806020018281038252602981526020018061200a6029913960400191505060405180910390fd5b61101c61080c565b6001600160a01b0316836001600160a01b031614158015611056575061104061080c565b6001600160a01b0316826001600160a01b031614155b156112c457601354600160b81b900460ff1615611150576001600160a01b038316301480159061108f57506001600160a01b0382163014155b80156110a957506012546001600160a01b03848116911614155b80156110c357506012546001600160a01b03838116911614155b15611150576012546001600160a01b03166110dc610e5b565b6001600160a01b0316148061110b57506013546001600160a01b0316611100610e5b565b6001600160a01b0316145b611150576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561115f57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a157506001600160a01b03821660009081526007602052604090205460ff16155b6111aa57600080fd5b6013546001600160a01b0384811691161480156111d557506012546001600160a01b03838116911614155b80156111fa57506001600160a01b03821660009081526005602052604090205460ff16155b801561120f5750601354600160b81b900460ff165b15611257576001600160a01b038216600090815260086020526040902054421161123857600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126230610700565b601354909150600160a81b900460ff1615801561128d57506013546001600160a01b03858116911614155b80156112a25750601354600160b01b900460ff165b156112c2576112b08161149d565b4780156112c0576112c0476113b8565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130657506001600160a01b03831660009081526005602052604090205460ff165b1561130f575060005b61131b84848484611706565b50505050565b600081848411156113b05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137557818101518382015260200161135d565b50505050905090810190601f1680156113a25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d28360026116c4565b6040518115909202916000818181858888f193505050501580156113fa573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114158360026116c4565b6040518115909202916000818181858888f19350505050158015610903573d6000803e3d6000fd5b6000600a548211156114805760405162461bcd60e51b815260040180806020018281038252602a815260200180611f55602a913960400191505060405180910390fd5b600061148a611822565b905061149683826116c4565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114de57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153257600080fd5b505afa158015611546573d6000803e3d6000fd5b505050506040513d602081101561155c57600080fd5b505181518290600190811061156d57fe5b6001600160a01b0392831660209182029290920101526012546115939130911684610e5f565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611619578181015183820152602001611601565b505050509050019650505050505050600060405180830381600087803b15801561164257600080fd5b505af1158015611656573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261167a5750600061053e565b8282028284828161168757fe5b04146114965760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa16021913960400191505060405180910390fd5b600061149683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611845565b80611713576117136118aa565b6001600160a01b03841660009081526006602052604090205460ff16801561175457506001600160a01b03831660009081526006602052604090205460ff16155b15611769576117648484846118dc565b611815565b6001600160a01b03841660009081526006602052604090205460ff161580156117aa57506001600160a01b03831660009081526006602052604090205460ff165b156117ba57611764848484611a00565b6001600160a01b03841660009081526006602052604090205460ff1680156117fa57506001600160a01b03831660009081526006602052604090205460ff165b1561180a57611764848484611aa9565b611815848484611b1c565b8061131b5761131b611b60565b600080600061182f611b6e565b909250905061183e82826116c4565b9250505090565b600081836118945760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137557818101518382015260200161135d565b5060008385816118a057fe5b0495945050505050565b600c541580156118ba5750600d54155b156118c4576118da565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ee87611ced565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119209088611d4a565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461194f9087611d4a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197e9086611d8c565b6001600160a01b0389166000908152600260205260409020556119a081611de6565b6119aa8483611e6e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1287611ced565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a449087611d4a565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a7a9084611d8c565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461197e9086611d8c565b600080600080600080611abb87611ced565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aed9088611d4a565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a449087611d4a565b600080600080600080611b2e87611ced565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061194f9087611d4a565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cad57826002600060098481548110611b9e57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c035750816003600060098481548110611bdc57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2157600a54683635c9adc5dea0000094509450505050611ce9565b611c616002600060098481548110611c3557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d4a565b9250611ca36003600060098481548110611c7757fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d4a565b9150600101611b82565b50600a54611cc490683635c9adc5dea000006116c4565b821015611ce357600a54683635c9adc5dea00000935093505050611ce9565b90925090505b9091565b6000806000806000806000806000611d0a8a600c54600d54611e92565b9250925092506000611d1a611822565b90506000806000611d2d8e878787611ee1565b919e509c509a509598509396509194505050505091939550919395565b600061149683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611321565b600082820183811015611496576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611df0611822565b90506000611dfe838361166b565b30600090815260026020526040902054909150611e1b9082611d8c565b3060009081526002602090815260408083209390935560069052205460ff1615610d265730600090815260036020526040902054611e599084611d8c565b30600090815260036020526040902055505050565b600a54611e7b9083611d4a565b600a55600b54611e8b9082611d8c565b600b555050565b6000808080611ea66064610df0898961166b565b90506000611eb96064610df08a8961166b565b90506000611ed182611ecb8b86611d4a565b90611d4a565b9992985090965090945050505050565b6000808080611ef0888661166b565b90506000611efe888761166b565b90506000611f0c888861166b565b90506000611f1e82611ecb8686611d4a565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f89867711635e8de7bbef5633bc8e50921fe48d25c44942bf100c4079d67e38764736f6c634300060c0033
|
{"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"}]}}
| 2,310 |
0xbc57130d3a379f49fcce5e52ec215b60722a4ef5
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
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;
}
}
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
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)
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
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;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.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;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
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);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
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));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) 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 YFI2CStaking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// YFI2C token contract address
address public constant tokenAddress = 0xdb665ab1D56B6821Aea7ca8F3BB2F7d805d4B1E1;
// reward rate 72.00% per year
uint public constant rewardRate = 7200;
uint public constant rewardInterval = 365 days; // 0.2% per week
// staking fee 1.5 %
uint public constant stakingFeeRate = 150;
// unstaking fee 0.5 %
uint public constant unstakingFeeRate = 50;
// unstaking possible after 24 hours
uint public constant cliffTime = 72 hours;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
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] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
function getStakersList(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] = stakingTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
uint private constant stakingAndDaoTokens = 950e18; // 950 YFI2C will be staked by owner
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require (_tokenAddr != tokenAddress, "Cannot Transfer Out YFI2C!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80637b0a47ee116100b8578063bec4de3f1161007c578063bec4de3f1461057b578063c326bf4f14610599578063d578ceab146105f1578063d816c7d51461060f578063f2fde38b1461062d578063f3f91fa01461067157610137565b80637b0a47ee1461046f5780638da5cb5b1461048d57806398896d10146104c15780639d76ea5814610519578063b6b55f251461054d57610137565b8063308feec3116100ff578063308feec314610315578063583d42fd146103335780635ef057be1461038b5780636270cd18146103a95780636a395ccb1461040157610137565b80630f1a64441461013c5780631911cf4a1461015a57806319aa70e7146102bf578063268cab49146102c95780632e1a7d4d146102e7575b600080fd5b6101446106c9565b6040518082815260200191505060405180910390f35b6101906004803603604081101561017057600080fd5b8101908080359060200190929190803590602001909291905050506106d0565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101df5780820151818401526020810190506101c4565b50505050905001858103845288818151815260200191508051906020019060200280838360005b83811015610221578082015181840152602081019050610206565b50505050905001858103835287818151815260200191508051906020019060200280838360005b83811015610263578082015181840152602081019050610248565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102a557808201518184015260208101905061028a565b505050509050019850505050505050505060405180910390f35b6102c76109e9565b005b6102d16109f4565b6040518082815260200191505060405180910390f35b610313600480360360208110156102fd57600080fd5b8101908080359060200190929190505050610a3b565b005b61031d610f80565b6040518082815260200191505060405180910390f35b6103756004803603602081101561034957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f91565b6040518082815260200191505060405180910390f35b610393610fa9565b6040518082815260200191505060405180910390f35b6103eb600480360360208110156103bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fae565b6040518082815260200191505060405180910390f35b61046d6004803603606081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc6565b005b610477611186565b6040518082815260200191505060405180910390f35b61049561118c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610503600480360360208110156104d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b0565b6040518082815260200191505060405180910390f35b61052161131f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105796004803603602081101561056357600080fd5b8101908080359060200190929190505050611337565b005b6105836117a7565b6040518082815260200191505060405180910390f35b6105db600480360360208110156105af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117af565b6040518082815260200191505060405180910390f35b6105f96117c7565b6040518082815260200191505060405180910390f35b6106176117cd565b6040518082815260200191505060405180910390f35b61066f6004803603602081101561064357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d2565b005b6106b36004803603602081101561068757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611921565b6040518082815260200191505060405180910390f35b6203f48081565b6060806060808486106106e257600080fd5b60006106f7878761193990919063ffffffff16565b905060608167ffffffffffffffff8111801561071257600080fd5b506040519080825280602002602001820160405280156107415781602001602082028036833780820191505090505b50905060608267ffffffffffffffff8111801561075d57600080fd5b5060405190808252806020026020018201604052801561078c5781602001602082028036833780820191505090505b50905060608367ffffffffffffffff811180156107a857600080fd5b506040519080825280602002602001820160405280156107d75781602001602082028036833780820191505090505b50905060608467ffffffffffffffff811180156107f357600080fd5b506040519080825280602002602001820160405280156108225781602001602082028036833780820191505090505b50905060008b90505b8a8110156109ce57600061084982600261195090919063ffffffff16565b905060006108608e8461193990919063ffffffff16565b90508187828151811061086f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548682815181106108f557fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485828151811061094d57fe5b602002602001018181525050600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548482815181106109a557fe5b60200260200101818152505050506109c760018261196a90919063ffffffff16565b905061082b565b50838383839850985098509850505050505092959194509250565b6109f233611986565b565b600068337fe5feaf2d18000060015410610a115760009050610a38565b6000610a3160015468337fe5feaf2d18000061193990919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610af0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6203f480610b46600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261193990919063ffffffff16565b11610b9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611f3b6034913960400191505060405180910390fd5b610ba533611986565b6000610bcf612710610bc1603285611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b90506000610be6828461193990919063ffffffff16565b905073db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c8d57600080fd5b505af1158015610ca1573d6000803e3d6000fd5b505050506040513d6020811015610cb757600080fd5b8101908080519060200190929190505050610d3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b8101908080519060200190929190505050610e6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610ebe83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193990919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f15336002611c6490919063ffffffff16565b8015610f6057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610f7b57610f79336002611c9490919063ffffffff16565b505b505050565b6000610f8c6002611cc4565b905090565b60056020528060005260406000206000915090505481565b609681565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616e6e6f74205472616e73666572204f75742059464932432100000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b505050506040513d602081101561116f57600080fd5b810190808051906020019092919050505050505050565b611c2081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006111c6826002611c6490919063ffffffff16565b6111d3576000905061131a565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611224576000905061131a565b6000611278600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261193990919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006113116127106113036301e133806112f5876112e7611c2089611c1c90919063ffffffff16565b611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b611c4b90919063ffffffff16565b90508093505050505b919050565b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e181565b600081116113ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b505050506040513d602081101561147a57600080fd5b81019080805190602001909291905050506114fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61150633611986565b6000611530612710611522609685611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b90506000611547828461193990919063ffffffff16565b905073db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115ee57600080fd5b505af1158015611602573d6000803e3d6000fd5b505050506040513d602081101561161857600080fd5b810190808051906020019092919050505061169b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b6116ed81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196a90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611744336002611c6490919063ffffffff16565b6117a25761175c336002611cd990919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b603281565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461182a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561186457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60008282111561194557fe5b818303905092915050565b600061195f8360000183611d09565b60001c905092915050565b60008082840190508381101561197c57fe5b8091505092915050565b6000611991826111b0565b90506000811115611bd45773db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a2157600080fd5b505af1158015611a35573d6000803e3d6000fd5b505050506040513d6020811015611a4b57600080fd5b8101908080519060200190929190505050611ace576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611b2081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196a90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b788160015461196a90919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611c3b575082848281611c3857fe5b04145b611c4157fe5b8091505092915050565b600080828481611c5757fe5b0490508091505092915050565b6000611c8c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d8c565b905092915050565b6000611cbc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611daf565b905092915050565b6000611cd282600001611e97565b9050919050565b6000611d01836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea8565b905092915050565b600081836000018054905011611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611f196022913960400191505060405180910390fd5b826000018281548110611d7957fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611e8b5760006001820390506000600186600001805490500390506000866000018281548110611dfa57fe5b9060005260206000200154905080876000018481548110611e1757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611e4f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611e91565b60009150505b92915050565b600081600001805490509050919050565b6000611eb48383611d8c565b611f0d578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f12565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212205f563b56659c2f091f54547a4c080ae0c1fe02c67f0979dc462e15a2831fb84764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,311 |
0xe324992E2b6Af62c08Bae6368d82856118cCE2BA
|
/*
Lupin Inu (LINU)
/$$ /$$ /$$$$$$
| $$ |__/ |_ $$_/
| $$ /$$ /$$ /$$$$$$ /$$ /$$$$$$$ | $$ /$$$$$$$ /$$ /$$
| $$ | $$ | $$ /$$__ $$| $$| $$__ $$ | $$ | $$__ $$| $$ | $$
| $$ | $$ | $$| $$ \ $$| $$| $$ \ $$ | $$ | $$ \ $$| $$ | $$
| $$ | $$ | $$| $$ | $$| $$| $$ | $$ | $$ | $$ | $$| $$ | $$
| $$$$$$$$| $$$$$$/| $$$$$$$/| $$| $$ | $$ /$$$$$$| $$ | $$| $$$$$$/
|________/ \______/ | $$____/ |__/|__/ |__/ |______/|__/ |__/ \______/
| $$
| $$
|__/
Official Links:
Telegram:
https://t.me/LupinInu
Twitter:
https://twitter.com/LupinInuETH
Website:
https://lupininu.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);
}
}
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 LupinInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lupin Inu";
string private constant _symbol = "LINU";
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 = 1;
uint256 private _taxFeeOnBuy = 5;
//Sell Fee
uint256 private _redisFeeOnSell = 2;
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 => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _marketingAddress = payable(0x6d5393b50EC6C561632EFdDCC2087745fFDD3B10);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000000 * 10**9; //0.5
uint256 public _maxWalletSize = 2000000000000 * 10**9; //2.0
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
bots[address(0x00000000000000000000000000000000001)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_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 {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _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;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612b10565b6106e0565b005b34801561020657600080fd5b5061020f61080a565b60405161021c9190612f6d565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612ad0565b610847565b6040516102599190612f37565b60405180910390f35b34801561026e57600080fd5b50610277610865565b6040516102849190612f52565b60405180910390f35b34801561029957600080fd5b506102a261088b565b6040516102af919061314f565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612a3d565b61089d565b6040516102ec9190612f37565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612a90565b610976565b005b34801561032a57600080fd5b50610333610af9565b604051610340919061314f565b60405180910390f35b34801561035557600080fd5b5061035e610aff565b60405161036b91906131c4565b60405180910390f35b34801561038057600080fd5b50610389610b08565b6040516103969190612f1c565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c191906129a3565b610b2e565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612b59565b610c1e565b005b3480156103fd57600080fd5b50610406610cd0565b005b34801561041457600080fd5b5061042f600480360381019061042a91906129a3565b610d42565b60405161043c919061314f565b60405180910390f35b34801561045157600080fd5b5061045a610d93565b005b34801561046857600080fd5b50610483600480360381019061047e9190612b86565b610ee6565b005b34801561049157600080fd5b5061049a610f85565b6040516104a7919061314f565b60405180910390f35b3480156104bc57600080fd5b506104c5610f8b565b6040516104d29190612f1c565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612b59565b610fb4565b005b34801561051057600080fd5b50610519611066565b604051610526919061314f565b60405180910390f35b34801561053b57600080fd5b5061054461106c565b6040516105519190612f6d565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612b86565b6110a9565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612bb3565b611148565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612ad0565b6111ff565b6040516105e09190612f37565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b91906129a3565b61121d565b60405161061d9190612f37565b60405180910390f35b34801561063257600080fd5b5061064d600480360381019061064891906129a3565b61123d565b60405161065a9190612f37565b60405180910390f35b34801561066f57600080fd5b5061067861125d565b005b34801561068657600080fd5b506106a1600480360381019061069c91906129fd565b6112d7565b6040516106ae919061314f565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612b86565b61135e565b005b6106e86113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c906130af565b60405180910390fd5b60005b81518110156108065760016010600084848151811061079a57610799613542565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107fe9061349b565b915050610778565b5050565b60606040518060400160405280600981526020017f4c7570696e20496e750000000000000000000000000000000000000000000000815250905090565b600061085b6108546113fd565b8484611405565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108aa8484846115d0565b61096b846108b66113fd565b610966856040518060600160405280602881526020016139c560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061091c6113fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc09092919063ffffffff16565b611405565b600190509392505050565b61097e6113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a02906130af565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a959061306f565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b366113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bba906130af565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c266113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caa906130af565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d116113fd565b73ffffffffffffffffffffffffffffffffffffffff1614610d3157600080fd5b6000479050610d3f81611e24565b50565b6000610d8c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e90565b9050919050565b610d9b6113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f906130af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610eee6113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f72906130af565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610fbc6113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611049576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611040906130af565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f4c494e5500000000000000000000000000000000000000000000000000000000815250905090565b6110b16113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611135906130af565b60405180910390fd5b8060188190555050565b6111506113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d4906130af565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061121361120c6113fd565b84846115d0565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661129e6113fd565b73ffffffffffffffffffffffffffffffffffffffff16146112be57600080fd5b60006112c930610d42565b90506112d481611efe565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113666113fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ea906130af565b60405180910390fd5b8060178190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c9061312f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc9061300f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c3919061314f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611640576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611637906130ef565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a790612f8f565b60405180910390fd5b600081116116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea906130cf565b60405180910390fd5b6116fb610f8b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117695750611739610f8b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611abf57601560149054906101000a900460ff1661180f57601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661180e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180590612faf565b60405180910390fd5b5b601654811115611854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184b90612fef565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f85750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061302f565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146119e4576017548161199984610d42565b6119a39190613285565b106119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da9061310f565b60405180910390fd5b5b60006119ef30610d42565b9050600060185482101590506016548210611a0a5760165491505b808015611a22575060158054906101000a900460ff16155b8015611a7c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611a945750601560169054906101000a900460ff165b15611abc57611aa282611efe565b60004790506000811115611aba57611ab947611e24565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b665750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c195750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c185750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611c275760009050611dae565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611cd25750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611cea57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d955750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611dad57600a54600c81905550600b54600d819055505b5b611dba84848484612184565b50505050565b6000838311158290611e08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dff9190612f6d565b60405180910390fd5b5060008385611e179190613366565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e8c573d6000803e3d6000fd5b5050565b6000600654821115611ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ece90612fcf565b60405180910390fd5b6000611ee16121b1565b9050611ef681846121dc90919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3557611f34613571565b5b604051908082528060200260200182016040528015611f635781602001602082028036833780820191505090505b5090503081600081518110611f7b57611f7a613542565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561201d57600080fd5b505afa158015612031573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205591906129d0565b8160018151811061206957612068613542565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d030601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611405565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161213495949392919061316a565b600060405180830381600087803b15801561214e57600080fd5b505af1158015612162573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061219257612191612226565b5b61219d848484612269565b806121ab576121aa612434565b5b50505050565b60008060006121be612448565b915091506121d581836121dc90919063ffffffff16565b9250505090565b600061221e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124ad565b905092915050565b6000600c5414801561223a57506000600d54145b1561224457612267565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061227b87612510565b9550955095509550955095506122d986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ba81612620565b6123c484836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612421919061314f565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008060006006549050600069152d02c7e14af6800000905061248069152d02c7e14af68000006006546121dc90919063ffffffff16565b8210156124a05760065469152d02c7e14af68000009350935050506124a9565b81819350935050505b9091565b600080831182906124f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124eb9190612f6d565b60405180910390fd5b506000838561250391906132db565b9050809150509392505050565b600080600080600080600080600061252d8a600c54600d54612717565b925092509250600061253d6121b1565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611dc0565b905092915050565b60008082846125d19190613285565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d9061304f565b60405180910390fd5b8091505092915050565b600061262a6121b1565b90506000612641828461283690919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61283690919063ffffffff16565b6121dc90919063ffffffff16565b9050600061276d606461275f888b61283690919063ffffffff16565b6121dc90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961283690919063ffffffff16565b905060006127dd868961283690919063ffffffff16565b905060006127f4878961283690919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561284957600090506128ab565b60008284612857919061330c565b905082848261286691906132db565b146128a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289d9061308f565b60405180910390fd5b809150505b92915050565b60006128c46128bf84613204565b6131df565b905080838252602082019050828560208602820111156128e7576128e66135a5565b5b60005b8581101561291757816128fd8882612921565b8452602084019350602083019250506001810190506128ea565b5050509392505050565b6000813590506129308161397f565b92915050565b6000815190506129458161397f565b92915050565b600082601f8301126129605761295f6135a0565b5b81356129708482602086016128b1565b91505092915050565b60008135905061298881613996565b92915050565b60008135905061299d816139ad565b92915050565b6000602082840312156129b9576129b86135af565b5b60006129c784828501612921565b91505092915050565b6000602082840312156129e6576129e56135af565b5b60006129f484828501612936565b91505092915050565b60008060408385031215612a1457612a136135af565b5b6000612a2285828601612921565b9250506020612a3385828601612921565b9150509250929050565b600080600060608486031215612a5657612a556135af565b5b6000612a6486828701612921565b9350506020612a7586828701612921565b9250506040612a868682870161298e565b9150509250925092565b60008060408385031215612aa757612aa66135af565b5b6000612ab585828601612921565b9250506020612ac685828601612979565b9150509250929050565b60008060408385031215612ae757612ae66135af565b5b6000612af585828601612921565b9250506020612b068582860161298e565b9150509250929050565b600060208284031215612b2657612b256135af565b5b600082013567ffffffffffffffff811115612b4457612b436135aa565b5b612b508482850161294b565b91505092915050565b600060208284031215612b6f57612b6e6135af565b5b6000612b7d84828501612979565b91505092915050565b600060208284031215612b9c57612b9b6135af565b5b6000612baa8482850161298e565b91505092915050565b60008060008060808587031215612bcd57612bcc6135af565b5b6000612bdb8782880161298e565b9450506020612bec8782880161298e565b9350506040612bfd8782880161298e565b9250506060612c0e8782880161298e565b91505092959194509250565b6000612c268383612c32565b60208301905092915050565b612c3b8161339a565b82525050565b612c4a8161339a565b82525050565b6000612c5b82613240565b612c658185613263565b9350612c7083613230565b8060005b83811015612ca1578151612c888882612c1a565b9750612c9383613256565b925050600181019050612c74565b5085935050505092915050565b612cb7816133ac565b82525050565b612cc6816133ef565b82525050565b612cd581613401565b82525050565b6000612ce68261324b565b612cf08185613274565b9350612d00818560208601613437565b612d09816135b4565b840191505092915050565b6000612d21602383613274565b9150612d2c826135c5565b604082019050919050565b6000612d44603f83613274565b9150612d4f82613614565b604082019050919050565b6000612d67602a83613274565b9150612d7282613663565b604082019050919050565b6000612d8a601c83613274565b9150612d95826136b2565b602082019050919050565b6000612dad602283613274565b9150612db8826136db565b604082019050919050565b6000612dd0602383613274565b9150612ddb8261372a565b604082019050919050565b6000612df3601b83613274565b9150612dfe82613779565b602082019050919050565b6000612e16601783613274565b9150612e21826137a2565b602082019050919050565b6000612e39602183613274565b9150612e44826137cb565b604082019050919050565b6000612e5c602083613274565b9150612e678261381a565b602082019050919050565b6000612e7f602983613274565b9150612e8a82613843565b604082019050919050565b6000612ea2602583613274565b9150612ead82613892565b604082019050919050565b6000612ec5602383613274565b9150612ed0826138e1565b604082019050919050565b6000612ee8602483613274565b9150612ef382613930565b604082019050919050565b612f07816133d8565b82525050565b612f16816133e2565b82525050565b6000602082019050612f316000830184612c41565b92915050565b6000602082019050612f4c6000830184612cae565b92915050565b6000602082019050612f676000830184612cbd565b92915050565b60006020820190508181036000830152612f878184612cdb565b905092915050565b60006020820190508181036000830152612fa881612d14565b9050919050565b60006020820190508181036000830152612fc881612d37565b9050919050565b60006020820190508181036000830152612fe881612d5a565b9050919050565b6000602082019050818103600083015261300881612d7d565b9050919050565b6000602082019050818103600083015261302881612da0565b9050919050565b6000602082019050818103600083015261304881612dc3565b9050919050565b6000602082019050818103600083015261306881612de6565b9050919050565b6000602082019050818103600083015261308881612e09565b9050919050565b600060208201905081810360008301526130a881612e2c565b9050919050565b600060208201905081810360008301526130c881612e4f565b9050919050565b600060208201905081810360008301526130e881612e72565b9050919050565b6000602082019050818103600083015261310881612e95565b9050919050565b6000602082019050818103600083015261312881612eb8565b9050919050565b6000602082019050818103600083015261314881612edb565b9050919050565b60006020820190506131646000830184612efe565b92915050565b600060a08201905061317f6000830188612efe565b61318c6020830187612ccc565b818103604083015261319e8186612c50565b90506131ad6060830185612c41565b6131ba6080830184612efe565b9695505050505050565b60006020820190506131d96000830184612f0d565b92915050565b60006131e96131fa565b90506131f5828261346a565b919050565b6000604051905090565b600067ffffffffffffffff82111561321f5761321e613571565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613290826133d8565b915061329b836133d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132d0576132cf6134e4565b5b828201905092915050565b60006132e6826133d8565b91506132f1836133d8565b92508261330157613300613513565b5b828204905092915050565b6000613317826133d8565b9150613322836133d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561335b5761335a6134e4565b5b828202905092915050565b6000613371826133d8565b915061337c836133d8565b92508282101561338f5761338e6134e4565b5b828203905092915050565b60006133a5826133b8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133fa82613413565b9050919050565b600061340c826133d8565b9050919050565b600061341e82613425565b9050919050565b6000613430826133b8565b9050919050565b60005b8381101561345557808201518184015260208101905061343a565b83811115613464576000848401525b50505050565b613473826135b4565b810181811067ffffffffffffffff8211171561349257613491613571565b5b80604052505050565b60006134a6826133d8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134d9576134d86134e4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6139888161339a565b811461399357600080fd5b50565b61399f816133ac565b81146139aa57600080fd5b50565b6139b6816133d8565b81146139c157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202057339c0f4b717c14748620be28108bf31beabe55c7364e15d85af45409e6f264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 2,312 |
0x7df231da5f0cce09ab66aa79a50cd94e882dc1d1
|
/*
* @dev This is the Axia Protocol Staking pool 3 contract (SWAP Pool),
* a part of the protocol where stakers are rewarded in AXIA tokens
* when they make stakes of liquidity tokens from the oracle pool.
* stakers reward come from the daily emission from the total supply into circulation,
* this happens daily and upon the reach of a new epoch each made of 180 days,
* halvings are experienced on the emitting amount of tokens.
* on the 11th epoch all the tokens would have been completed emitted into circulation,
* from here on, the stakers will still be earning from daily emissions
* which would now be coming from the accumulated basis points over the epochs.
* stakers are not charged any fee for unstaking.
*/
pragma solidity 0.6.4;
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 {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract USP{
using SafeMath for uint256;
//======================================EVENTS=========================================//
event StakeEvent(address indexed staker, address indexed pool, uint amount);
event UnstakeEvent(address indexed unstaker, address indexed pool, uint amount);
event RewardEvent(address indexed staker, address indexed pool, uint amount);
event RewardStake(address indexed staker, address indexed pool, uint amount);
//======================================STAKING POOLS=========================================//
address public Axiatoken;
address public UniswapV2;
bool public stakingEnabled;
uint256 constant private FLOAT_SCALAR = 2**64;
uint256 public MINIMUM_STAKE = 1000000000000000000; // 1 minimum
uint256 public MIN_DIVIDENDS_DUR = 18 hours;
uint public infocheck;
struct User {
uint256 balance;
uint256 frozen;
int256 scaledPayout;
uint256 staketime;
}
struct Info {
uint256 totalSupply;
uint256 totalFrozen;
mapping(address => User) users;
uint256 scaledPayoutPerToken; //pool balance
address admin;
}
mapping(address => bool) whitelisted;
Info private info;
constructor() public {
info.admin = msg.sender;
stakingEnabled = false;
}
//======================================ADMINSTRATION=========================================//
modifier onlyCreator() {
require(msg.sender == info.admin, "Ownable: caller is not the administrator");
_;
}
modifier onlyAxiaToken() {
require(msg.sender == Axiatoken, "Authorization: only token contract can call");
_;
}
function tokenconfigs(address _axiatoken, address _univ2) public onlyCreator returns (bool success) {
require(_axiatoken != _univ2, "Insertion of same address is not supported");
require(_axiatoken != address(0) && _univ2 != address(0), "Insertion of address(0) is not supported");
Axiatoken = _axiatoken;
UniswapV2 = _univ2;
return true;
}
function whitelist(address _address, bool _status) public onlyCreator returns (bool success) {
whitelisted[_address] = _status;
return true;
}
function _minStakeAmount(uint256 _numberPLUSDecimal) onlyCreator public {
MINIMUM_STAKE = _numberPLUSDecimal;
}
function stakingStatus(bool _status) public onlyCreator {
require(Axiatoken != address(0) && UniswapV2 != address(0), "Pool addresses are not yet setup");
stakingEnabled = _status;
}
function MIN_DIVIDENDS_DUR_TIME(uint256 _minDuration) public onlyCreator {
MIN_DIVIDENDS_DUR = _minDuration;
}
//======================================USER WRITE=========================================//
function StakeAxiaTokens(uint256 _tokens) external {
_stake(_tokens);
}
function UnstakeAxiaTokens(uint256 _tokens) external {
_unstake(_tokens);
}
//======================================USER READ=========================================//
function totalFrozen() public view returns (uint256) {
return info.totalFrozen;
}
function frozenOf(address _user) public view returns (uint256) {
return info.users[_user].frozen;
}
function dividendsOf(address _user) public view returns (uint256) {
if(info.users[_user].staketime < MIN_DIVIDENDS_DUR){
return 0;
}else{
return uint256(int256(info.scaledPayoutPerToken * info.users[_user].frozen) - info.users[_user].scaledPayout) / FLOAT_SCALAR;
}
}
function userData(address _user) public view
returns (uint256 totalTokensFrozen, uint256 userFrozen,
uint256 userDividends, uint256 userStaketime, int256 scaledPayout) {
return (totalFrozen(), frozenOf(_user), dividendsOf(_user), info.users[_user].staketime, info.users[_user].scaledPayout);
}
//======================================ACTION CALLS=========================================//
function _stake(uint256 _amount) internal {
require(stakingEnabled, "Staking not yet initialized");
require(IERC20(UniswapV2).balanceOf(msg.sender) >= _amount, "Insufficient SWAP AFT balance");
require(frozenOf(msg.sender) + _amount >= MINIMUM_STAKE, "Your amount is lower than the minimum amount allowed to stake");
require(IERC20(UniswapV2).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance given to contract yet to spend by user");
info.users[msg.sender].staketime = now;
info.totalFrozen += _amount;
info.users[msg.sender].frozen += _amount;
info.users[msg.sender].scaledPayout += int256(_amount * info.scaledPayoutPerToken);
IERC20(UniswapV2).transferFrom(msg.sender, address(this), _amount); // Transfer liquidity tokens from the sender to this contract
emit StakeEvent(msg.sender, address(this), _amount);
}
function ZapStake(uint256 _amount, address _user) external returns(bool){
require(whitelisted[msg.sender], "No authorization given");
info.users[_user].staketime = now;
info.totalFrozen += _amount;
info.users[_user].frozen += _amount;
info.users[_user].scaledPayout += int256(_amount * info.scaledPayoutPerToken);
//IERC20(UniswapV2).transferFrom(_user, address(this), _amount); // Transfer liquidity tokens from the sender to this contract
emit StakeEvent(_user, address(this), _amount);
}
function _unstake(uint256 _amount) internal {
require(frozenOf(msg.sender) >= _amount, "You currently do not have up to that amount staked");
info.totalFrozen -= _amount;
info.users[msg.sender].frozen -= _amount;
info.users[msg.sender].scaledPayout -= int256(_amount * info.scaledPayoutPerToken);
require(IERC20(UniswapV2).transfer(msg.sender, _amount), "Transaction failed");
emit UnstakeEvent(address(this), msg.sender, _amount);
TakeDividends();
}
function stakingStatus() view external returns(bool){
return stakingEnabled;
}
function TakeDividends() public returns (uint256) {
uint256 _dividends = dividendsOf(msg.sender);
require(_dividends >= 0, "you do not have any dividend yet");
info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR);
require(IERC20(Axiatoken).transfer(msg.sender, _dividends), "Transaction Failed"); // Transfer dividends to msg.sender
emit RewardEvent(msg.sender, address(this), _dividends);
return _dividends;
}
function scaledToken(uint _amount) external onlyAxiaToken returns(bool){
info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalFrozen;
infocheck = info.scaledPayoutPerToken;
return true;
}
function mulDiv (uint x, uint y, uint z) public pure returns (uint) {
(uint l, uint h) = fullMul (x, y);
assert (h < z);
uint mm = mulmod (x, y, z);
if (mm > l) h -= 1;
l -= mm;
uint pow2 = z & -z;
z /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint r = 1;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
return l * r;
}
function fullMul (uint x, uint y) private pure returns (uint l, uint h) {
uint mm = mulmod (x, y, uint (-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
}
|
0x608060405234801561001057600080fd5b50600436106101415760003560e01c80636b6b6aa4116100b8578063ac3c85351161007c578063ac3c853514610305578063b333de2414610324578063b821b6bf1461032c578063c891091314610334578063e0287b3e14610385578063f59c3708146103a257610141565b80636b6b6aa41461025957806375c634b7146102765780637640cb9e146102a2578063a43fc871146102bf578063aa9a0912146102dc57610141565b80631e7f87bc1161010a5780631e7f87bc146101e757806322701134146101ef578063376edab614610213578063455ab53c146102415780636387c9491461024957806369c18e121461025157610141565b806265318b1461014657806308dbbb031461017e5780631495bf9a146101865780631bf6e00d146101a55780631cfff51b146101cb575b600080fd5b61016c6004803603602081101561015c57600080fd5b50356001600160a01b03166103d0565b60408051918252519081900360200190f35b61016c610436565b6101a36004803603602081101561019c57600080fd5b503561043c565b005b61016c600480360360208110156101bb57600080fd5b50356001600160a01b0316610448565b6101d3610466565b604080519115158252519081900360200190f35b61016c610476565b6101f761047c565b604080516001600160a01b039092168252519081900360200190f35b6101d36004803603604081101561022957600080fd5b506001600160a01b038135811691602001351661048b565b6101d36105b3565b6101f76105c3565b61016c6105d2565b6101a36004803603602081101561026f57600080fd5b50356105d8565b6101d36004803603604081101561028c57600080fd5b50803590602001356001600160a01b03166105e1565b6101d3600480360360208110156102b857600080fd5b50356106bd565b6101a3600480360360208110156102d557600080fd5b5035610732565b61016c600480360360608110156102f257600080fd5b5080359060208101359060400135610780565b6101a36004803603602081101561031b57600080fd5b50351515610834565b61016c610910565b61016c610a3a565b61035a6004803603602081101561034a57600080fd5b50356001600160a01b0316610a40565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101a36004803603602081101561039b57600080fd5b5035610a97565b6101d3600480360360408110156103b857600080fd5b506001600160a01b0381351690602001351515610ae5565b600380546001600160a01b03831660009081526008602052604081209092015410156103fe57506000610431565b6001600160a01b03821660009081526008602052604090206002810154600190910154600954600160401b929102030490505b919050565b60025481565b61044581610b60565b50565b6001600160a01b031660009081526008602052604090206001015490565b600154600160a01b900460ff1681565b60075490565b6001546001600160a01b031681565b600a546000906001600160a01b031633146104d75760405162461bcd60e51b815260040180806020018281038252602881526020018061110a6028913960400191505060405180910390fd5b816001600160a01b0316836001600160a01b031614156105285760405162461bcd60e51b815260040180806020018281038252602a81526020018061115a602a913960400191505060405180910390fd5b6001600160a01b0383161580159061054857506001600160a01b03821615155b6105835760405162461bcd60e51b81526004018080602001828103825260288152602001806111326028913960400191505060405180910390fd5b50600080546001600160a01b039384166001600160a01b0319918216179091556001805492909316911617815590565b600154600160a01b900460ff1690565b6000546001600160a01b031681565b60045481565b61044581610e83565b3360009081526005602052604081205460ff1661063e576040805162461bcd60e51b815260206004820152601660248201527527379030baba3437b934bd30ba34b7b71033b4bb32b760511b604482015290519081900360640190fd5b6001600160a01b038216600081815260086020908152604091829020426003820155600780548801905560018101805488019055600954600290910180549188029091019055815186815291513093927f160ffcaa807f78c8b4983836e2396338d073e75695ac448aa0b5e4a75b210b1d92908290030190a392915050565b600080546001600160a01b031633146107075760405162461bcd60e51b815260040180806020018281038252602b815260200180611067602b913960400191505060405180910390fd5b600754600160401b83028161071857fe5b600980549290910490910190819055600455506001919050565b600a546001600160a01b0316331461077b5760405162461bcd60e51b815260040180806020018281038252602881526020018061110a6028913960400191505060405180910390fd5b600255565b600080600061078f8686611007565b9150915083811061079c57fe5b600084806107a657fe5b8688099050828111156107ba576001820391505b9182900391600085900385168086816107cf57fe5b0495508084816107db57fe5b0493508081600003816107ea57fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b600a546001600160a01b0316331461087d5760405162461bcd60e51b815260040180806020018281038252602881526020018061110a6028913960400191505060405180910390fd5b6000546001600160a01b0316158015906108a157506001546001600160a01b031615155b6108f2576040805162461bcd60e51b815260206004820181905260248201527f506f6f6c2061646472657373657320617265206e6f7420796574207365747570604482015290519081900360640190fd5b60018054911515600160a01b0260ff60a01b19909216919091179055565b60008061091c336103d0565b3360008181526008602090815260408083206002018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b15801561098c57600080fd5b505af11580156109a0573d6000803e3d6000fd5b505050506040513d60208110156109b657600080fd5b50516109fe576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f8c998377165b6abd6e99f8b84a86ed2c92d0055aeef42626fedea45c2909f6eb9181900360200190a3905090565b60035481565b6000806000806000610a50610476565b610a5987610448565b610a62886103d0565b6001600160a01b0398909816600090815260086020526040902060038101546002909101549299919897509550909350915050565b600a546001600160a01b03163314610ae05760405162461bcd60e51b815260040180806020018281038252602881526020018061110a6028913960400191505060405180910390fd5b600355565b600a546000906001600160a01b03163314610b315760405162461bcd60e51b815260040180806020018281038252602881526020018061110a6028913960400191505060405180910390fd5b506001600160a01b0382166000908152600560205260409020805482151560ff19909116179055600192915050565b600154600160a01b900460ff16610bbe576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600154604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610c0857600080fd5b505afa158015610c1c573d6000803e3d6000fd5b505050506040513d6020811015610c3257600080fd5b50511015610c87576040805162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742053574150204146542062616c616e6365000000604482015290519081900360640190fd5b60025481610c9433610448565b011015610cd25760405162461bcd60e51b815260040180806020018281038252603d8152602001806110cd603d913960400191505060405180910390fd5b60015460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610d2257600080fd5b505afa158015610d36573d6000803e3d6000fd5b505050506040513d6020811015610d4c57600080fd5b50511015610d8b5760405162461bcd60e51b815260040180806020018281038252603b815260200180611092603b913960400191505060405180910390fd5b33600081815260086020908152604080832042600382015560078054870190556001808201805488019055600954600290920180549288029092019091555481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610e1d57600080fd5b505af1158015610e31573d6000803e3d6000fd5b505050506040513d6020811015610e4757600080fd5b5050604080518281529051309133917f160ffcaa807f78c8b4983836e2396338d073e75695ac448aa0b5e4a75b210b1d9181900360200190a350565b80610e8d33610448565b1015610eca5760405162461bcd60e51b81526004018080602001828103825260328152602001806110356032913960400191505060405180910390fd5b6007805482900390553360008181526008602090815260408083206001818101805488900390556009546002909201805492880290920390915554815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b158015610f5257600080fd5b505af1158015610f66573d6000803e3d6000fd5b505050506040513d6020811015610f7c57600080fd5b5051610fc4576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518281529051339130917f15fba2c381f32b0e84d073dd1adb9edbcfd33a033ee48aaea415ac61ca7d448d9181900360200190a3611003610910565b5050565b600080806000198486099050838502925082810391508281101561102c576001820391505b50925092905056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e74207374616b6564417574686f72697a6174696f6e3a206f6e6c7920746f6b656e20636f6e74726163742063616e2063616c6c4e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f207374616b654f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72496e73657274696f6e206f662061646472657373283029206973206e6f7420737570706f72746564496e73657274696f6e206f662073616d652061646472657373206973206e6f7420737570706f72746564a2646970667358221220c7d7d8e0609aaa918484107a27a7fe1332487977368dba76bfcd613005c3c98e64736f6c63430006040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 2,313 |
0xd1c322a3cd47089adfa6afb9d6f07009cf048120
|
/*
Berserk Inu
TG: t.me/BerserkInu
TW: twitter.com/BerserkInu
Website: berserkinu.monster
Hold BerSinu 4% redistribution
100% Liq lock and renounce
100% community driven
50% burned
*/
// 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 BerserkInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Berserk Inu @BerserkInu";
string private constant _symbol = "BerSinu";
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 = 4;
uint256 private _redisfee = 4;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 4;
_redisfee = 4;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function 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 maxTx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**5);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063f77c49ab146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ead565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129d0565b61045e565b6040516101789190612e92565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061304f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612981565b61048d565b6040516101e09190612e92565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128f3565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130c4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a4d565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128f3565b610783565b6040516102b1919061304f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612dc4565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ead565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129d0565b61098d565b60405161035b9190612e92565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a0c565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612945565b6110d2565b6040516103ef919061304f565b60405180910390f35b34801561040457600080fd5b5061041f600480360381019061041a9190612a9f565b611159565b005b60606040518060400160405280601781526020017f4265727365726b20496e7520404265727365726b496e75000000000000000000815250905090565b600061047261046b611270565b8484611278565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611443565b61055b846104a6611270565b6105568560405180606001604052806028815260200161378860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611270565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c029092919063ffffffff16565b611278565b600190509392505050565b61056e611270565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f8f565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611270565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f8f565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611270565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c66565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d61565b9050919050565b6107dc611270565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f8f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f42657253696e7500000000000000000000000000000000000000000000000000815250905090565b60006109a161099a611270565b8484611443565b6001905092915050565b6109b3611270565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f8f565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613365565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c611270565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611dcf565b50565b610b7d611270565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f8f565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c519061300f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611278565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061291c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061291c565b6040518363ffffffff1660e01b8152600401610e1f929190612ddf565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061291c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e31565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612ac8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e08565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612a76565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661119a611270565b73ffffffffffffffffffffffffffffffffffffffff16146111ba57600080fd5b600081116111fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f490612f4f565b60405180910390fd5b61122e620186a061122083683635c9adc5dea000006120c990919063ffffffff16565b61214490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051611265919061304f565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112df90612fef565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134f90612f0f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611436919061304f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114aa90612fcf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611523576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151a90612ecf565b60405180910390fd5b60008111611566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155d90612faf565b60405180910390fd5b61156e610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115dc57506115ac610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3f57600f60179054906101000a900460ff161561180f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117125750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611758611270565b73ffffffffffffffffffffffffffffffffffffffff1614806117ce5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b6611270565b73ffffffffffffffffffffffffffffffffffffffff16145b61180d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118049061302f565b60405180910390fd5b5b5b60105481111561181e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118cb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119cc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e45750600f60179054906101000a900460ff165b15611a855742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3457600080fd5b607842611a419190613185565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9030610783565b9050600f60159054906101000a900460ff16158015611afd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b155750600f60169054906101000a900460ff165b15611b3d57611b2381611dcf565b60004790506000811115611b3b57611b3a47611c66565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bf057600090505b611bfc8484848461218e565b50505050565b6000838311158290611c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c419190612ead565b60405180910390fd5b5060008385611c599190613266565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb660028461214490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce1573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3260028461214490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d5d573d6000803e3d6000fd5b5050565b6000600654821115611da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9f90612eef565b60405180910390fd5b6000611db26121bb565b9050611dc7818461214490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e2d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e5b5781602001602082028036833780820191505090505b5090503081600081518110611e99577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f3b57600080fd5b505afa158015611f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f73919061291c565b81600181518110611fad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061201430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611278565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161207895949392919061306a565b600060405180830381600087803b15801561209257600080fd5b505af11580156120a6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120dc576000905061213e565b600082846120ea919061320c565b90508284826120f991906131db565b14612139576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213090612f6f565b60405180910390fd5b809150505b92915050565b600061218683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121e6565b905092915050565b8061219c5761219b612249565b5b6121a784848461227a565b806121b5576121b4612445565b5b50505050565b60008060006121c8612457565b915091506121df818361214490919063ffffffff16565b9250505090565b6000808311829061222d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122249190612ead565b60405180910390fd5b506000838561223c91906131db565b9050809150509392505050565b600060085414801561225d57506000600954145b1561226757612278565b600060088190555060006009819055505b565b60008060008060008061228c876124b9565b9550955095509550955095506122ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123cb816125c9565b6123d58483612686565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612432919061304f565b60405180910390a3505050505050505050565b60046008819055506004600981905550565b600080600060065490506000683635c9adc5dea00000905061248d683635c9adc5dea0000060065461214490919063ffffffff16565b8210156124ac57600654683635c9adc5dea000009350935050506124b5565b81819350935050505b9091565b60008060008060008060008060006124d68a6008546009546126c0565b92509250925060006124e66121bb565b905060008060006124f98e878787612756565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061256383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c02565b905092915050565b600080828461257a9190613185565b9050838110156125bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b690612f2f565b60405180910390fd5b8091505092915050565b60006125d36121bb565b905060006125ea82846120c990919063ffffffff16565b905061263e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61269b8260065461252190919063ffffffff16565b6006819055506126b68160075461256b90919063ffffffff16565b6007819055505050565b6000806000806126ec60646126de888a6120c990919063ffffffff16565b61214490919063ffffffff16565b905060006127166064612708888b6120c990919063ffffffff16565b61214490919063ffffffff16565b9050600061273f82612731858c61252190919063ffffffff16565b61252190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061276f85896120c990919063ffffffff16565b9050600061278686896120c990919063ffffffff16565b9050600061279d87896120c990919063ffffffff16565b905060006127c6826127b8858761252190919063ffffffff16565b61252190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127f26127ed84613104565b6130df565b9050808382526020820190508285602086028201111561281157600080fd5b60005b858110156128415781612827888261284b565b845260208401935060208301925050600181019050612814565b5050509392505050565b60008135905061285a81613742565b92915050565b60008151905061286f81613742565b92915050565b600082601f83011261288657600080fd5b81356128968482602086016127df565b91505092915050565b6000813590506128ae81613759565b92915050565b6000815190506128c381613759565b92915050565b6000813590506128d881613770565b92915050565b6000815190506128ed81613770565b92915050565b60006020828403121561290557600080fd5b60006129138482850161284b565b91505092915050565b60006020828403121561292e57600080fd5b600061293c84828501612860565b91505092915050565b6000806040838503121561295857600080fd5b60006129668582860161284b565b92505060206129778582860161284b565b9150509250929050565b60008060006060848603121561299657600080fd5b60006129a48682870161284b565b93505060206129b58682870161284b565b92505060406129c6868287016128c9565b9150509250925092565b600080604083850312156129e357600080fd5b60006129f18582860161284b565b9250506020612a02858286016128c9565b9150509250929050565b600060208284031215612a1e57600080fd5b600082013567ffffffffffffffff811115612a3857600080fd5b612a4484828501612875565b91505092915050565b600060208284031215612a5f57600080fd5b6000612a6d8482850161289f565b91505092915050565b600060208284031215612a8857600080fd5b6000612a96848285016128b4565b91505092915050565b600060208284031215612ab157600080fd5b6000612abf848285016128c9565b91505092915050565b600080600060608486031215612add57600080fd5b6000612aeb868287016128de565b9350506020612afc868287016128de565b9250506040612b0d868287016128de565b9150509250925092565b6000612b238383612b2f565b60208301905092915050565b612b388161329a565b82525050565b612b478161329a565b82525050565b6000612b5882613140565b612b628185613163565b9350612b6d83613130565b8060005b83811015612b9e578151612b858882612b17565b9750612b9083613156565b925050600181019050612b71565b5085935050505092915050565b612bb4816132ac565b82525050565b612bc3816132ef565b82525050565b6000612bd48261314b565b612bde8185613174565b9350612bee818560208601613301565b612bf78161343b565b840191505092915050565b6000612c0f602383613174565b9150612c1a8261344c565b604082019050919050565b6000612c32602a83613174565b9150612c3d8261349b565b604082019050919050565b6000612c55602283613174565b9150612c60826134ea565b604082019050919050565b6000612c78601b83613174565b9150612c8382613539565b602082019050919050565b6000612c9b601d83613174565b9150612ca682613562565b602082019050919050565b6000612cbe602183613174565b9150612cc98261358b565b604082019050919050565b6000612ce1602083613174565b9150612cec826135da565b602082019050919050565b6000612d04602983613174565b9150612d0f82613603565b604082019050919050565b6000612d27602583613174565b9150612d3282613652565b604082019050919050565b6000612d4a602483613174565b9150612d55826136a1565b604082019050919050565b6000612d6d601783613174565b9150612d78826136f0565b602082019050919050565b6000612d90601183613174565b9150612d9b82613719565b602082019050919050565b612daf816132d8565b82525050565b612dbe816132e2565b82525050565b6000602082019050612dd96000830184612b3e565b92915050565b6000604082019050612df46000830185612b3e565b612e016020830184612b3e565b9392505050565b6000604082019050612e1d6000830185612b3e565b612e2a6020830184612da6565b9392505050565b600060c082019050612e466000830189612b3e565b612e536020830188612da6565b612e606040830187612bba565b612e6d6060830186612bba565b612e7a6080830185612b3e565b612e8760a0830184612da6565b979650505050505050565b6000602082019050612ea76000830184612bab565b92915050565b60006020820190508181036000830152612ec78184612bc9565b905092915050565b60006020820190508181036000830152612ee881612c02565b9050919050565b60006020820190508181036000830152612f0881612c25565b9050919050565b60006020820190508181036000830152612f2881612c48565b9050919050565b60006020820190508181036000830152612f4881612c6b565b9050919050565b60006020820190508181036000830152612f6881612c8e565b9050919050565b60006020820190508181036000830152612f8881612cb1565b9050919050565b60006020820190508181036000830152612fa881612cd4565b9050919050565b60006020820190508181036000830152612fc881612cf7565b9050919050565b60006020820190508181036000830152612fe881612d1a565b9050919050565b6000602082019050818103600083015261300881612d3d565b9050919050565b6000602082019050818103600083015261302881612d60565b9050919050565b6000602082019050818103600083015261304881612d83565b9050919050565b60006020820190506130646000830184612da6565b92915050565b600060a08201905061307f6000830188612da6565b61308c6020830187612bba565b818103604083015261309e8186612b4d565b90506130ad6060830185612b3e565b6130ba6080830184612da6565b9695505050505050565b60006020820190506130d96000830184612db5565b92915050565b60006130e96130fa565b90506130f58282613334565b919050565b6000604051905090565b600067ffffffffffffffff82111561311f5761311e61340c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613190826132d8565b915061319b836132d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131d0576131cf6133ae565b5b828201905092915050565b60006131e6826132d8565b91506131f1836132d8565b925082613201576132006133dd565b5b828204905092915050565b6000613217826132d8565b9150613222836132d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561325b5761325a6133ae565b5b828202905092915050565b6000613271826132d8565b915061327c836132d8565b92508282101561328f5761328e6133ae565b5b828203905092915050565b60006132a5826132b8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132fa826132d8565b9050919050565b60005b8381101561331f578082015181840152602081019050613304565b8381111561332e576000848401525b50505050565b61333d8261343b565b810181811067ffffffffffffffff8211171561335c5761335b61340c565b5b80604052505050565b6000613370826132d8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133a3576133a26133ae565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61374b8161329a565b811461375657600080fd5b50565b613762816132ac565b811461376d57600080fd5b50565b613779816132d8565b811461378457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122017dffa7c0aea4bcfb82a3f6ab812cccba27cb6fd4050c2a163e8d6b01c5ecc9f64736f6c63430008040033
|
{"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"}]}}
| 2,314 |
0x43c882dba79a5658265d236471d230f06979339f
|
/**
*Submitted for verification at Etherscan.io on 2021-11-18
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'coak.eth' contract
//
// Symbol : $COAK
// Name : coak.eth
// Total supply: 10 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract COAK is BurnableToken {
string public constant name = "coak.eth";
string public constant symbol = "$COAK";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a10565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e67565b6040518082815260200191505060405180910390f35b6103b1610eb0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0d565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e1565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112dd565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611364565b005b6040518060400160405280600881526020017f636f616b2e65746800000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b390919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6127100281565b60008111610a1d57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6957600080fd5b6000339050610ac082600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b18826001546114b390919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce7576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7b565b610cfa83826114b390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f24434f414b00000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4857600080fd5b610f9a82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102f82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117282600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114bf57fe5b818303905092915050565b6000808284019050838110156114dc57fe5b809150509291505056fea264697066735822122037b2240a28674bf3e29ad3c7bbd5e88846b84786db8d43ddaf6d68aa5eeb3fe364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,315 |
0xe9760891264905133ec29e5228a7dfe21f2083f1
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title A standard interface for tokens.
*/
interface ERC20 {
/**
* @dev Returns the name of the token.
*/
function name()
external
view
returns (string _name);
/**
* @dev Returns the symbol of the token.
*/
function symbol()
external
view
returns (string _symbol);
/**
* @dev Returns the number of decimals the token uses.
*/
function decimals()
external
view
returns (uint8 _decimals);
/**
* @dev Returns the total token supply.
*/
function totalSupply()
external
view
returns (uint256 _totalSupply);
/**
* @dev Returns the account balance of another account with address _owner.
* @param _owner The address from which the balance will be retrieved.
*/
function balanceOf(
address _owner
)
external
view
returns (uint256 _balance);
/**
* @dev Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The
* function SHOULD throw if the _from account balance does not have enough tokens to spend.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
*/
function transfer(
address _to,
uint256 _value
)
external
returns (bool _success);
/**
* @dev Transfers _value amount of tokens from address _from to address _to, and MUST fire the
* Transfer event.
* @param _from The address of the sender.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
external
returns (bool _success);
/**
* @dev Allows _spender to withdraw from your account multiple times, up to
* the _value amount. If this function is called again it overwrites the current
* allowance with _value.
* @param _spender The address of the account able to transfer the tokens.
* @param _value The amount of tokens to be approved for transfer.
*/
function approve(
address _spender,
uint256 _value
)
external
returns (bool _success);
/**
* @dev Returns the amount which _spender is still allowed to withdraw from _owner.
* @param _owner The address of the account owning tokens.
* @param _spender The address of the account able to transfer the tokens.
*/
function allowance(
address _owner,
address _spender
)
external
view
returns (uint256 _remaining);
/**
* @dev Triggers when tokens are transferred, including zero value transfers.
*/
event Transfer(
address indexed _from,
address indexed _to,
uint256 _value
);
/**
* @dev Triggers on any successful call to approve(address _spender, uint256 _value).
*/
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _value
);
}
contract Token is ERC20
{
using SafeMath for uint256;
/**
* Token name.
*/
string internal tokenName;
/**
* Token symbol.
*/
string internal tokenSymbol;
/**
* Number of decimals.
*/
uint8 internal tokenDecimals;
/**
* Total supply of tokens.
*/
uint256 internal tokenTotalSupply;
/**
* Balance information map.
*/
mapping (address => uint256) internal balances;
/**
* Token allowance mapping.
*/
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Trigger when tokens are transferred, including zero value transfers.
*/
event Transfer(
address indexed _from,
address indexed _to,
uint256 _value
);
/**
* @dev Trigger on any successful call to approve(address _spender, uint256 _value).
*/
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _value
);
/**
* @dev Returns the name of the token.
*/
function name()
external
view
returns (string _name)
{
_name = tokenName;
}
/**
* @dev Returns the symbol of the token.
*/
function symbol()
external
view
returns (string _symbol)
{
_symbol = tokenSymbol;
}
/**
* @dev Returns the number of decimals the token uses.
*/
function decimals()
external
view
returns (uint8 _decimals)
{
_decimals = tokenDecimals;
}
/**
* @dev Returns the total token supply.
*/
function totalSupply()
external
view
returns (uint256 _totalSupply)
{
_totalSupply = tokenTotalSupply;
}
/**
* @dev Returns the account balance of another account with address _owner.
* @param _owner The address from which the balance will be retrieved.
*/
function balanceOf(
address _owner
)
external
view
returns (uint256 _balance)
{
_balance = balances[_owner];
}
/**
* @dev Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The
* function SHOULD throw if the _from account balance does not have enough tokens to spend.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
*/
function transfer(
address _to,
uint256 _value
)
public
returns (bool _success)
{
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);
_success = true;
}
/**
* @dev Allows _spender to withdraw from your account multiple times, up to the _value amount. If
* this function is called again it overwrites the current allowance with _value.
* @param _spender The address of the account able to transfer the tokens.
* @param _value The amount of tokens to be approved for transfer.
*/
function approve(
address _spender,
uint256 _value
)
public
returns (bool _success)
{
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
_success = true;
}
/**
* @dev Returns the amount which _spender is still allowed to withdraw from _owner.
* @param _owner The address of the account owning tokens.
* @param _spender The address of the account able to transfer the tokens.
*/
function allowance(
address _owner,
address _spender
)
external
view
returns (uint256 _remaining)
{
_remaining = allowed[_owner][_spender];
}
/**
* @dev Transfers _value amount of tokens from address _from to address _to, and MUST fire the
* Transfer event.
* @param _from The address of the sender.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool _success)
{
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);
_success = true;
}
}
contract CYC is Token {
constructor()
public
{
tokenName = "ChangeYourCoin";
tokenSymbol = "CYC";
tokenDecimals = 0;
tokenTotalSupply = 15000000;
balances[msg.sender] = tokenTotalSupply;
}
}
|
0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461009e578063095ea7b31461012e57806318160ddd1461019357806323b872dd146101be578063313ce5671461024357806370a082311461027457806395d89b41146102cb578063a9059cbb1461035b578063dd62ed3e146103c0575b600080fd5b3480156100aa57600080fd5b506100b3610437565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f35780820151818401526020810190506100d8565b50505050905090810190601f1680156101205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013a57600080fd5b50610179600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d9565b604051808215151515815260200191505060405180910390f35b34801561019f57600080fd5b506101a8610660565b6040518082815260200191505060405180910390f35b3480156101ca57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066a565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b506102586109ee565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028057600080fd5b506102b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a05565b6040518082815260200191505060405180910390f35b3480156102d757600080fd5b506102e0610a4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610320578082015181840152602081019050610305565b50505050905090810190601f16801561034d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036757600080fd5b506103a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af0565b604051808215151515815260200191505060405180910390f35b3480156103cc57600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cd9565b6040518082815260200191505060405180910390f35b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104cf5780601f106104a4576101008083540402835291602001916104cf565b820191906000526020600020905b8154815290600101906020018083116104b257829003601f168201915b5050505050905090565b60008082148061056557506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561057057600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106ba57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561074557600080fd5b61079782600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6090919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082c82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d7990919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108fe82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6090919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600260009054906101000a900460ff16905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ae65780601f10610abb57610100808354040283529160200191610ae6565b820191906000526020600020905b815481529060010190602001808311610ac957829003601f168201915b5050505050905090565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b4057600080fd5b610b9282600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2782600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d7990919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000828211151515610d6e57fe5b818303905092915050565b60008183019050828110151515610d8c57fe5b809050929150505600a165627a7a7230582061edef01a3c6034d962c3708d41c638ed836289b340fdaa44caddde9e979ee380029
|
{"success": true, "error": null, "results": {}}
| 2,316 |
0x04cc611e377bf2754111e2a7269cf74720d7fb4b
|
/**
*Submitted for verification at Etherscan.io on 2022-03-21
*/
//https://t.me/cloudyinu
// 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 CINU 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 = 1000000000 * 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 = "Cloudy Inu";
string private constant _symbol = "CINU";
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(0x2e9e3FbFcbd15445e90d47c3D4D311c24e0E852d);
_buyTax = 12;
_sellTax = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 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 _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610346578063c3c8cd8014610366578063c9567bf91461037b578063dbe8272c14610390578063dc1052e2146103b0578063dd62ed3e146103d057600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f14610311578063a9059cbb1461032657600080fd5b8063273123b7116100f2578063273123b714610216578063313ce5671461023657806346df33b7146102525780636fc3eaec1461027257806370a082311461028757600080fd5b806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af5780631bbae6e0146101d457806323b872dd146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600a815269436c6f75647920496e7560b01b60208201525b6040516101769190611948565b60405180910390f35b34801561018b57600080fd5b5061019f61019a3660046117cf565b610416565b6040519015158152602001610176565b3480156101bb57600080fd5b50670de0b6b3a76400005b604051908152602001610176565b3480156101e057600080fd5b506101f46101ef366004611901565b61042d565b005b34801561020257600080fd5b5061019f61021136600461178e565b610478565b34801561022257600080fd5b506101f461023136600461171b565b6104e1565b34801561024257600080fd5b5060405160098152602001610176565b34801561025e57600080fd5b506101f461026d3660046118c7565b61052c565b34801561027e57600080fd5b506101f4610574565b34801561029357600080fd5b506101c66102a236600461171b565b6105a8565b3480156102b357600080fd5b506101f46105ca565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102f057600080fd5b5060408051808201909152600481526343494e5560e01b6020820152610169565b34801561031d57600080fd5b506101f461063e565b34801561033257600080fd5b5061019f6103413660046117cf565b61087d565b34801561035257600080fd5b506101f46103613660046117fb565b61088a565b34801561037257600080fd5b506101f4610920565b34801561038757600080fd5b506101f4610960565b34801561039c57600080fd5b506101f46103ab366004611901565b610b26565b3480156103bc57600080fd5b506101f46103cb366004611901565b610b5e565b3480156103dc57600080fd5b506101c66103eb366004611755565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610423338484610b96565b5060015b92915050565b6000546001600160a01b031633146104605760405162461bcd60e51b81526004016104579061199d565b60405180910390fd5b66470de4df8200008111156104755760108190555b50565b6000610485848484610cba565b6104d784336104d285604051806060016040528060288152602001611b34602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fef565b610b96565b5060019392505050565b6000546001600160a01b0316331461050b5760405162461bcd60e51b81526004016104579061199d565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105565760405162461bcd60e51b81526004016104579061199d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059e5760405162461bcd60e51b81526004016104579061199d565b4761047581611029565b6001600160a01b03811660009081526002602052604081205461042790611063565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016104579061199d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106685760405162461bcd60e51b81526004016104579061199d565b600f54600160a01b900460ff16156106c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610457565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072257600080fd5b505afa158015610736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075a9190611738565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190611738565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082257600080fd5b505af1158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611738565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610423338484610cba565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016104579061199d565b60005b815181101561091c576001600660008484815181106108d8576108d8611ae4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091481611ab3565b9150506108b7565b5050565b6000546001600160a01b0316331461094a5760405162461bcd60e51b81526004016104579061199d565b6000610955306105a8565b9050610475816110e7565b6000546001600160a01b0316331461098a5760405162461bcd60e51b81526004016104579061199d565b600e546109aa9030906001600160a01b0316670de0b6b3a7640000610b96565b600e546001600160a01b031663f305d71947306109c6816105a8565b6000806109db6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3e57600080fd5b505af1158015610a52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a77919061191a565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aee57600080fd5b505af1158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047591906118e4565b6000546001600160a01b03163314610b505760405162461bcd60e51b81526004016104579061199d565b600c81101561047557600b55565b6000546001600160a01b03163314610b885760405162461bcd60e51b81526004016104579061199d565b600c81101561047557600c55565b6001600160a01b038316610bf85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610457565b6001600160a01b038216610c595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610457565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610457565b6001600160a01b038216610d805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610457565b60008111610de25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610457565b6001600160a01b03831660009081526006602052604090205460ff1615610e0857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4a57506001600160a01b03821660009081526005602052604090205460ff16155b15610fdf576000600955600c54600a55600f546001600160a01b038481169116148015610e855750600e546001600160a01b03838116911614155b8015610eaa57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ebf5750600f54600160b81b900460ff165b15610eec576000610ecf836105a8565b601054909150610edf8383611270565b1115610eea57600080fd5b505b600f546001600160a01b038381169116148015610f175750600e546001600160a01b03848116911614155b8015610f3c57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4d576000600955600b54600a555b6000610f58306105a8565b600f54909150600160a81b900460ff16158015610f835750600f546001600160a01b03858116911614155b8015610f985750600f54600160b01b900460ff165b15610fdd576000610faa600483611a5b565b9050610fb68183611a9c565b9150610fc1816112cf565b610fca826110e7565b478015610fda57610fda47611029565b50505b505b610fea838383611305565b505050565b600081848411156110135760405162461bcd60e51b81526004016104579190611948565b5060006110208486611a9c565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091c573d6000803e3d6000fd5b60006007548211156110ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610457565b60006110d4611310565b90506110e08382611333565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061112f5761112f611ae4565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118357600080fd5b505afa158015611197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bb9190611738565b816001815181106111ce576111ce611ae4565b6001600160a01b039283166020918202929092010152600e546111f49130911684610b96565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122d9085906000908690309042906004016119d2565b600060405180830381600087803b15801561124757600080fd5b505af115801561125b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061127d8385611a43565b9050838110156110e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610457565b600f805460ff60a81b1916600160a81b17905580156112f5576112f53061dead83610cba565b50600f805460ff60a81b19169055565b610fea838383611375565b600080600061131d61146c565b909250905061132c8282611333565b9250505090565b60006110e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ac565b600080600080600080611387876114da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113b99087611537565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e89086611270565b6001600160a01b03891660009081526002602052604090205561140a81611579565b61141484836115c3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145991815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006114878282611333565b8210156114a357505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114cd5760405162461bcd60e51b81526004016104579190611948565b5060006110208486611a5b565b60008060008060008060008060006114f78a600954600a546115e7565b9250925092506000611507611310565b9050600080600061151a8e87878761163c565b919e509c509a509598509396509194505050505091939550919395565b60006110e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fef565b6000611583611310565b90506000611591838361168c565b306000908152600260205260409020549091506115ae9082611270565b30600090815260026020526040902055505050565b6007546115d09083611537565b6007556008546115e09082611270565b6008555050565b600080808061160160646115fb898961168c565b90611333565b9050600061161460646115fb8a8961168c565b9050600061162c826116268b86611537565b90611537565b9992985090965090945050505050565b600080808061164b888661168c565b90506000611659888761168c565b90506000611667888861168c565b90506000611679826116268686611537565b939b939a50919850919650505050505050565b60008261169b57506000610427565b60006116a78385611a7d565b9050826116b48583611a5b565b146110e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610457565b803561171681611b10565b919050565b60006020828403121561172d57600080fd5b81356110e081611b10565b60006020828403121561174a57600080fd5b81516110e081611b10565b6000806040838503121561176857600080fd5b823561177381611b10565b9150602083013561178381611b10565b809150509250929050565b6000806000606084860312156117a357600080fd5b83356117ae81611b10565b925060208401356117be81611b10565b929592945050506040919091013590565b600080604083850312156117e257600080fd5b82356117ed81611b10565b946020939093013593505050565b6000602080838503121561180e57600080fd5b823567ffffffffffffffff8082111561182657600080fd5b818501915085601f83011261183a57600080fd5b81358181111561184c5761184c611afa565b8060051b604051601f19603f8301168101818110858211171561187157611871611afa565b604052828152858101935084860182860187018a101561189057600080fd5b600095505b838610156118ba576118a68161170b565b855260019590950194938601938601611895565b5098975050505050505050565b6000602082840312156118d957600080fd5b81356110e081611b25565b6000602082840312156118f657600080fd5b81516110e081611b25565b60006020828403121561191357600080fd5b5035919050565b60008060006060848603121561192f57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561197557858101830151858201604001528201611959565b81811115611987576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a225784516001600160a01b0316835293830193918301916001016119fd565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a5657611a56611ace565b500190565b600082611a7857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a9757611a97611ace565b500290565b600082821015611aae57611aae611ace565b500390565b6000600019821415611ac757611ac7611ace565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047557600080fd5b801515811461047557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4453525f5ff1bd2caa38426362e12da4020d3972c89bddb525589414c77b51b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,317 |
0xa3c5b4e062e55108e25b1344ef569e23cb26ae1a
|
// SPDX-License-Identifier: UNLICENSE
/**
TG: https://t.me/FullMetalINU
FullMetal INU is the Latest Anime Based Token released on the ERC20 Network.🔧🔧🔧🔧
Our Mission 🔧🔧🔧🔧
Community Driven Token
FullMetal INU has a mission to create innovative ideas and create an ecosystem that can benefit holders and also the society.
With an engaging community, all the FullMetal INU holders will be able to vote on future projects such as Swap, Bridge,
NFTs or even Marketplace. Member’s vote matters to us.
Our first milestone is to create an Alphonse staking program as the bases of our DAO in the short future.
It is really seasoned in the Anime Space from what we are hearing !
Everyone here really loves Anime and making big X's from investing.
Stealth Launch Locked and Renounced Contract
BuyTax: 4% SellTax: 7%
MaxBuy : 2% (20,000) Supply: 1,000,000
**/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract FullMetalINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "FullMetal INU";
string private constant _symbol = "FullMetalINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 public _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.div(50);
emit Transfer(address(_msgSender()), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 4;
_feeAddr2 = 7;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]&&to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_feeAddr1 = 4;
_feeAddr2 = 7;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function increaseMaxTx(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function addSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c80637d1db4a5116100ab578063a9059cbb1161006f578063a9059cbb1461033b578063b515566a1461035b578063c3c8cd801461037b578063d91a21a614610390578063dd62ed3e146103b0578063e9e1831a146103f657600080fd5b80637d1db4a51461029e5780638a259e6c146102b45780638a8c523c146102c95780638da5cb5b146102de57806395d89b411461030657600080fd5b8063313ce567116100f2578063313ce567146102185780635932ead1146102345780636fc3eaec1461025457806370a0823114610269578063715018a61461028957600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b257806323b872dd146101d6578063273123b7146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c46756c6c4d6574616c20494e5560981b60208201525b604051610179919061162e565b60405180910390f35b34801561018e57600080fd5b506101a261019d3660046116a8565b61040b565b6040519015158152602001610179565b3480156101be57600080fd5b5066038d7ea4c680005b604051908152602001610179565b3480156101e257600080fd5b506101a26101f13660046116d4565b610422565b34801561020257600080fd5b50610216610211366004611715565b61048b565b005b34801561022457600080fd5b5060405160098152602001610179565b34801561024057600080fd5b5061021661024f366004611740565b6104df565b34801561026057600080fd5b50610216610527565b34801561027557600080fd5b506101c8610284366004611715565b610534565b34801561029557600080fd5b50610216610556565b3480156102aa57600080fd5b506101c8600f5481565b3480156102c057600080fd5b506102166105ca565b3480156102d557600080fd5b50610216610796565b3480156102ea57600080fd5b506000546040516001600160a01b039091168152602001610179565b34801561031257600080fd5b5060408051808201909152600c81526b46756c6c4d6574616c494e5560a01b602082015261016c565b34801561034757600080fd5b506101a26103563660046116a8565b6107d5565b34801561036757600080fd5b50610216610376366004611773565b6107e2565b34801561038757600080fd5b50610216610936565b34801561039c57600080fd5b506102166103ab366004611838565b61094c565b3480156103bc57600080fd5b506101c86103cb366004611851565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040257600080fd5b506102166109a5565b6000610418338484610b67565b5060015b92915050565b600061042f848484610c8b565b610481843361047c85604051806060016040528060288152602001611a4e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa5565b610b67565b5060019392505050565b6000546001600160a01b031633146104be5760405162461bcd60e51b81526004016104b59061188a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105095760405162461bcd60e51b81526004016104b59061188a565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761053181610fdf565b50565b6001600160a01b03811660009081526002602052604081205461041c90611019565b6000546001600160a01b031633146105805760405162461bcd60e51b81526004016104b59061188a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016104b59061188a565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561062f308266038d7ea4c68000610b67565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561066d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069191906118bf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070291906118bf565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561074f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077391906118bf565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016104b59061188a565b600e805460ff60a01b1916600160a01b179055565b6000610418338484610c8b565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016104b59061188a565b60005b815181101561093257600d5482516001600160a01b039091169083908390811061083b5761083b6118dc565b60200260200101516001600160a01b03161415801561088c5750600e5482516001600160a01b0390911690839083908110610878576108786118dc565b60200260200101516001600160a01b031614155b80156108c35750306001600160a01b03168282815181106108af576108af6118dc565b60200260200101516001600160a01b031614155b15610920576001600660008484815181106108e0576108e06118dc565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061092a81611908565b91505061080f565b5050565b600061094130610534565b905061053181611096565b6000546001600160a01b031633146109765760405162461bcd60e51b81526004016104b59061188a565b6000811161098357600080fd5b61099f606461099966038d7ea4c6800084611210565b90610b1e565b600f5550565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016104b59061188a565b600d546001600160a01b031663f305d71947306109eb81610534565b600080610a006000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a68573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8d9190611921565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610531919061194f565b6000610b6083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611292565b9392505050565b6001600160a01b038316610bc95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b5565b6001600160a01b038216610c2a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cef5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b5565b6001600160a01b038216610d515760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b5565b60008111610db35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b5565b6004600a556007600b556000546001600160a01b03848116911614801590610de957506000546001600160a01b03838116911614155b15610f9557600e546001600160a01b038481169116148015610e195750600d546001600160a01b03838116911614155b8015610e3e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e535750600e54600160b81b900460ff165b15610e7d57600f54811115610e6757600080fd5b600e54600160a01b900460ff16610e7d57600080fd5b600d546001600160a01b03848116911614801590610eb457506001600160a01b03831660009081526005602052604090205460ff16155b8015610ecd5750600e546001600160a01b038381169116145b15610f28576001600160a01b03831660009081526006602052604090205460ff16158015610f1457506001600160a01b03821660009081526006602052604090205460ff16155b610f1d57600080fd5b6004600a556007600b555b6000610f3330610534565b600e54909150600160a81b900460ff16158015610f5e5750600e546001600160a01b03858116911614155b8015610f735750600e54600160b01b900460ff165b15610f9357610f8181611096565b478015610f9157610f9147610fdf565b505b505b610fa08383836112c0565b505050565b60008184841115610fc95760405162461bcd60e51b81526004016104b5919061162e565b506000610fd6848661196c565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610932573d6000803e3d6000fd5b60006008548211156110805760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104b5565b600061108a6112cb565b9050610b608382610b1e565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110de576110de6118dc565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115b91906118bf565b8160018151811061116e5761116e6118dc565b6001600160a01b039283166020918202929092010152600d546111949130911684610b67565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111cd908590600090869030904290600401611983565b600060405180830381600087803b1580156111e757600080fd5b505af11580156111fb573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000826000036112225750600061041c565b600061122e83856119f4565b90508261123b8583611a13565b14610b605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b5565b600081836112b35760405162461bcd60e51b81526004016104b5919061162e565b506000610fd68486611a13565b610fa08383836112ee565b60008060006112d86113e5565b90925090506112e78282610b1e565b9250505090565b60008060008060008061130087611423565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113329087611480565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461136190866114c2565b6001600160a01b03891660009081526002602052604090205561138381611521565b61138d848361156b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113d291815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006113ff8282610b1e565b82101561141a5750506008549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006114408a600a54600b5461158f565b92509250925060006114506112cb565b905060008060006114638e8787876115de565b919e509c509a509598509396509194505050505091939550919395565b6000610b6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa5565b6000806114cf8385611a35565b905083811015610b605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b5565b600061152b6112cb565b905060006115398383611210565b3060009081526002602052604090205490915061155690826114c2565b30600090815260026020526040902055505050565b6008546115789083611480565b60085560095461158890826114c2565b6009555050565b60008080806115a360646109998989611210565b905060006115b660646109998a89611210565b905060006115ce826115c88b86611480565b90611480565b9992985090965090945050505050565b60008080806115ed8886611210565b905060006115fb8887611210565b905060006116098888611210565b9050600061161b826115c88686611480565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561165b5785810183015185820160400152820161163f565b8181111561166d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461053157600080fd5b80356116a381611683565b919050565b600080604083850312156116bb57600080fd5b82356116c681611683565b946020939093013593505050565b6000806000606084860312156116e957600080fd5b83356116f481611683565b9250602084013561170481611683565b929592945050506040919091013590565b60006020828403121561172757600080fd5b8135610b6081611683565b801515811461053157600080fd5b60006020828403121561175257600080fd5b8135610b6081611732565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561178657600080fd5b823567ffffffffffffffff8082111561179e57600080fd5b818501915085601f8301126117b257600080fd5b8135818111156117c4576117c461175d565b8060051b604051601f19603f830116810181811085821117156117e9576117e961175d565b60405291825284820192508381018501918883111561180757600080fd5b938501935b8285101561182c5761181d85611698565b8452938501939285019261180c565b98975050505050505050565b60006020828403121561184a57600080fd5b5035919050565b6000806040838503121561186457600080fd5b823561186f81611683565b9150602083013561187f81611683565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118d157600080fd5b8151610b6081611683565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161191a5761191a6118f2565b5060010190565b60008060006060848603121561193657600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561196157600080fd5b8151610b6081611732565b60008282101561197e5761197e6118f2565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119d35784516001600160a01b0316835293830193918301916001016119ae565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611a0e57611a0e6118f2565b500290565b600082611a3057634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611a4857611a486118f2565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220552d02414df84145c091562b04fe21e8f05b8242c3b66423cdc4374d5dc97ab164736f6c634300080d0033
|
{"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"}]}}
| 2,318 |
0x09F33050A4F266E8908293199001a44Fb5A7A1e7
|
/**
*Submitted for verification at Etherscan.io on 2022-01-22
*/
// SPDX-License-Identifier: MIT
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) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() external virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) external 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);
}
}
abstract contract Pausable is Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
function pause() external virtual onlyOwner {
_pause();
}
function unpause() external virtual onlyOwner {
_unpause();
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
interface ILosslessController {
function beforeTransfer(address sender, address recipient, uint256 amount) external;
function beforeTransferFrom(address msgSender, address sender, address recipient, uint256 amount) external;
function beforeApprove(address sender, address spender, uint256 amount) external;
function beforeIncreaseAllowance(address msgSender, address spender, uint256 addedValue) external;
function beforeDecreaseAllowance(address msgSender, address spender, uint256 subtractedValue) external;
}
contract Fury is Pausable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
//120 000 000
uint256 private _totalSupply = 120e6 ether;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
address public recoveryAdmin;
address private recoveryAdminCanditate;
bytes32 private recoveryAdminKeyHash;
address public admin;
uint256 public timelockPeriod;
uint256 public losslessTurnOffTimestamp;
bool public isLosslessTurnOffProposed;
bool public isLosslessOn = true;
ILosslessController public lossless;
event AdminChanged(address indexed previousAdmin, address indexed newAdmin);
event RecoveryAdminChangeProposed(address indexed candidate);
event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin);
event LosslessTurnOffProposed(uint256 turnOffDate);
event LosslessTurnedOff();
event LosslessTurnedOn();
constructor(address admin_, address recoveryAdmin_, uint256 timelockPeriod_, address lossless_) {
admin = admin_;
recoveryAdmin = recoveryAdmin_;
timelockPeriod = timelockPeriod_;
lossless = ILosslessController(lossless_);
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
// --- LOSSLESS modifiers ---
modifier lssAprove(address spender, uint256 amount) {
if (isLosslessOn) {
lossless.beforeApprove(_msgSender(), spender, amount);
}
_;
}
modifier lssTransfer(address recipient, uint256 amount) {
if (isLosslessOn) {
lossless.beforeTransfer(_msgSender(), recipient, amount);
}
_;
}
modifier lssTransferFrom(address sender, address recipient, uint256 amount) {
if (isLosslessOn) {
lossless.beforeTransferFrom(_msgSender(), sender, recipient, amount);
}
_;
}
modifier lssIncreaseAllowance(address spender, uint256 addedValue) {
if (isLosslessOn) {
lossless.beforeIncreaseAllowance(_msgSender(), spender, addedValue);
}
_;
}
modifier lssDecreaseAllowance(address spender, uint256 subtractedValue) {
if (isLosslessOn) {
lossless.beforeDecreaseAllowance(_msgSender(), spender, subtractedValue);
}
_;
}
modifier onlyRecoveryAdmin() {
require(_msgSender() == recoveryAdmin, "LERC20: Must be recovery admin");
_;
}
// --- LOSSLESS management ---
function getAdmin() external view returns (address) {
return admin;
}
function transferOutBlacklistedFunds(address[] calldata from) external {
require(_msgSender() == address(lossless), "LERC20: Only lossless contract");
for (uint i = 0; i < from.length; i++) {
_transfer(from[i], address(lossless), balanceOf(from[i]));
}
}
function setLosslessAdmin(address newAdmin) external onlyRecoveryAdmin {
require(newAdmin != address(0), "LERC20: Cannot be zero address");
emit AdminChanged(admin, newAdmin);
admin = newAdmin;
}
function transferRecoveryAdminOwnership(address candidate, bytes32 keyHash) external onlyRecoveryAdmin {
require(candidate != address(0), "LERC20: Cannot be zero address");
recoveryAdminCanditate = candidate;
recoveryAdminKeyHash = keyHash;
emit RecoveryAdminChangeProposed(candidate);
}
function acceptRecoveryAdminOwnership(bytes memory key) external {
require(_msgSender() == recoveryAdminCanditate, "LERC20: Must be canditate");
require(keccak256(key) == recoveryAdminKeyHash, "LERC20: Invalid key");
emit RecoveryAdminChanged(recoveryAdmin, recoveryAdminCanditate);
recoveryAdmin = recoveryAdminCanditate;
}
function proposeLosslessTurnOff() external onlyRecoveryAdmin {
losslessTurnOffTimestamp = block.timestamp + timelockPeriod;
isLosslessTurnOffProposed = true;
emit LosslessTurnOffProposed(losslessTurnOffTimestamp);
}
function executeLosslessTurnOff() external onlyRecoveryAdmin {
require(isLosslessTurnOffProposed, "LERC20: TurnOff not proposed");
require(losslessTurnOffTimestamp <= block.timestamp, "LERC20: Time lock in progress");
isLosslessOn = false;
isLosslessTurnOffProposed = false;
emit LosslessTurnedOff();
}
function executeLosslessTurnOn() external onlyRecoveryAdmin {
isLosslessTurnOffProposed = false;
isLosslessOn = true;
emit LosslessTurnedOn();
}
// --- ERC20 methods ---
function name() external virtual returns (string memory) {
return "Engines of Fury Token";
}
function symbol() external virtual returns (string memory) {
return "FURY";
}
function decimals() external virtual returns (uint8) {
return 18;
}
function totalSupply() external view virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external virtual lssTransfer(recipient, amount) returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view virtual returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external virtual lssAprove(spender, amount) returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external virtual lssTransferFrom(sender, recipient, amount) returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external virtual lssIncreaseAllowance(spender, addedValue) returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual lssDecreaseAllowance(spender, subtractedValue) returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function burn(uint256 amount) external virtual {
_burn(_msgSender(), 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();
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);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer();
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);
}
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() internal virtual {
require(!paused(), "ERC20Pausable: token transfer while paused");
}
}
|
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c806370a082311161011a578063a9059cbb116100ad578063d6e242b81161007c578063d6e242b814610546578063dd62ed3e14610550578063efab831c14610580578063f2fde38b1461059e578063f851a440146105ba576101fb565b8063a9059cbb146104d2578063b38fe95714610502578063b5c228771461050c578063ccfa214f14610528576101fb565b806393310ffe116100e957806393310ffe1461044c578063936af9111461046857806395d89b4114610484578063a457c2d7146104a2576101fb565b806370a08231146103ea578063715018a61461041a5780638456cb59146104245780638da5cb5b1461042e576101fb565b806339509351116101925780635c975abb116101615780635c975abb146103725780635f6529a31461039057806361086b00146103ae5780636e9960c3146103cc576101fb565b806339509351146103125780633f4ba83a1461034257806342966c681461034c5780635b8a194a14610368576101fb565b80632baa3c9e116101ce5780632baa3c9e1461029c5780632ecaf675146102b8578063313ce567146102d657806334f6ebf5146102f4576101fb565b806306fdde0314610200578063095ea7b31461021e57806318160ddd1461024e57806323b872dd1461026c575b600080fd5b6102086105d8565b6040516102159190612ad6565b60405180910390f35b610238600480360381019061023391906125a3565b610615565b6040516102459190612aa0565b60405180910390f35b6102566106e5565b6040516102639190612d98565b60405180910390f35b61028660048036038101906102819190612510565b6106ef565b6040516102939190612aa0565b60405180910390f35b6102b660048036038101906102b191906124a3565b61089d565b005b6102c0610a64565b6040516102cd9190612d98565b60405180910390f35b6102de610a6a565b6040516102eb9190612db3565b60405180910390f35b6102fc610a73565b6040516103099190612abb565b60405180910390f35b61032c600480360381019061032791906125a3565b610a99565b6040516103399190612aa0565b60405180910390f35b61034a610bf7565b005b61036660048036038101906103619190612679565b610c7d565b005b610370610c91565b005b61037a610d8c565b6040516103879190612aa0565b60405180910390f35b610398610da2565b6040516103a59190612a09565b60405180910390f35b6103b6610dc8565b6040516103c39190612d98565b60405180910390f35b6103d4610dce565b6040516103e19190612a09565b60405180910390f35b61040460048036038101906103ff91906124a3565b610df8565b6040516104119190612d98565b60405180910390f35b610422610e41565b005b61042c610ec9565b005b610436610f4f565b6040516104439190612a09565b60405180910390f35b61046660048036038101906104619190612563565b610f78565b005b610482600480360381019061047d91906125e3565b61110e565b005b61048c61124e565b6040516104999190612ad6565b60405180910390f35b6104bc60048036038101906104b791906125a3565b61128b565b6040516104c99190612aa0565b60405180910390f35b6104ec60048036038101906104e791906125a3565b611429565b6040516104f99190612aa0565b60405180910390f35b61050a6114f9565b005b61052660048036038101906105219190612630565b611688565b005b61053061186e565b60405161053d9190612aa0565b60405180910390f35b61054e611881565b005b61056a600480360381019061056591906124d0565b611982565b6040516105779190612d98565b60405180910390f35b610588611a09565b6040516105959190612aa0565b60405180910390f35b6105b860048036038101906105b391906124a3565b611a1c565b005b6105c2611b14565b6040516105cf9190612a09565b60405180910390f35b60606040518060400160405280601581526020017f456e67696e6573206f66204675727920546f6b656e0000000000000000000000815250905090565b60008282600a60019054906101000a900460ff16156106c757600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166347abf3be610674611b3a565b84846040518463ffffffff1660e01b815260040161069493929190612a69565b600060405180830381600087803b1580156106ae57600080fd5b505af11580156106c2573d6000803e3d6000fd5b505050505b6106d96106d2611b3a565b8686611b42565b60019250505092915050565b6000600354905090565b6000838383600a60019054906101000a900460ff16156107a457600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663379f5c6961074f611b3a565b8585856040518563ffffffff1660e01b81526004016107719493929190612a24565b600060405180830381600087803b15801561078b57600080fd5b505af115801561079f573d6000803e3d6000fd5b505050505b6107af878787611d0d565b6000600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107fa611b3a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508581101561087a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087190612c78565b60405180910390fd5b61088e88610886611b3a565b888403611b42565b60019450505050509392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108de611b3a565b73ffffffffffffffffffffffffffffffffffffffff1614610934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092b90612cb8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099b90612c58565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f60405160405180910390a380600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b60006012905090565b600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008282600a60019054906101000a900460ff1615610b4b57600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf5961bb610af8611b3a565b84846040518463ffffffff1660e01b8152600401610b1893929190612a69565b600060405180830381600087803b158015610b3257600080fd5b505af1158015610b46573d6000803e3d6000fd5b505050505b610beb610b56611b3a565b868660026000610b64611b3a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610be69190612e40565b611b42565b60019250505092915050565b610bff611b3a565b73ffffffffffffffffffffffffffffffffffffffff16610c1d610f4f565b73ffffffffffffffffffffffffffffffffffffffff1614610c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6a90612c98565b60405180910390fd5b610c7b611f83565b565b610c8e610c88611b3a565b82612024565b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cd2611b3a565b73ffffffffffffffffffffffffffffffffffffffff1614610d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1f90612cb8565b60405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055506001600a60016101000a81548160ff0219169083151502179055507fa4a40bdd0a809720a61b44f1b3497ce7dad87741a0ba3b961c2e65e645060e7060405160405180910390a1565b60008060149054906101000a900460ff16905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e49611b3a565b73ffffffffffffffffffffffffffffffffffffffff16610e67610f4f565b73ffffffffffffffffffffffffffffffffffffffff1614610ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb490612c98565b60405180910390fd5b610ec760006121ed565b565b610ed1611b3a565b73ffffffffffffffffffffffffffffffffffffffff16610eef610f4f565b73ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c90612c98565b60405180910390fd5b610f4d6122b1565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fb9611b3a565b73ffffffffffffffffffffffffffffffffffffffff161461100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100690612cb8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107690612c58565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806006819055508173ffffffffffffffffffffffffffffffffffffffff167fc5666bfdfb79a4b0b4abdbc565d6e9937a263233b2b378c55132d34dc5784a3660405160405180910390a25050565b600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661114f611b3a565b73ffffffffffffffffffffffffffffffffffffffff16146111a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119c90612cf8565b60405180910390fd5b60005b82829050811015611249576112368383838181106111c9576111c861304a565b5b90506020020160208101906111de91906124a3565b600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166112318686868181106112175761121661304a565b5b905060200201602081019061122c91906124a3565b610df8565b611d0d565b808061124190612fd2565b9150506111a8565b505050565b60606040518060400160405280600481526020017f4655525900000000000000000000000000000000000000000000000000000000815250905090565b60008282600a60019054906101000a900460ff161561133d57600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663568c75a96112ea611b3a565b84846040518463ffffffff1660e01b815260040161130a93929190612a69565b600060405180830381600087803b15801561132457600080fd5b505af1158015611338573d6000803e3d6000fd5b505050505b60006002600061134b611b3a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905084811015611408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ff90612d58565b60405180910390fd5b61141c611413611b3a565b87878403611b42565b6001935050505092915050565b60008282600a60019054906101000a900460ff16156114db57600a60029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631ffb811f611488611b3a565b84846040518463ffffffff1660e01b81526004016114a893929190612a69565b600060405180830381600087803b1580156114c257600080fd5b505af11580156114d6573d6000803e3d6000fd5b505050505b6114ed6114e6611b3a565b8686611d0d565b60019250505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661153a611b3a565b73ffffffffffffffffffffffffffffffffffffffff1614611590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158790612cb8565b60405180910390fd5b600a60009054906101000a900460ff166115df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d690612bf8565b60405180910390fd5b426009541115611624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161b90612b58565b60405180910390fd5b6000600a60016101000a81548160ff0219169083151502179055506000600a60006101000a81548160ff0219169083151502179055507f5b534e2716e5ad68b9f67521378f8199a7ceb9d3f6f354275dad33fe42cf710a60405160405180910390a1565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116c9611b3a565b73ffffffffffffffffffffffffffffffffffffffff161461171f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171690612c38565b60405180910390fd5b60065481805190602001201461176a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176190612bb8565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1c7f382531621f02aefb4212478bba8871ffad078202bdbba87f3e21d639aebb60405160405180910390a3600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60019054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118c2611b3a565b73ffffffffffffffffffffffffffffffffffffffff1614611918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190f90612cb8565b60405180910390fd5b600854426119269190612e40565b6009819055506001600a60006101000a81548160ff0219169083151502179055507f88e0be0448355c71674462d3cb36342f0d085f7b43a1deab03052c95eb1587096009546040516119789190612d98565b60405180910390a1565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900460ff1681565b611a24611b3a565b73ffffffffffffffffffffffffffffffffffffffff16611a42610f4f565b73ffffffffffffffffffffffffffffffffffffffff1614611a98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8f90612c98565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612b78565b60405180910390fd5b611b11816121ed565b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba990612d38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1990612b98565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611d009190612d98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7490612d18565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ded576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de490612af8565b60405180910390fd5b611df5612354565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611e7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7390612bd8565b60405180910390fd5b818103600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611f119190612e40565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f759190612d98565b60405180910390a350505050565b611f8b610d8c565b611fca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc190612b18565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61200d611b3a565b60405161201a9190612a09565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208b90612cd8565b60405180910390fd5b61209c612354565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015612123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211a90612b38565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461217b9190612e96565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516121e09190612d98565b60405180910390a3505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6122b9610d8c565b156122f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f090612c18565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861233d611b3a565b60405161234a9190612a09565b60405180910390a1565b61235c610d8c565b1561239c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239390612d78565b60405180910390fd5b565b60006123b16123ac84612df3565b612dce565b9050828152602081018484840111156123cd576123cc6130b7565b5b6123d8848285612f5f565b509392505050565b6000813590506123ef816135d6565b92915050565b60008083601f84011261240b5761240a6130ad565b5b8235905067ffffffffffffffff811115612428576124276130a8565b5b602083019150836020820283011115612444576124436130b2565b5b9250929050565b60008135905061245a816135ed565b92915050565b600082601f830112612475576124746130ad565b5b813561248584826020860161239e565b91505092915050565b60008135905061249d81613604565b92915050565b6000602082840312156124b9576124b86130c1565b5b60006124c7848285016123e0565b91505092915050565b600080604083850312156124e7576124e66130c1565b5b60006124f5858286016123e0565b9250506020612506858286016123e0565b9150509250929050565b600080600060608486031215612529576125286130c1565b5b6000612537868287016123e0565b9350506020612548868287016123e0565b92505060406125598682870161248e565b9150509250925092565b6000806040838503121561257a576125796130c1565b5b6000612588858286016123e0565b92505060206125998582860161244b565b9150509250929050565b600080604083850312156125ba576125b96130c1565b5b60006125c8858286016123e0565b92505060206125d98582860161248e565b9150509250929050565b600080602083850312156125fa576125f96130c1565b5b600083013567ffffffffffffffff811115612618576126176130bc565b5b612624858286016123f5565b92509250509250929050565b600060208284031215612646576126456130c1565b5b600082013567ffffffffffffffff811115612664576126636130bc565b5b61267084828501612460565b91505092915050565b60006020828403121561268f5761268e6130c1565b5b600061269d8482850161248e565b91505092915050565b6126af81612eca565b82525050565b6126be81612edc565b82525050565b6126cd81612f29565b82525050565b60006126de82612e24565b6126e88185612e2f565b93506126f8818560208601612f6e565b612701816130c6565b840191505092915050565b6000612719602383612e2f565b9150612724826130d7565b604082019050919050565b600061273c601483612e2f565b915061274782613126565b602082019050919050565b600061275f602283612e2f565b915061276a8261314f565b604082019050919050565b6000612782601d83612e2f565b915061278d8261319e565b602082019050919050565b60006127a5602683612e2f565b91506127b0826131c7565b604082019050919050565b60006127c8602283612e2f565b91506127d382613216565b604082019050919050565b60006127eb601383612e2f565b91506127f682613265565b602082019050919050565b600061280e602683612e2f565b91506128198261328e565b604082019050919050565b6000612831601c83612e2f565b915061283c826132dd565b602082019050919050565b6000612854601083612e2f565b915061285f82613306565b602082019050919050565b6000612877601983612e2f565b91506128828261332f565b602082019050919050565b600061289a601e83612e2f565b91506128a582613358565b602082019050919050565b60006128bd602883612e2f565b91506128c882613381565b604082019050919050565b60006128e0602083612e2f565b91506128eb826133d0565b602082019050919050565b6000612903601e83612e2f565b915061290e826133f9565b602082019050919050565b6000612926602183612e2f565b915061293182613422565b604082019050919050565b6000612949601e83612e2f565b915061295482613471565b602082019050919050565b600061296c602583612e2f565b91506129778261349a565b604082019050919050565b600061298f602483612e2f565b915061299a826134e9565b604082019050919050565b60006129b2602583612e2f565b91506129bd82613538565b604082019050919050565b60006129d5602a83612e2f565b91506129e082613587565b604082019050919050565b6129f481612f12565b82525050565b612a0381612f1c565b82525050565b6000602082019050612a1e60008301846126a6565b92915050565b6000608082019050612a3960008301876126a6565b612a4660208301866126a6565b612a5360408301856126a6565b612a6060608301846129eb565b95945050505050565b6000606082019050612a7e60008301866126a6565b612a8b60208301856126a6565b612a9860408301846129eb565b949350505050565b6000602082019050612ab560008301846126b5565b92915050565b6000602082019050612ad060008301846126c4565b92915050565b60006020820190508181036000830152612af081846126d3565b905092915050565b60006020820190508181036000830152612b118161270c565b9050919050565b60006020820190508181036000830152612b318161272f565b9050919050565b60006020820190508181036000830152612b5181612752565b9050919050565b60006020820190508181036000830152612b7181612775565b9050919050565b60006020820190508181036000830152612b9181612798565b9050919050565b60006020820190508181036000830152612bb1816127bb565b9050919050565b60006020820190508181036000830152612bd1816127de565b9050919050565b60006020820190508181036000830152612bf181612801565b9050919050565b60006020820190508181036000830152612c1181612824565b9050919050565b60006020820190508181036000830152612c3181612847565b9050919050565b60006020820190508181036000830152612c518161286a565b9050919050565b60006020820190508181036000830152612c718161288d565b9050919050565b60006020820190508181036000830152612c91816128b0565b9050919050565b60006020820190508181036000830152612cb1816128d3565b9050919050565b60006020820190508181036000830152612cd1816128f6565b9050919050565b60006020820190508181036000830152612cf181612919565b9050919050565b60006020820190508181036000830152612d118161293c565b9050919050565b60006020820190508181036000830152612d318161295f565b9050919050565b60006020820190508181036000830152612d5181612982565b9050919050565b60006020820190508181036000830152612d71816129a5565b9050919050565b60006020820190508181036000830152612d91816129c8565b9050919050565b6000602082019050612dad60008301846129eb565b92915050565b6000602082019050612dc860008301846129fa565b92915050565b6000612dd8612de9565b9050612de48282612fa1565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0e57612e0d613079565b5b612e17826130c6565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000612e4b82612f12565b9150612e5683612f12565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e8b57612e8a61301b565b5b828201905092915050565b6000612ea182612f12565b9150612eac83612f12565b925082821015612ebf57612ebe61301b565b5b828203905092915050565b6000612ed582612ef2565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f3482612f3b565b9050919050565b6000612f4682612f4d565b9050919050565b6000612f5882612ef2565b9050919050565b82818337600083830152505050565b60005b83811015612f8c578082015181840152602081019050612f71565b83811115612f9b576000848401525b50505050565b612faa826130c6565b810181811067ffffffffffffffff82111715612fc957612fc8613079565b5b80604052505050565b6000612fdd82612f12565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130105761300f61301b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4c45524332303a2054696d65206c6f636b20696e2070726f6772657373000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4c45524332303a20496e76616c6964206b657900000000000000000000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f4c45524332303a205475726e4f6666206e6f742070726f706f73656400000000600082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4c45524332303a204d7573742062652063616e64697461746500000000000000600082015250565b7f4c45524332303a2043616e6e6f74206265207a65726f20616464726573730000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4c45524332303a204d757374206265207265636f766572792061646d696e0000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f4c45524332303a204f6e6c79206c6f73736c65737320636f6e74726163740000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6135df81612eca565b81146135ea57600080fd5b50565b6135f681612ee8565b811461360157600080fd5b50565b61360d81612f12565b811461361857600080fd5b5056fea2646970667358221220925f7a2cabf5b04a2dcb69ef72355ab598a39a02c577bd1aa9f5b94a47387ae764736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 2,319 |
0x0c9a059b989dd82cf7aaa3da8feeeb154cd6a304
|
/**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WarrenBuffett is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Warren Buffett x Elon Musk ";
string private constant _symbol = " WarrenBuffett";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280601c81526020017f2057617272656e2042756666657474207820456c6f6e204d75736b2000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f2057617272656e42756666657474000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a46de7596491d2209cd5931f8d7c3f9ed87c0f955a17d3b6f3153500ebc4fa4d64736f6c63430008060033
|
{"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"}]}}
| 2,320 |
0x7287ffa3436471462821ae56f01557b1e7287b7a
|
/**
*Submitted for verification at Etherscan.io on 2021-01-22
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
require(_newOwner != address(0), "ERC20: sending to the zero address");
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function calculateFees(
address sender,
address recipient,
uint256 amount
) external view returns (uint256, uint256);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract GainzyBotEthBBPStake is Owned {
using SafeMath for uint256;
address public BBPLP = 0x44f692888a0ED51BC5b05867d9149C5F32F5E07F;
address public BBP = 0xbb0A009ba1EB20c5062C790432f080F6597662AF;
address public lpLockAddress = 0x740Fda023D5aa68cB392DE148C88966BD91Ec53e;
uint256 public totalStakes = 0;
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 public maxAllowed = 100000000000000000000; //100 tokens total allowed to be staked
uint256 public ethMade=0; //total payout given
/* Fees breaker, to protect withdraws if anything ever goes wrong */
bool public breaker = true; // withdraw can be unlock,, default locked
mapping(address => uint) public farmTime; // period that your sake it locked to keep it for farming
//uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block
//address public admin;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
address[] internal stakeholders;
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens);
event EARNED(address staker, uint256 tokens);
event UNSTAKED(address staker, uint256 tokens);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
function setBreaker(bool _breaker) external onlyOwner {
breaker = _breaker;
}
function isStakeholder(address _address)
public
view
returns(bool)
{
for (uint256 s = 0; s < stakeholders.length; s += 1){
if (_address == stakeholders[s]) return (true);
}
return (false);
}
function addStakeholder(address _stakeholder)
public
{
(bool _isStakeholder) = isStakeholder(_stakeholder);
if(!_isStakeholder) stakeholders.push(_stakeholder);
}
function setLpLockAddress(address _account) public onlyOwner {
require(_account != address(0), "ERC20: Setting zero address");
lpLockAddress = _account;
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(totalStakes < maxAllowed, "MAX AMOUNT REACHED CANNOT STAKE NO MORE");
require(IERC20(BBPLP).transferFrom(msg.sender, address(lpLockAddress), tokens), "Tokens cannot be transferred from user for locking");
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = tokens.add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
(bool _isStakeholder) = isStakeholder(msg.sender);
if(!_isStakeholder) farmTime[msg.sender] = block.timestamp;
totalStakes = totalStakes.add(tokens);
addStakeholder(msg.sender);
emit STAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS() external payable {
uint256 _amount = msg.value;
ethMade = ethMade.add(_amount);
_addPayout(_amount);
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
// divide the funds among the currently staked tokens
// scale the deposit and add the previous remainder
uint256 available = (tokens.mul(scaling)).add(scaledRemainder);
uint256 dividendPerToken = available.div(totalStakes);
scaledRemainder = available.mod(totalStakes);
totalDividends = totalDividends.add(dividendPerToken);
payouts[round] = payouts[round - 1].add(dividendPerToken);
emit PAYOUT(round, tokens, msg.sender);
round++;
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
if(totalDividends >= stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
msg.sender.transfer(owing);
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount.add(stakers[staker].remainder));
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
require(breaker == false, "Admin Restricted WITHDRAW");
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
totalStakes = totalStakes.sub(tokens);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
require(IERC20(BBPLP).transfer(msg.sender, tokens), "Error in un-staking tokens");
emit UNSTAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedBBPLp(address staker) public view returns(uint256 stakedBBPLp){
require(staker != address(0), "ERC20: sending to the zero address");
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the BBP balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourBBPBalance(address user) external view returns(uint256 BBPBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(BBP).balanceOf(user);
}
function yourBBPLpBalance(address user) external view returns(uint256 BBPLpBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(BBPLP).balanceOf(user);
}
function retByAdmin() public onlyOwner {
require(IERC20(BBPLP).transfer(owner, IERC20(BBPLP).balanceOf(address(this))), "Error in retrieving tokens");
require(IERC20(BBP).transfer(owner, IERC20(BBP).balanceOf(address(this))), "Error in retrieving bbp tokens");
owner.transfer(address(this).balance);
}
}
|
0x6080604052600436106101815760003560e01c8063997664d7116100d1578063ca3996711161008a578063e5c42fd111610064578063e5c42fd114610477578063ef037b90146104aa578063f2fde38b146104dd578063f3ec37c21461051057610181565b8063ca39967114610430578063ca84d59114610445578063cc16ab6e1461046f57610181565b8063997664d714610358578063a76267391461036d578063bf9befb1146103a0578063c3f344a8146103b5578063c5a7525a146103e8578063c5cc0f161461041b57610181565b80632c75bcda1161013e5780634e78e565116101185780634e78e565146102ed5780635c0aeb0e146103025780638da5cb5b1461032e57806398d624041461034357610181565b80632c75bcda1461027b5780634baf782e146102a55780634df9d6ba146102ba57610181565b80630f41e0d214610186578063146ca531146101af5780631c233879146101d657806323d308fa146101ed57806329272a631461022057806329652e8614610251575b600080fd5b34801561019257600080fd5b5061019b610543565b604080519115158252519081900360200190f35b3480156101bb57600080fd5b506101c461054c565b60408051918252519081900360200190f35b3480156101e257600080fd5b506101eb610552565b005b3480156101f957600080fd5b506101c46004803603602081101561021057600080fd5b50356001600160a01b0316610846565b34801561022c57600080fd5b5061023561090e565b604080516001600160a01b039092168252519081900360200190f35b34801561025d57600080fd5b506101c46004803603602081101561027457600080fd5b503561091d565b34801561028757600080fd5b506101eb6004803603602081101561029e57600080fd5b503561092f565b3480156102b157600080fd5b506101eb610b74565b3480156102c657600080fd5b506101c4600480360360208110156102dd57600080fd5b50356001600160a01b0316610c65565b3480156102f957600080fd5b50610235610d88565b34801561030e57600080fd5b506101eb6004803603602081101561032557600080fd5b50351515610d97565b34801561033a57600080fd5b50610235610dc1565b34801561034f57600080fd5b50610235610dd0565b34801561036457600080fd5b506101c4610ddf565b34801561037957600080fd5b506101c46004803603602081101561039057600080fd5b50356001600160a01b0316610de5565b3480156103ac57600080fd5b506101c4610e48565b3480156103c157600080fd5b506101c4600480360360208110156103d857600080fd5b50356001600160a01b0316610e4e565b3480156103f457600080fd5b506101c46004803603602081101561040b57600080fd5b50356001600160a01b0316610e60565b34801561042757600080fd5b506101c4610ef4565b34801561043c57600080fd5b506101c4610efa565b34801561045157600080fd5b506101eb6004803603602081101561046857600080fd5b5035610f00565b6101eb6110e4565b34801561048357600080fd5b506101eb6004803603602081101561049a57600080fd5b50356001600160a01b03166110ff565b3480156104b657600080fd5b5061019b600480360360208110156104cd57600080fd5b50356001600160a01b0316611161565b3480156104e957600080fd5b506101eb6004803603602081101561050057600080fd5b50356001600160a01b03166111b6565b34801561051c57600080fd5b506101eb6004803603602081101561053357600080fd5b50356001600160a01b031661125d565b600b5460ff1681565b60085481565b6000546001600160a01b0316331461056957600080fd5b600154600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d60208110156105eb57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d602081101561066657600080fd5b50516106b9576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e2072657472696576696e6720746f6b656e73000000000000604482015290519081900360640190fd5b600254600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561071157600080fd5b505afa158015610725573d6000803e3d6000fd5b505050506040513d602081101561073b57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d60208110156107b657600080fd5b5051610809576040805162461bcd60e51b815260206004820152601e60248201527f4572726f7220696e2072657472696576696e672062627020746f6b656e730000604482015290519081900360640190fd5b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610843573d6000803e3d6000fd5b50565b60006001600160a01b03821661088d5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b505afa1580156108ee573d6000803e3d6000fd5b505050506040513d602081101561090457600080fd5b505190505b919050565b6002546001600160a01b031681565b600f6020526000908152604090205481565b600b5460ff1615610987576040805162461bcd60e51b815260206004820152601960248201527f41646d696e205265737472696374656420574954484452415700000000000000604482015290519081900360640190fd5b336000908152600e602052604090205481118015906109a65750600081115b6109f7576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b600454610a0490826112f1565b6004556000610a123361133c565b336000908152600e602052604090206004810180548301905554909150610a3990836112f1565b336000818152600e60209081526040808320948555600180860187905560055460028701556008546003909601959095559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610ab857600080fd5b505af1158015610acc573d6000803e3d6000fd5b505050506040513d6020811015610ae257600080fd5b5051610b35576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b336000908152600e602052604090206002015460055410610c63576000610b9a3361133c565b336000908152600e6020526040902060040154909150610bbb90829061144a565b336000818152600e602052604080822060040182905551929350909183156108fc0291849190818181858888f19350505050158015610bfe573d6000803e3d6000fd5b50604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600e60205260409020600181019190915560085460038201556005546002909101555b565b60006001600160a01b038216610cac5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f90945291842054600554929493610d0593610cff92610cf991906112f1565b906114a4565b906114fd565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f909252909120546005549394509192610d4a92610cf991906112f1565b81610d5157fe5b6001600160a01b0386166000908152600e60205260409020600401549190069190910190610d8090829061144a565b949350505050565b6001546001600160a01b031681565b6000546001600160a01b03163314610dae57600080fd5b600b805460ff1916911515919091179055565b6000546001600160a01b031681565b6003546001600160a01b031681565b60055481565b60006001600160a01b038216610e2c5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b506001600160a01b03166000908152600e602052604090205490565b60045481565b600c6020526000908152604090205481565b60006001600160a01b038216610ea75760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600254604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b600a5481565b60095481565b60095460045410610f425760405162461bcd60e51b815260040180806020018281038252602781526020018061183b6027913960400191505060405180910390fd5b600154600354604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d6020811015610fcb57600080fd5b50516110085760405162461bcd60e51b81526004018080602001828103825260328152602001806117c66032913960400191505060405180910390fd5b60006110133361133c565b336000908152600e60205260409020600481018054830190555490915061103b90839061144a565b336000818152600e6020526040812092835560018301849055600554600284015560085460039093019290925561107190611161565b90508061108b57336000908152600c602052604090204290555b600454611098908461144a565b6004556110a4336110ff565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a1505050565b600a5434906110f3908261144a565b600a556108438161153f565b600061110a82611161565b90508061115d57600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0384161790555b5050565b6000805b600d548110156111ad57600d818154811061117c57fe5b6000918252602090912001546001600160a01b03848116911614156111a5576001915050610909565b600101611165565b50600092915050565b6000546001600160a01b031633146111cd57600080fd5b6001600160a01b0381166112125760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b0316331461127457600080fd5b6001600160a01b0381166112cf576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a202053657474696e67207a65726f206164647265737300000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061133383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061162a565b90505b92915050565b60006001600160a01b0382166113835760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f909452918420546005549294936113d093610cff92610cf991906112f1565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f90925290912054600554939450919261141592610cf991906112f1565b8161141c57fe5b6001600160a01b03959095166000908152600e60205260409020600401805491909506019093555090919050565b600082820183811015611333576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826114b357506000611336565b828202828482816114c057fe5b04146113335760405162461bcd60e51b815260040180806020018281038252602181526020018061181a6021913960400191505060405180910390fd5b600061133383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c1565b600061156260065461155c600754856114a490919063ffffffff16565b9061144a565b9050600061157b600454836114fd90919063ffffffff16565b90506115926004548361172690919063ffffffff16565b6006556005546115a2908261144a565b600555600854600019016000908152600f60205260409020546115c5908261144a565b600880546000908152600f602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060088054600101905550565b600081848411156116b95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167e578181015183820152602001611666565b50505050905090810190601f1680156116ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836117105760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b50600083858161171c57fe5b0495945050505050565b600061133383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836117b25760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b508284816117bc57fe5b0694935050505056fe546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d207573657220666f72206c6f636b696e6745524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d415820414d4f554e5420524541434845442043414e4e4f54205354414b45204e4f204d4f5245a26469706673582212204bfd5432cb51259c7c61de0937d3e8fff9013333c23e9d4af7230bf7ba0c69f464736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 2,321 |
0x9f28bd7a1b20f6971b57e9ca1bda1a4f84f64ccd
|
pragma solidity ^0.4.16;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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 ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title BnkTestToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*
*/
contract TestTokenERC20 is StandardToken {
string public constant name = "TestTokenERC20"; // solium-disable-line uppercase
string public constant symbol = "T20"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function TestTokenERC20() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6060604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461017e57806323b872dd146101a35780632ff2e9dc146101cb578063313ce567146101de578063661884631461020757806370a082311461022957806395d89b4114610248578063a9059cbb1461025b578063d73dd6231461027d578063dd62ed3e1461029f575b600080fd5b34156100c957600080fd5b6100d16102c4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010d5780820151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015357600080fd5b61016a600160a060020a03600435166024356102fb565b604051901515815260200160405180910390f35b341561018957600080fd5b610191610367565b60405190815260200160405180910390f35b34156101ae57600080fd5b61016a600160a060020a036004358116906024351660443561036d565b34156101d657600080fd5b6101916104ed565b34156101e957600080fd5b6101f16104fb565b60405160ff909116815260200160405180910390f35b341561021257600080fd5b61016a600160a060020a0360043516602435610500565b341561023457600080fd5b610191600160a060020a03600435166105fa565b341561025357600080fd5b6100d1610615565b341561026657600080fd5b61016a600160a060020a036004351660243561064c565b341561028857600080fd5b61016a600160a060020a036004351660243561075e565b34156102aa57600080fd5b610191600160a060020a0360043581169060243516610802565b60408051908101604052600e81527f54657374546f6b656e4552433230000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561038457600080fd5b600160a060020a0384166000908152602081905260409020548211156103a957600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156103dc57600080fd5b600160a060020a038416600090815260208190526040902054610405908363ffffffff61082d16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461043a908363ffffffff61083f16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610480908363ffffffff61082d16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b69021e19e0c9bab240000081565b601281565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561055d57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610594565b61056d818463ffffffff61082d16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051908101604052600381527f5432300000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561066357600080fd5b600160a060020a03331660009081526020819052604090205482111561068857600080fd5b600160a060020a0333166000908152602081905260409020546106b1908363ffffffff61082d16565b600160a060020a0333811660009081526020819052604080822093909355908516815220546106e6908363ffffffff61083f16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610796908363ffffffff61083f16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561083957fe5b50900390565b60008282018381101561084e57fe5b93925050505600a165627a7a7230582070b19ec88fc92d60fb434fe6db387496906bf01f6a44eee0ab0862c36086e4370029
|
{"success": true, "error": null, "results": {}}
| 2,322 |
0xCd83BC79BdE7aB92b21fBb23b6EAF99aAF55f18c
|
pragma solidity ^0.5.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
//_transferOwnership(newOwner);
_pendingowner = newOwner;
emit OwnershipTransferPending(_owner, newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private _pendingowner;
event OwnershipTransferPending(address indexed previousOwner, address indexed newOwner);
function pendingowner() public view returns (address) {
return _pendingowner;
}
modifier onlyPendingOwner() {
require(msg.sender == _pendingowner, "Ownable: caller is not the pending owner");
_;
}
function claimOwnership() public onlyPendingOwner {
_transferOwnership(msg.sender);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused, "Pausable: not paused");
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract ERC20Token is IERC20, Pausable {
using SafeMath for uint256;
using Address for address;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256 balance) {
return _balances[account];
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address recipient, uint256 amount)
public
whenNotPaused
returns (bool success)
{
_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
whenNotPaused
returns (bool)
{
_approve(msg.sender, spender, value);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount)
public
whenNotPaused
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
whenNotPaused
returns (bool)
{
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
whenNotPaused
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 _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 mint(address account,uint256 amount) public onlyOwner returns (bool) {
// _mint(account, amount);
// return true;
// }
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function burn(address account,uint256 amount) public onlyOwner returns (bool) {
_burn(account, amount);
return true;
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn to the zero address");
_balances[account] = _balances[account].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
}
contract BITHEAVEN is ERC20Token {
constructor() public
ERC20Token("BITHEAVEN", "BTHV", 18, 10000000000 * (10 ** 18)) {
}
mapping (address => uint256) internal _locked_balances;
event TokenLocked(address indexed owner, uint256 value);
event TokenUnlocked(address indexed beneficiary, uint256 value);
function balanceOfLocked(address account) public view returns (uint256 balance)
{
return _locked_balances[account];
}
function lockToken(address[] memory addresses, uint256[] memory amounts)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: address is empty");
require(addresses.length == amounts.length, "LockToken: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_lock_token(addresses[i], amounts[i]);
}
return true;
}
function lockTokenWhole(address[] memory addresses)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: address is empty");
for (uint i = 0; i < addresses.length; i++) {
_lock_token(addresses[i], _balances[addresses[i]]);
}
return true;
}
function unlockToken(address[] memory addresses, uint256[] memory amounts)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: unlock address is empty");
require(addresses.length == amounts.length, "LockToken: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_unlock_token(addresses[i], amounts[i]);
}
return true;
}
function _lock_token(address owner, uint256 amount) internal {
require(owner != address(0), "LockToken: lock from the zero address");
require(amount > 0, "LockToken: the amount is empty");
_balances[owner] = _balances[owner].sub(amount);
_locked_balances[owner] = _locked_balances[owner].add(amount);
emit TokenLocked(owner, amount);
}
function _unlock_token(address owner, uint256 amount) internal {
require(owner != address(0), "LockToken: lock from the zero address");
require(amount > 0, "LockToken: the amount is empty");
_locked_balances[owner] = _locked_balances[owner].sub(amount);
_balances[owner] = _balances[owner].add(amount);
emit TokenUnlocked(owner, amount);
}
event Collect(address indexed from, address indexed to, uint256 value);
event CollectLocked(address indexed from, address indexed to, uint256 value); //Lock이 해지 되었다.
function collectFrom(address[] memory addresses, uint256[] memory amounts, address recipient)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "Collect: collect address is empty");
require(addresses.length == amounts.length, "Collect: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_transfer(addresses[i], recipient, amounts[i]);
emit Collect(addresses[i], recipient, amounts[i]);
}
return true;
}
function collectFromLocked(address[] memory addresses, uint256[] memory amounts, address recipient)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "Collect: collect address is empty");
require(addresses.length == amounts.length, "Collect: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_unlock_token(addresses[i], amounts[i]);
_transfer(addresses[i], recipient, amounts[i]);
emit CollectLocked(addresses[i], recipient, amounts[i]);
}
return true;
}
}
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;
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806314a7a6311461026757806318160ddd146103f857806323b872dd14610423578063313ce567146104b657806339509351146104e75780633f4ba83a1461055a5780634e71e0c8146105715780635c975abb1461058857806370a08231146105b7578063715018a61461061c5780638456cb59146106335780638da5cb5b1461064a5780638f32d59b146106a157806395d89b41146106d05780639dc29fac14610760578063a457c2d7146107d3578063a9059cbb14610846578063b9bcabe9146108b9578063da4a898e14610a4a578063dd62ed3e14610aa1578063e50c652914610b26578063e960bb4814610c03578063f2cb9bea14610c68578063f2fde38b14610dd9578063f612436114610e2a575b600080fd5b34801561017057600080fd5b50610179610f9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061024d6004803603604081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b506103de6004803603606081101561028a57600080fd5b81019080803590602001906401000000008111156102a757600080fd5b8201836020820111156102b957600080fd5b803590602001918460208302840111640100000000831117156102db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d9565b604051808215151515815260200191505060405180910390f35b34801561040457600080fd5b5061040d611363565b6040518082815260200191505060405180910390f35b34801561042f57600080fd5b5061049c6004803603606081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136d565b604051808215151515815260200191505060405180910390f35b3480156104c257600080fd5b506104cb6114a3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104f357600080fd5b506105406004803603604081101561050a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114ba565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061056f6115e4565b005b34801561057d57600080fd5b5061058661172d565b005b34801561059457600080fd5b5061059d611823565b604051808215151515815260200191505060405180910390f35b3480156105c357600080fd5b50610606600480360360208110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611836565b6040518082815260200191505060405180910390f35b34801561062857600080fd5b5061063161187f565b005b34801561063f57600080fd5b506106486119ba565b005b34801561065657600080fd5b5061065f611b03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ad57600080fd5b506106b6611b2c565b604051808215151515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611b83565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561072557808201518184015260208101905061070a565b50505050905090810190601f1680156107525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076c57600080fd5b506107b96004803603604081101561078357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156107df57600080fd5b5061082c600480360360408110156107f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb7565b604051808215151515815260200191505060405180910390f35b34801561085257600080fd5b5061089f6004803603604081101561086957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de1565b604051808215151515815260200191505060405180910390f35b3480156108c557600080fd5b50610a30600480360360608110156108dc57600080fd5b81019080803590602001906401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561098d57600080fd5b82018360208201111561099f57600080fd5b803590602001918460208302840111640100000000831117156109c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7d565b604051808215151515815260200191505060405180910390f35b348015610a5657600080fd5b50610a5f61213f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aad57600080fd5b50610b1060048036036040811015610ac457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612169565b6040518082815260200191505060405180910390f35b348015610b3257600080fd5b50610be960048036036020811015610b4957600080fd5b8101908080359060200190640100000000811115610b6657600080fd5b820183602082011115610b7857600080fd5b80359060200191846020830284011164010000000083111715610b9a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506121f0565b604051808215151515815260200191505060405180910390f35b348015610c0f57600080fd5b50610c5260048036036020811015610c2657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612384565b6040518082815260200191505060405180910390f35b348015610c7457600080fd5b50610dbf60048036036040811015610c8b57600080fd5b8101908080359060200190640100000000811115610ca857600080fd5b820183602082011115610cba57600080fd5b80359060200191846020830284011164010000000083111715610cdc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610d3c57600080fd5b820183602082011115610d4e57600080fd5b80359060200191846020830284011164010000000083111715610d7057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506123cd565b604051808215151515815260200191505060405180910390f35b348015610de557600080fd5b50610e2860048036036020811015610dfc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c2565b005b348015610e3657600080fd5b50610f8160048036036040811015610e4d57600080fd5b8101908080359060200190640100000000811115610e6a57600080fd5b820183602082011115610e7c57600080fd5b80359060200191846020830284011164010000000083111715610e9e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610efe57600080fd5b820183602082011115610f1057600080fd5b80359060200191846020830284011164010000000083111715610f3257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506126fd565b604051808215151515815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110335780601f1061100857610100808354040283529160200191611033565b820191906000526020600020905b81548152906001019060200180831161101657829003601f168201915b5050505050905090565b6000600160149054906101000a900460ff161515156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6110cf3384846128cc565b6001905092915050565b60006110e3611b2c565b1515611157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600084511115156111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8251845114151561126f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b8451811015611357576112b7858281518110151561128f57fe5b906020019060200201518486848151811015156112a857fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156112dc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1314fd112a381beea61539dbd21ec04afcff2662ac7d1b83273aade1f53d1b97868481518110151561132b57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611275565b50600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161515156113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6113ff848484612b4d565b611498843361149385600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160149054906101000a900460ff16151515611541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6115da33846115d585600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b6128cc565b6001905092915050565b6115ec611b2c565b1515611660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff1615156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611818576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f4f776e61626c653a2063616c6c6572206973206e6f74207468652070656e646981526020017f6e67206f776e657200000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61182133612f8c565b565b600160149054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611887611b2c565b15156118fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6119c2611b2c565b1515611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff16151515611abb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c1b5780601f10611bf057610100808354040283529160200191611c1b565b820191906000526020600020905b815481529060010190602001808311611bfe57829003601f168201915b5050505050905090565b6000611c2f611b2c565b1515611ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611cad8383613115565b6001905092915050565b6000600160149054906101000a900460ff16151515611d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611dd73384611dd285600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b6001905092915050565b6000600160149054906101000a900460ff16151515611e68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611e73338484612b4d565b6001905092915050565b6000611e87611b2c565b1515611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008451111515611f9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82518451141515612013576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b84518110156121335761205a858281518110151561203357fe5b90602001906020020151858381518110151561204b57fe5b906020019060200201516132d4565b612093858281518110151561206b57fe5b9060200190602002015184868481518110151561208457fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156120b857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fcef2a588ab872cf14edd1b152ab54525aa85d0ccf08912fb5cdd419f0ef6d063868481518110151561210757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612019565b50600190509392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006121fa611b2c565b151561226e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600082511115156122e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b60008090505b825181101561237a5761236d838281518110151561230757fe5b9060200190602002015160066000868581518110151561232357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613593565b80806001019150506122ed565b5060019050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006123d7611b2c565b151561244b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4c6f636b546f6b656e3a20756e6c6f636b206164647265737320697320656d7081526020017f747900000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156125b7576125aa848281518110151561258357fe5b90602001906020020151848381518110151561259b57fe5b906020019060200201516132d4565b8080600101915050612569565b506001905092915050565b6125ca611b2c565b151561263e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8573d4aae9f7fb051c6b88d7440011a1c12376acda6603a45f45bad36a8db4ce60405160405180910390a350565b6000612707611b2c565b151561277b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156127f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b8151835114151561286d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156128c1576128b4848281518110151561288d57fe5b9060200190602002015184838151811015156128a557fe5b90602001906020020151613593565b8080600101915050612873565b506001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612997576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612c18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612d3581600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dca81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515612ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110151515612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613057576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156131ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206275726e20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61320c81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326481600554612e7790919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561339f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600081111515613417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61346981600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134fe81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3826040518082815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561365e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000811115156136d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61372881600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137bd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167ff9626bca62c59d77fa45a204dc096874ee066a5c5e124aa9ce6c438dbdf7387a826040518082815260200191505060405180910390a2505056fea165627a7a72305820efd1cb58dd15d5c602de6a1672b0ea01e8dbd1b6bdef8e147d34532c42d3aadd0029
|
{"success": true, "error": null, "results": {}}
| 2,323 |
0xa2d75fdcEB750CC0fd96b3D6C10780ef1A12C58B
|
pragma solidity 0.4.21;
// 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 a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: lib/solidity-rationals/contracts/Rationals.sol
library R {
struct Rational {
uint n; // numerator
uint d; // denominator
}
}
library Rationals {
using SafeMath for uint;
function rmul(uint256 amount, R.Rational memory r) internal pure returns (uint256) {
return amount.mul(r.n).div(r.d);
}
}
// 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));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: zeppelin-solidity/contracts/ownership/rbac/Roles.sol
/**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
}
// File: zeppelin-solidity/contracts/ownership/rbac/RBAC.sol
/**
* @title RBAC (Role-Based Access Control)
* @author Matt Condon (@Shrugs)
* @dev Stores and provides setters and getters for roles and addresses.
* @dev Supports unlimited numbers of roles and addresses.
* @dev See //contracts/mocks/RBACMock.sol for an example of usage.
* This RBAC method uses strings to key roles. It may be beneficial
* for you to write your own implementation of this interface using Enums or similar.
* It's also recommended that you define constants in the contract, like ROLE_ADMIN below,
* to avoid typos.
*/
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
roles[roleName].check(addr);
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
return roles[roleName].has(addr);
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
roles[roleName].add(addr);
emit RoleAdded(addr, roleName);
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
roles[roleName].remove(addr);
emit RoleRemoved(addr, roleName);
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
checkRole(msg.sender, roleName);
_;
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
// File: 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/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/Exchange.sol
/**
* @title Atomic exchange to facilitate swaps from ETH or DAI to a token.
* Users an oracle bot to update market prices.
*/
contract Exchange is Pausable, RBAC {
using SafeMath for uint256;
string constant ROLE_ORACLE = "oracle";
ERC20 baseToken;
ERC20 dai; // 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359
address public oracle;
R.Rational public ethRate;
R.Rational public daiRate;
event TradeETH(uint256 amountETH, uint256 amountBaseToken);
event TradeDAI(uint256 amountDAI, uint256 amountBaseToken);
event RateUpdatedETH(uint256 n, uint256 d);
event RateUpdatedDAI(uint256 n, uint256 d);
event OracleSet(address oracle);
/**
* Constructor for exchange.
*
* @param _baseToken Address of the token to exchange for
* @param _dai Address of DAI token
* @param _oracle Address of oracle tasked with periodically setting market rates
* @param _ethRateN Numerator of the ETH to token exchange rate
* @param _ethRateD Denominator of the ETH to token exchange rate
* @param _daiRateN Numerator of the DAI to token exchange rate
* @param _daiRateD Denominator of the DAI to token exchange rate
*/
function Exchange(
address _baseToken,
address _dai,
address _oracle,
uint256 _ethRateN,
uint256 _ethRateD,
uint256 _daiRateN,
uint256 _daiRateD
) public {
baseToken = ERC20(_baseToken);
dai = ERC20(_dai);
addRole(_oracle, ROLE_ORACLE);
oracle = _oracle;
ethRate = R.Rational(_ethRateN, _ethRateD);
daiRate = R.Rational(_daiRateN, _daiRateD);
}
/**
* Trades ETH for tokens at ethRate.
*
* @param expectedAmountBaseToken Amount of tokens expected to receive.
* This prevents front-running race conditions from occurring when ethRate
* is updated.
*/
function tradeETH(uint256 expectedAmountBaseToken) public whenNotPaused() payable {
uint256 amountBaseToken = calculateAmountForETH(msg.value);
require(amountBaseToken == expectedAmountBaseToken);
require(baseToken.transfer(msg.sender, amountBaseToken));
emit TradeETH(msg.value, amountBaseToken);
}
/**
* Trades DAI for tokens at daiRate. User must first approve DAI to be
* transferred by Exchange.
*
* @param amountDAI Amount of DAI to exchange
* @param expectedAmountBaseToken Amount of tokens expected to receive.
* This prevents front-running race conditions from occurring when daiRate
* is updated.
*/
function tradeDAI(uint256 amountDAI, uint256 expectedAmountBaseToken) public whenNotPaused() {
uint256 amountBaseToken = calculateAmountForDAI(amountDAI);
require(amountBaseToken == expectedAmountBaseToken);
require(dai.transferFrom(msg.sender, address(this), amountDAI));
require(baseToken.transfer(msg.sender, amountBaseToken));
emit TradeDAI(amountDAI, amountBaseToken);
}
/**
* Calculates exchange amount for ETH to token.
*
* @param amountETH Amount of ETH, in base units
*/
function calculateAmountForETH(uint256 amountETH) public view returns (uint256) {
return Rationals.rmul(amountETH, ethRate);
}
/**
* Calculates exchange amount for DAI to token.
*
* @param amountDAI Amount of DAI, in base units
*/
function calculateAmountForDAI(uint256 amountDAI) public view returns (uint256) {
return Rationals.rmul(amountDAI, daiRate);
}
/**
* Sets the exchange rate from ETH to token.
*
* @param n Numerator for ethRate
* @param d Denominator for ethRate
*/
function setETHRate(uint256 n, uint256 d) external onlyRole(ROLE_ORACLE) {
ethRate = R.Rational(n, d);
emit RateUpdatedETH(n, d);
}
/**
* Sets the exchange rate from ETH to token.
*
* @param n Numerator for daiRate
* @param d Denominator for daiRate
*/
function setDAIRate(uint256 n, uint256 d) external onlyRole(ROLE_ORACLE) {
daiRate = R.Rational(n, d);
emit RateUpdatedDAI(n, d);
}
/**
* Recovers DAI, leftover tokens, or other.
*
* @param token Address of token to withdraw
* @param amount Amount of tokens to withdraw
*/
function withdrawERC20s(address token, uint256 amount) external onlyOwner {
ERC20 erc20 = ERC20(token);
require(erc20.transfer(owner, amount));
}
/**
* Changes the oracle.
*
* @param _oracle Address of new oracle
*/
function setOracle(address _oracle) external onlyOwner {
removeRole(oracle, ROLE_ORACLE);
addRole(_oracle, ROLE_ORACLE);
oracle = _oracle;
emit OracleSet(_oracle);
}
/// @notice Owner: Withdraw Ether
function withdrawEther() external onlyOwner {
owner.transfer(address(this).balance);
}
}
|
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630988ca8c1461010c578063217fe6c61461018857806322c69b151461021c5780632f5e8d29146102485780633f4ba83a1461027457806340698729146102895780635c975abb146102cb5780637362377b146102f85780637adbf9731461030d5780637dc0d1d0146103465780638456cb591461039b5780638da5cb5b146103b057806396a7016914610405578063cbfebb341461041d578063d2d93f9014610449578063d9c522ec14610479578063dc01bd0c146104a9578063f1daa5ba146104e0578063f2fde38b14610517575b600080fd5b341561011757600080fd5b610186600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610550565b005b341561019357600080fd5b610202600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506105d1565b604051808215151515815260200191505060405180910390f35b341561022757600080fd5b6102466004808035906020019091908035906020019091905050610658565b005b341561025357600080fd5b61027260048080359060200190919080359060200190919050506108d2565b005b341561027f57600080fd5b610287610984565b005b341561029457600080fd5b6102c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a42565b005b34156102d657600080fd5b6102de610b8c565b604051808215151515815260200191505060405180910390f35b341561030357600080fd5b61030b610b9f565b005b341561031857600080fd5b610344600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c74565b005b341561035157600080fd5b610359610e16565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103a657600080fd5b6103ae610e3c565b005b34156103bb57600080fd5b6103c3610efc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61041b6004808035906020019091905050610f21565b005b341561042857600080fd5b6104476004808035906020019091908035906020019091905050611080565b005b341561045457600080fd5b61045c611132565b604051808381526020018281526020019250505060405180910390f35b341561048457600080fd5b61048c611144565b604051808381526020018281526020019250505060405180910390f35b34156104b457600080fd5b6104ca6004808035906020019091905050611156565b6040518082815260200191505060405180910390f35b34156104eb57600080fd5b6105016004808035906020019091905050611189565b6040518082815260200191505060405180910390f35b341561052257600080fd5b61054e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111bc565b005b6105cd826001836040518082805190602001908083835b60208310151561058c5780518252602082019150602081019050602083039250610567565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061131190919063ffffffff16565b5050565b6000610650836001846040518082805190602001908083835b60208310151561060f57805182526020820191506020810190506020830392506105ea565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061132a90919063ffffffff16565b905092915050565b60008060149054906101000a900460ff1615151561067557600080fd5b61067e83611156565b9050818114151561068e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561078657600080fd5b5af1151561079357600080fd5b5050506040518051905015156107a857600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561086c57600080fd5b5af1151561087957600080fd5b50505060405180519050151561088e57600080fd5b7fd0a583a37173dee286f3b57524340bf9587896d56b81c76eb7cd12ea04218b238382604051808381526020018281526020019250505060405180910390a1505050565b6040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506109123382610550565b604080519081016040528084815260200183815250600760008201518160000155602082015181600101559050507f2b40d0d126883f34c1b61576947f79f3d40f65890a48b07262ea68266132eb048383604051808381526020018281526020019250505060405180910390a1505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109df57600080fd5b600060149054906101000a900460ff1615156109fa57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9f57600080fd5b8290508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610b6557600080fd5b5af11515610b7257600080fd5b505050604051805190501515610b8757600080fd5b505050565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bfa57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610c7257600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ccf57600080fd5b610d30600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040805190810160405280600681526020017f6f7261636c650000000000000000000000000000000000000000000000000000815250611383565b610d6f816040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506114d4565b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9757600080fd5b600060149054906101000a900460ff16151515610eb357600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff16151515610f3e57600080fd5b610f4734611189565b90508181141515610f5757600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561101b57600080fd5b5af1151561102857600080fd5b50505060405180519050151561103d57600080fd5b7f02cd377c7b17f4064bbd71006b4d268658743232b47801e8e721b6906e1c85e43482604051808381526020018281526020019250505060405180910390a15050565b6040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506110c03382610550565b604080519081016040528084815260200183815250600560008201518160000155602082015181600101559050507f882e765099912d83e8c2721f9496c92b1f092d9fccc41812b2c6b87bb0b72e838383604051808381526020018281526020019250505060405180910390a1505050565b60058060000154908060010154905082565b60078060000154908060010154905082565b600061118282600760408051908101604052908160008201548152602001600182015481525050611625565b9050919050565b60006111b582600560408051908101604052908160008201548152602001600182015481525050611625565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561125357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61131b828261132a565b151561132657600080fd5b5050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611400826001836040518082805190602001908083835b6020831015156113bf578051825260208201915060208101905060208303925061139a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061165c90919063ffffffff16565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561149557808201518184015260208101905061147a565b50505050905090810190601f1680156114c25780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b611551826001836040518082805190602001908083835b60208310151561151057805182526020820191506020810190506020830392506114eb565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206116ba90919063ffffffff16565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b7004898282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156115e65780820151818401526020810190506115cb565b50505050905090810190601f1680156116135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000611654826020015161164684600001518661171890919063ffffffff16565b61175390919063ffffffff16565b905092915050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080600084141561172d576000915061174c565b828402905082848281151561173e57fe5b0414151561174857fe5b8091505b5092915050565b6000818381151561176057fe5b049050929150505600a165627a7a723058203b2646a06a08de69ee5ceaf512fc26b9cc7b37c35571e2a785354c673230fd850029
|
{"success": true, "error": null, "results": {}}
| 2,324 |
0xb40d908847fee000c45e83b86b3b88e8a670afe3
|
/**
AntiSocialInu
Tax: 3% Buy - 3% Sell
Will be locked and renounced after launch
MaxBuy1%
MaxWallet2%
AntiSocial Tg: https://t.me/antisocialinu
AntiSocial Twitter: https://twitter.com/AntiSocialInu
*/
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 _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 AntiSocialInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "AntiSocialInu";
string private constant _symbol = "AntiSocialInu";
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(0xDfe0081cbEba641ba85fBd9B147bC8Ed9A2877d8);
_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 = 3;
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 = 3;
}
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(1).div(100);
_maxWalletSize = _tTotal.mul(2).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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e34565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061293b565b6104b4565b60405161018e9190612e19565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fd6565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061297b565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128e8565b61060d565b60405161021f9190612e19565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a919061284e565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b604051610273919061304b565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129c4565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a1e565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c6004803603810190610307919061284e565b6109dd565b6040516103199190612fd6565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612d4b565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612e34565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061293b565b610c9e565b6040516103da9190612e19565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a1e565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c91906128a8565b6113c9565b60405161046e9190612fd6565b60405180910390f35b60606040518060400160405280600d81526020017f416e7469536f6369616c496e7500000000000000000000000000000000000000815250905090565b60006104c86104c1611450565b8484611458565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f16565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c613393565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610601906132ec565b91505061057b565b5050565b600061061a848484611623565b6106db84610626611450565b6106d68560405180606001604052806028815260200161375260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611450565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb69092919063ffffffff16565b611458565b600190509392505050565b6106ee611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612f16565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612f16565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612f16565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611450565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611ddf565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e4b565b9050919050565b610a36611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612f16565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f416e7469536f6369616c496e7500000000000000000000000000000000000000815250905090565b6000610cb2610cab611450565b8484611623565b6001905092915050565b610cc4611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612f16565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611450565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611eb9565b50565b610e18611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612f16565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612fb6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611458565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611003919061287b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d919061287b565b6040518363ffffffff1660e01b81526004016110ba929190612d66565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c919061287b565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611195306109dd565b6000806111a0610c38565b426040518863ffffffff1660e01b81526004016111c296959493929190612db8565b6060604051808303818588803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112149190612a4b565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061127d606461126f600168056bc75e2d63100000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b600f819055506112b360646112a5600268056bc75e2d63100000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611373929190612d8f565b602060405180830381600087803b15801561138d57600080fd5b505af11580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c591906129f1565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bf90612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152f90612eb6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116169190612fd6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611693576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168a90612f56565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611703576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fa90612e56565b60405180910390fd5b60008111611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90612f36565b60405180910390fd5b6000600a819055506003600b8190555061175e610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117cc575061179c610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118755750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187e57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119295750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119975750600e60179054906101000a900460ff165b15611ad557600f548111156119e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d890612e76565b60405180910390fd5b601054816119ee846109dd565b6119f8919061310c565b1115611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3090612f76565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a8457600080fd5b601e42611a91919061310c565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b805750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bec576000600a819055506003600b819055505b6000611bf7306109dd565b9050600e60159054906101000a900460ff16158015611c645750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c7c5750600e60169054906101000a900460ff165b15611ca457611c8a81611eb9565b60004790506000811115611ca257611ca147611ddf565b5b505b505b611cb1838383612141565b505050565b6000838311158290611cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf59190612e34565b60405180910390fd5b5060008385611d0d91906131ed565b9050809150509392505050565b600080831415611d2d5760009050611d8f565b60008284611d3b9190613193565b9050828482611d4a9190613162565b14611d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8190612ef6565b60405180910390fd5b809150505b92915050565b6000611dd783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612151565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e47573d6000803e3d6000fd5b5050565b6000600854821115611e92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8990612e96565b60405180910390fd5b6000611e9c6121b4565b9050611eb18184611d9590919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef157611ef06133c2565b5b604051908082528060200260200182016040528015611f1f5781602001602082028036833780820191505090505b5090503081600081518110611f3757611f36613393565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd957600080fd5b505afa158015611fed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612011919061287b565b8160018151811061202557612024613393565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208c30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611458565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f0959493929190612ff1565b600060405180830381600087803b15801561210a57600080fd5b505af115801561211e573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61214c8383836121df565b505050565b60008083118290612198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218f9190612e34565b60405180910390fd5b50600083856121a79190613162565b9050809150509392505050565b60008060006121c16123aa565b915091506121d88183611d9590919063ffffffff16565b9250505090565b6000806000806000806121f18761240c565b95509550955095509550955061224f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123308161251c565b61233a84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123979190612fd6565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d6310000090506123e068056bc75e2d63100000600854611d9590919063ffffffff16565b8210156123ff5760085468056bc75e2d63100000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396121b4565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb6565b905092915050565b60008082846124cd919061310c565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612ed6565b60405180910390fd5b8091505092915050565b60006125266121b4565b9050600061253d8284611d1a90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611d1a90919063ffffffff16565b611d9590919063ffffffff16565b90506000612669606461265b888b611d1a90919063ffffffff16565b611d9590919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611d1a90919063ffffffff16565b905060006126d98689611d1a90919063ffffffff16565b905060006126f08789611d1a90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127456127408461308b565b613066565b90508083825260208201905082856020860282011115612768576127676133f6565b5b60005b85811015612798578161277e88826127a2565b84526020840193506020830192505060018101905061276b565b5050509392505050565b6000813590506127b18161370c565b92915050565b6000815190506127c68161370c565b92915050565b600082601f8301126127e1576127e06133f1565b5b81356127f1848260208601612732565b91505092915050565b60008135905061280981613723565b92915050565b60008151905061281e81613723565b92915050565b6000813590506128338161373a565b92915050565b6000815190506128488161373a565b92915050565b60006020828403121561286457612863613400565b5b6000612872848285016127a2565b91505092915050565b60006020828403121561289157612890613400565b5b600061289f848285016127b7565b91505092915050565b600080604083850312156128bf576128be613400565b5b60006128cd858286016127a2565b92505060206128de858286016127a2565b9150509250929050565b60008060006060848603121561290157612900613400565b5b600061290f868287016127a2565b9350506020612920868287016127a2565b925050604061293186828701612824565b9150509250925092565b6000806040838503121561295257612951613400565b5b6000612960858286016127a2565b925050602061297185828601612824565b9150509250929050565b60006020828403121561299157612990613400565b5b600082013567ffffffffffffffff8111156129af576129ae6133fb565b5b6129bb848285016127cc565b91505092915050565b6000602082840312156129da576129d9613400565b5b60006129e8848285016127fa565b91505092915050565b600060208284031215612a0757612a06613400565b5b6000612a158482850161280f565b91505092915050565b600060208284031215612a3457612a33613400565b5b6000612a4284828501612824565b91505092915050565b600080600060608486031215612a6457612a63613400565b5b6000612a7286828701612839565b9350506020612a8386828701612839565b9250506040612a9486828701612839565b9150509250925092565b6000612aaa8383612ab6565b60208301905092915050565b612abf81613221565b82525050565b612ace81613221565b82525050565b6000612adf826130c7565b612ae981856130ea565b9350612af4836130b7565b8060005b83811015612b25578151612b0c8882612a9e565b9750612b17836130dd565b925050600181019050612af8565b5085935050505092915050565b612b3b81613233565b82525050565b612b4a81613276565b82525050565b6000612b5b826130d2565b612b6581856130fb565b9350612b75818560208601613288565b612b7e81613405565b840191505092915050565b6000612b966023836130fb565b9150612ba182613416565b604082019050919050565b6000612bb96019836130fb565b9150612bc482613465565b602082019050919050565b6000612bdc602a836130fb565b9150612be78261348e565b604082019050919050565b6000612bff6022836130fb565b9150612c0a826134dd565b604082019050919050565b6000612c22601b836130fb565b9150612c2d8261352c565b602082019050919050565b6000612c456021836130fb565b9150612c5082613555565b604082019050919050565b6000612c686020836130fb565b9150612c73826135a4565b602082019050919050565b6000612c8b6029836130fb565b9150612c96826135cd565b604082019050919050565b6000612cae6025836130fb565b9150612cb98261361c565b604082019050919050565b6000612cd1601a836130fb565b9150612cdc8261366b565b602082019050919050565b6000612cf46024836130fb565b9150612cff82613694565b604082019050919050565b6000612d176017836130fb565b9150612d22826136e3565b602082019050919050565b612d368161325f565b82525050565b612d4581613269565b82525050565b6000602082019050612d606000830184612ac5565b92915050565b6000604082019050612d7b6000830185612ac5565b612d886020830184612ac5565b9392505050565b6000604082019050612da46000830185612ac5565b612db16020830184612d2d565b9392505050565b600060c082019050612dcd6000830189612ac5565b612dda6020830188612d2d565b612de76040830187612b41565b612df46060830186612b41565b612e016080830185612ac5565b612e0e60a0830184612d2d565b979650505050505050565b6000602082019050612e2e6000830184612b32565b92915050565b60006020820190508181036000830152612e4e8184612b50565b905092915050565b60006020820190508181036000830152612e6f81612b89565b9050919050565b60006020820190508181036000830152612e8f81612bac565b9050919050565b60006020820190508181036000830152612eaf81612bcf565b9050919050565b60006020820190508181036000830152612ecf81612bf2565b9050919050565b60006020820190508181036000830152612eef81612c15565b9050919050565b60006020820190508181036000830152612f0f81612c38565b9050919050565b60006020820190508181036000830152612f2f81612c5b565b9050919050565b60006020820190508181036000830152612f4f81612c7e565b9050919050565b60006020820190508181036000830152612f6f81612ca1565b9050919050565b60006020820190508181036000830152612f8f81612cc4565b9050919050565b60006020820190508181036000830152612faf81612ce7565b9050919050565b60006020820190508181036000830152612fcf81612d0a565b9050919050565b6000602082019050612feb6000830184612d2d565b92915050565b600060a0820190506130066000830188612d2d565b6130136020830187612b41565b81810360408301526130258186612ad4565b90506130346060830185612ac5565b6130416080830184612d2d565b9695505050505050565b60006020820190506130606000830184612d3c565b92915050565b6000613070613081565b905061307c82826132bb565b919050565b6000604051905090565b600067ffffffffffffffff8211156130a6576130a56133c2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131178261325f565b91506131228361325f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561315757613156613335565b5b828201905092915050565b600061316d8261325f565b91506131788361325f565b92508261318857613187613364565b5b828204905092915050565b600061319e8261325f565b91506131a98361325f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e2576131e1613335565b5b828202905092915050565b60006131f88261325f565b91506132038361325f565b92508282101561321657613215613335565b5b828203905092915050565b600061322c8261323f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132818261325f565b9050919050565b60005b838110156132a657808201518184015260208101905061328b565b838111156132b5576000848401525b50505050565b6132c482613405565b810181811067ffffffffffffffff821117156132e3576132e26133c2565b5b80604052505050565b60006132f78261325f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561332a57613329613335565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61371581613221565b811461372057600080fd5b50565b61372c81613233565b811461373757600080fd5b50565b6137438161325f565b811461374e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201cb4ba28f413199a6873800427333bb380231f8e5694ca5b5e0c8c6b2db1aae464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,325 |
0xea0b7a5dba20ad8621d3f7ddb51d6a100ce3324f
|
// Telegram : t.me/SesshomaruInu
// 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 SesshomaruInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sesshomaru Inu";
string private constant _symbol = " SSMINU ";
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 3;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 5);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600e81526020017f53657373686f6d61727520496e75000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2053534d494e5520000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca8368056bc75e2d6310000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b60016008819055506003600981905550565b60008060006006549050600068056bc75e2d63100000905061242f68056bc75e2d631000006006546120e690919063ffffffff16565b82101561244e5760065468056bc75e2d63100000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a6008546005612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d97b3e13e59de8d653ce744aa753cafcb5c5ab71ff77063b7a7139d78923ee6264736f6c63430008040033
|
{"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"}]}}
| 2,326 |
0x0196aa23c1da3d8e3759fd2326d339ba1390b562
|
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
string public note;
uint8 public decimals;
constructor(string _name, string _symbol, string _note, uint8 _decimals) public {
name = _name;
symbol = _symbol;
note = _note;
decimals = _decimals;
}
}
contract Ownable {
address public owner;
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyOwnerOrAdmin() {
require(msg.sender != address(0) && (msg.sender == owner || msg.sender == admin));
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
require(newOwner != owner);
require(newOwner != admin);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setAdmin(address newAdmin) onlyOwner public {
require(admin != newAdmin);
require(owner != newAdmin);
admin = newAdmin;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 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); // overflow check
return c;
}
}
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 > 0);
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20Token is BasicToken, ERC20 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) allowed;
function approve(address _spender, uint256 _value) public returns (bool) {
require(_value == 0 || allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract BurnableToken is BasicToken, Ownable {
string internal constant INVALID_TOKEN_VALUES = 'Invalid token values';
string internal constant NOT_ENOUGH_TOKENS = 'Not enough tokens';
// events
event Burn(address indexed burner, uint256 amount);
event AddressBurn(address burner, uint256 amount);
// reduce sender balance and Token total supply
function burn(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
// reduce address balance and Token total supply
function addressburn(address _of, uint256 _value) onlyOwner public {
require(_value > 0, INVALID_TOKEN_VALUES);
require(_value <= balances[_of], NOT_ENOUGH_TOKENS);
balances[_of] = balances[_of].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit AddressBurn(_of, _value);
emit Transfer(_of, address(0), _value);
}
}
contract TokenLock is Ownable {
using SafeMath for uint256;
bool public transferEnabled = false; // indicates that token is transferable or not
bool public noTokenLocked = false; // indicates all token is released or not
struct TokenLockInfo { // token of `amount` cannot be moved before `time`
uint256 amount; // locked amount
uint256 time; // unix timestamp
}
struct TokenLockState {
uint256 latestReleaseTime;
TokenLockInfo[] tokenLocks; // multiple token locks can exist
}
mapping(address => TokenLockState) lockingStates;
mapping(address => bool) addresslock;
mapping(address => uint256) lockbalances;
event AddTokenLockDate(address indexed to, uint256 time, uint256 amount);
event AddTokenLock(address indexed to, uint256 amount);
event AddressLockTransfer(address indexed to, bool _enable);
function unlockAllTokens() public onlyOwner {
noTokenLocked = true;
}
function enableTransfer(bool _enable) public onlyOwner {
transferEnabled = _enable;
}
// calculate the amount of tokens an address can use
function getMinLockedAmount(address _addr) view public returns (uint256 locked) {
uint256 i;
uint256 a;
uint256 t;
uint256 lockSum = 0;
// if the address has no limitations just return 0
TokenLockState storage lockState = lockingStates[_addr];
if (lockState.latestReleaseTime < now) {
return 0;
}
for (i=0; i<lockState.tokenLocks.length; i++) {
a = lockState.tokenLocks[i].amount;
t = lockState.tokenLocks[i].time;
if (t > now) {
lockSum = lockSum.add(a);
}
}
return lockSum;
}
function lockVolumeAddress(address _sender) view public returns (uint256 locked) {
return lockbalances[_sender];
}
function addTokenLockDate(address _addr, uint256 _value, uint256 _release_time) onlyOwnerOrAdmin public {
require(_addr != address(0));
require(_value > 0);
require(_release_time > now);
TokenLockState storage lockState = lockingStates[_addr]; // assigns a pointer. change the member value will update struct itself.
if (_release_time > lockState.latestReleaseTime) {
lockState.latestReleaseTime = _release_time;
}
lockState.tokenLocks.push(TokenLockInfo(_value, _release_time));
emit AddTokenLockDate(_addr, _release_time, _value);
}
function addTokenLock(address _addr, uint256 _value) onlyOwnerOrAdmin public {
require(_addr != address(0));
require(_value >= 0);
lockbalances[_addr] = _value;
emit AddTokenLock(_addr, _value);
}
function addressLockTransfer(address _addr, bool _enable) public onlyOwner {
require(_addr != address(0));
addresslock[_addr] = _enable;
emit AddressLockTransfer(_addr, _enable);
}
}
contract DTR is BurnableToken, DetailedERC20, ERC20Token, TokenLock {
using SafeMath for uint256;
// events
event Approval(address indexed owner, address indexed spender, uint256 value);
string public constant symbol = "DTR";
string public constant name = "DOTORI";
string public constant note = "Cyworld";
uint8 public constant decimals = 18;
uint256 constant TOTAL_SUPPLY = 10000000000 *(10**uint256(decimals));
constructor() DetailedERC20(name, symbol, note, decimals) public {
_totalSupply = TOTAL_SUPPLY;
// initial supply belongs to owner
balances[owner] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}
// modifiers
// checks if the address can transfer tokens
modifier canTransfer(address _sender, uint256 _value) {
require(_sender != address(0));
require(
(_sender == owner || _sender == admin) || (
transferEnabled && (
noTokenLocked ||
(!addresslock[_sender] && canTransferIfLocked(_sender, _value) && canTransferIfLocked(_sender, _value))
)
)
);
_;
}
function setAdmin(address newAdmin) onlyOwner public {
address oldAdmin = admin;
super.setAdmin(newAdmin);
approve(oldAdmin, 0);
approve(newAdmin, TOTAL_SUPPLY);
}
modifier onlyValidDestination(address to) {
require(to != address(0x0));
require(to != address(this));
//require(to != owner);
_;
}
function canTransferIfLocked(address _sender, uint256 _value) public view returns(bool) {
uint256 after_math = balances[_sender].sub(_value);
return after_math >= (getMinLockedAmount(_sender) + lockVolumeAddress(_sender));
}
function LockTransferAddress(address _sender) public view returns(bool) {
return addresslock[_sender];
}
// override function using canTransfer on the sender address
function transfer(address _to, uint256 _value) onlyValidDestination(_to) canTransfer(msg.sender, _value) public returns (bool success) {
return super.transfer(_to, _value);
}
// transfer tokens from one address to another
function transferFrom(address _from, address _to, uint256 _value) onlyValidDestination(_to) canTransfer(_from, _value) public returns (bool success) {
// 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); // this will throw if we don't have enough allowance
// this event comes from BasicToken.sol
emit Transfer(_from, _to, _value);
return true;
}
function() public payable { // don't send eth directly to token contract
revert();
}
}
|
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610179578063095ea7b31461020357806318160ddd1461023b5780631eee6a8d146102625780632292952c1461028b57806323b872dd146102ac57806326d111f5146102d657806329ba3177146102eb5780632a7806e41461030f578063313ce5671461032457806342966c681461034f5780634cd412d5146103675780635e0be6071461037c5780636618846314610391578063704b6c02146103b557806370a08231146103d657806374ad74e9146103f757806375d7e8ea146104185780637784f2c71461043c5780638da5cb5b1461046257806395d89b4114610493578063a802a2f4146104a8578063a9059cbb146104c9578063d73dd623146104ed578063dd62ed3e14610511578063eb20ca4114610538578063ef7ac0e51461055c578063f2fde38b14610576578063f851a44014610597575b600080fd5b34801561018557600080fd5b5061018e6105ac565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c85781810151838201526020016101b0565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020f57600080fd5b50610227600160a060020a03600435166024356105e3565b604080519115158252519081900360200190f35b34801561024757600080fd5b50610250610685565b60408051918252519081900360200190f35b34801561026e57600080fd5b50610289600160a060020a036004351660243560443561068b565b005b34801561029757600080fd5b50610250600160a060020a036004351661079d565b3480156102b857600080fd5b50610227600160a060020a03600435811690602435166044356107b8565b3480156102e257600080fd5b5061018e610990565b3480156102f757600080fd5b50610289600160a060020a03600435166024356109c7565b34801561031b57600080fd5b50610227610c41565b34801561033057600080fd5b50610339610c4f565b6040805160ff9092168252519081900360200190f35b34801561035b57600080fd5b50610289600435610c54565b34801561037357600080fd5b50610227610d10565b34801561038857600080fd5b50610289610d19565b34801561039d57600080fd5b50610227600160a060020a0360043516602435610d41565b3480156103c157600080fd5b50610289600160a060020a0360043516610e30565b3480156103e257600080fd5b50610250600160a060020a0360043516610e87565b34801561040357600080fd5b50610250600160a060020a0360043516610ea2565b34801561042457600080fd5b50610227600160a060020a0360043516602435610f62565b34801561044857600080fd5b50610289600160a060020a03600435166024351515610fab565b34801561046e57600080fd5b50610477611037565b60408051600160a060020a039092168252519081900360200190f35b34801561049f57600080fd5b5061018e611046565b3480156104b457600080fd5b50610227600160a060020a036004351661107d565b3480156104d557600080fd5b50610227600160a060020a036004351660243561109b565b3480156104f957600080fd5b50610227600160a060020a0360043516602435611182565b34801561051d57600080fd5b50610250600160a060020a036004358116906024351661121b565b34801561054457600080fd5b50610289600160a060020a0360043516602435611246565b34801561056857600080fd5b5061028960043515156112f5565b34801561058257600080fd5b50610289600160a060020a036004351661131f565b3480156105a357600080fd5b506104776113ea565b60408051808201909152600681527f444f544f52490000000000000000000000000000000000000000000000000000602082015281565b60008115806106135750336000908152600860209081526040808320600160a060020a0387168452909152902054155b151561061e57600080fd5b336000818152600860209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b600033158015906106ba5750600254600160a060020a03163314806106ba5750600354600160a060020a031633145b15156106c557600080fd5b600160a060020a03841615156106da57600080fd5b600083116106e757600080fd5b4282116106f357600080fd5b50600160a060020a0383166000908152600a602052604090208054821115610719578181555b604080518082018252848152602080820185815260018086018054808301825560009182529084902094516002909102909401938455905192019190915581518481529081018590528151600160a060020a038716927fdbb3979b78c94a13fcfc98491a14180b56267350de06698a75ba88fa114f315c928290030190a250505050565b600160a060020a03166000908152600c602052604090205490565b600082600160a060020a03811615156107d057600080fd5b600160a060020a0381163014156107e657600080fd5b8483600160a060020a03821615156107fd57600080fd5b600254600160a060020a03838116911614806108265750600354600160a060020a038381169116145b80610889575060095460ff1680156108895750600954610100900460ff16806108895750600160a060020a0382166000908152600b602052604090205460ff1615801561087857506108788282610f62565b801561088957506108898282610f62565b151561089457600080fd5b600160a060020a0387166000908152602081905260409020546108bd908663ffffffff6113f916565b600160a060020a0380891660009081526020819052604080822093909355908816815220546108f2908663ffffffff61140b16565b600160a060020a0380881660009081526020818152604080832094909455918a168152600882528281203382529091522054610934908663ffffffff6113f916565b600160a060020a0380891660008181526008602090815260408083203384528252918290209490945580518981529051928a1693919260008051602061157a833981519152929181900390910190a35060019695505050505050565b60408051808201909152600781527f4379776f726c6400000000000000000000000000000000000000000000000000602082015281565b600254600160a060020a031633146109de57600080fd5b60408051808201909152601481527f496e76616c696420746f6b656e2076616c756573000000000000000000000000602082015260008211610ab8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a7d578181015183820152602001610a65565b50505050905090810190601f168015610aaa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600160a060020a03821660009081526020818152604091829020548251808401909352601183527f4e6f7420656e6f75676820746f6b656e7300000000000000000000000000000091830191909152821115610b71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252838181518152602001915080519060200190808383600083811015610a7d578181015183820152602001610a65565b50600160a060020a038216600090815260208190526040902054610b9b908263ffffffff6113f916565b600160a060020a038316600090815260208190526040902055600154610bc7908263ffffffff6113f916565b60015560408051600160a060020a03841681526020810183905281517f549fe1c7b7237a3f61e4860f69519c5d76c20fb3cb213bf84ba242f2d4e63101929181900390910190a1604080518281529051600091600160a060020a0385169160008051602061157a8339815191529181900360200190a35050565b600954610100900460ff1681565b601281565b600254600160a060020a03163314610c6b57600080fd5b33600090815260208190526040902054610c8b908263ffffffff6113f916565b33600090815260208190526040902055600154610cae908263ffffffff6113f916565b60015560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091339160008051602061157a8339815191529181900360200190a350565b60095460ff1681565b600254600160a060020a03163314610d3057600080fd5b6009805461ff001916610100179055565b336000908152600860209081526040808320600160a060020a0386168452909152812054808310610d9557336000908152600860209081526040808320600160a060020a0388168452909152812055610dca565b610da5818463ffffffff6113f916565b336000908152600860209081526040808320600160a060020a03891684529091529020555b336000818152600860209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600254600090600160a060020a03163314610e4a57600080fd5b50600354600160a060020a0316610e6082611421565b610e6b8160006105e3565b50610e82826b204fce5e3e250261100000006105e3565b505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a0381166000908152600a6020526040812080548291829182918291421115610ed45760009550610f58565b600094505b6001810154851015610f545760018101805486908110610ef557fe5b90600052602060002090600202016000015493508060010185815481101515610f1a57fe5b906000526020600020906002020160010154925042831115610f4957610f46828563ffffffff61140b16565b91505b600190940193610ed9565b8195505b5050505050919050565b600160a060020a0382166000908152602081905260408120548190610f8d908463ffffffff6113f916565b9050610f988461079d565b610fa185610ea2565b0111159392505050565b600254600160a060020a03163314610fc257600080fd5b600160a060020a0382161515610fd757600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff1916851515908117909155825190815291517f6dd5a7941ee5159148c1fc57fc90e228da8894ad0402921937808ff3387cecc49281900390910190a25050565b600254600160a060020a031681565b60408051808201909152600381527f4454520000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03166000908152600b602052604090205460ff1690565b600082600160a060020a03811615156110b357600080fd5b600160a060020a0381163014156110c957600080fd5b33838115156110d757600080fd5b600254600160a060020a03838116911614806111005750600354600160a060020a038381169116145b80611163575060095460ff1680156111635750600954610100900460ff16806111635750600160a060020a0382166000908152600b602052604090205460ff1615801561115257506111528282610f62565b801561116357506111638282610f62565b151561116e57600080fd5b611178868661149d565b9695505050505050565b336000908152600860209081526040808320600160a060020a03861684529091528120546111b6908363ffffffff61140b16565b336000818152600860209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b33158015906112735750600254600160a060020a03163314806112735750600354600160a060020a031633145b151561127e57600080fd5b600160a060020a038216151561129357600080fd5b60008110156112a157600080fd5b600160a060020a0382166000818152600c6020908152604091829020849055815184815291517f9fdfba1cadc85a4f86fec37bf6eb2bda0beeeee783af62de3c2c59ddbf889d339281900390910190a25050565b600254600160a060020a0316331461130c57600080fd5b6009805460ff1916911515919091179055565b600254600160a060020a0316331461133657600080fd5b600160a060020a038116151561134b57600080fd5b600254600160a060020a038281169116141561136657600080fd5b600354600160a060020a038281169116141561138157600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600160a060020a031681565b60008282111561140557fe5b50900390565b60008282018381101561141a57fe5b9392505050565b600254600160a060020a0316331461143857600080fd5b600354600160a060020a038281169116141561145357600080fd5b600254600160a060020a038281169116141561146e57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a03831615156114b457600080fd5b600082116114c157600080fd5b336000908152602081905260409020548211156114dd57600080fd5b336000908152602081905260409020546114fd908363ffffffff6113f916565b3360009081526020819052604080822092909255600160a060020a0385168152205461152f908363ffffffff61140b16565b600160a060020a0384166000818152602081815260409182902093909355805185815290519192339260008051602061157a8339815191529281900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582060661ccc7df798f47243926499d02335eb7b5c3cca3301b1fcd22f28b87a807e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 2,327 |
0x41f4cBc901Af8Fc4db0667f938ef3F21EAED1e15
|
/**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
pragma solidity ^0.4.18;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event PausePublic(bool newState);
event PauseOwnerAdmin(bool newState);
bool public pausedPublic = true;
bool public pausedOwnerAdmin = false;
address public admin;
/**
* @dev Modifier to make a function callable based on pause states.
*/
modifier whenNotPaused() {
if(pausedPublic) {
if(!pausedOwnerAdmin) {
require(msg.sender == admin || msg.sender == owner);
} else {
revert();
}
}
_;
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
require(!(newPausedPublic == false && newPausedOwnerAdmin == true));
pausedPublic = newPausedPublic;
pausedOwnerAdmin = newPausedOwnerAdmin;
PausePublic(newPausedPublic);
PauseOwnerAdmin(newPausedOwnerAdmin);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract FlagToken is PausableToken {
string public constant name = "FlagToken";
string public constant symbol = "FLAG";
uint8 public constant decimals = 10;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
function FlagToken( address _admin, uint _totalTokenAmount )
{
// assign the admin account
admin = _admin;
// assign the total tokens to zilliqa
totalSupply = 37000000 * 10**10;
balances[msg.sender] = 37000000 * 10**10;
Transfer(address(0x0), msg.sender, 37000000 * 10**10);
}
function transfer(address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
function changeAdmin(address newAdmin) onlyOwner {
// owner can re-assign the admin
AdminTransferred(admin, newAdmin);
admin = newAdmin;
}
}
|
0x606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610085578063a9059cbb146100d2575b600080fd5b341561006757600080fd5b61006f61012c565b6040518082815260200191505060405180910390f35b341561009057600080fd5b6100bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610132565b6040518082815260200191505060405180910390f35b34156100dd57600080fd5b610112600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061017b565b604051808215151515815260200191505060405180910390f35b60005481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101b857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561020657600080fd5b61025882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461039f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506102ed82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103ad57fe5b818303905092915050565b60008082840190508381101515156103cc57fe5b80915050929150505600a165627a7a723058204f0e49f97287202db3012661a793c737f3e09c0e78a6ba97ed8e66367e10dd8c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 2,328 |
0x5572685c9bb58a41b394ab4634350a89012a2799
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported");
VAPEAddress = _tokenAddr;
LPTokenAddress = _liquidityAddr;
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
farmingFeeRate = _farmingFeeRate;
unfarmingFeeRate = _unfarmingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
ToBeFarmedTokens = _poolreward;
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
PossibleUnfarmTime = _possibleUnfarmTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowFarming(bool _status) public onlyOwner returns(bool){
require(VAPEAddress != address(0) && LPTokenAddress != address(0), "Interracting token addresses are not yet configured");
farmingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == VAPEAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(VAPEAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function farm(uint amountToFarm) public {
require(farmingStatus == true, "Staking is not yet initialized");
require(amountToFarm > 0, "Cannot deposit 0 Tokens");
require(Token(LPTokenAddress).transferFrom(msg.sender, address(this), amountToFarm), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToFarm.mul(farmingFeeRate).div(1e4);
uint amountAfterFee = amountToFarm.sub(fee);
require(Token(LPTokenAddress).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
farmingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(farmingTime[msg.sender]) > PossibleUnfarmTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unfarmingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPTokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(LPTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimRewards() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= ToBeFarmedTokens) {
return 0;
}
uint remaining = ToBeFarmedTokens.sub(totalClaimedRewards);
return remaining;
}
}
|
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063a2f49ae511610104578063de2f41b5116100a2578063f2fde38b11610071578063f2fde38b14610447578063f3f91fa01461046d578063f851a44014610493578063fb8818e81461049b576101cf565b8063de2f41b51461040c578063ded9721e14610414578063e580c50514610437578063f1587ea11461043f576101cf565b8063bec4de3f116100de578063bec4de3f146103b2578063c326bf4f146103ba578063c3828bf0146103e0578063d578ceab14610404576101cf565b8063a2f49ae514610356578063a89c8c5e1461037c578063b01356b2146103aa576101cf565b80633844317711610171578063538a85a11161014b578063538a85a1146102d55780636270cd18146102f25780636a395ccb146103185780637b0a47ee1461034e576101cf565b806338443177146102935780633e67c7d1146102b05780634908e386146102b8576101cf565b80631f0b3840116101ad5780631f0b38401461025c578063308feec314610264578063372500ab1461026c578063381ffd6b14610274576101cf565b8063069ca4d0146101d45780631c885bae146102055780631e94723f14610224575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b6102226004803603602081101561021b57600080fd5b50356104d9565b005b61024a6004803603602081101561023a57600080fd5b50356001600160a01b03166107e4565b60408051918252519081900360200190f35b6101f1610897565b61024a6108a0565b6102226108b2565b6101f16004803603602081101561028a57600080fd5b503515156108bd565b6101f1600480360360208110156102a957600080fd5b5035610949565b61024a61096a565b6101f1600480360360208110156102ce57600080fd5b5035610970565b610222600480360360208110156102eb57600080fd5b5035610991565b61024a6004803603602081101561030857600080fd5b50356001600160a01b0316610c86565b6102226004803603606081101561032e57600080fd5b506001600160a01b03813581169160208101359091169060400135610c98565b61024a610d72565b61024a6004803603602081101561036c57600080fd5b50356001600160a01b0316610d78565b6101f16004803603604081101561039257600080fd5b506001600160a01b0381358116916020013516610d8a565b61024a610e30565b61024a610e36565b61024a600480360360208110156103d057600080fd5b50356001600160a01b0316610e3c565b6103e8610e4e565b604080516001600160a01b039092168252519081900360200190f35b61024a610e5d565b61024a610e63565b6101f16004803603604081101561042a57600080fd5b5080359060200135610e69565b6103e8610e8d565b61024a610e9c565b6102226004803603602081101561045d57600080fd5b50356001600160a01b0316610ed0565b61024a6004803603602081101561048357600080fd5b50356001600160a01b0316610f55565b6103e8610f67565b6101f1600480360360208110156104b157600080fd5b5035610f76565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b336000908152600d602052604090205481111561053d576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e602052604090205461055b904290610f97565b116105975760405162461bcd60e51b815260040180806020018281038252603b815260200180611304603b913960400191505060405180910390fd5b6105a033610fae565b60006105c36127106105bd6006548561114290919063ffffffff16565b90611169565b905060006105d18383610f97565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561062d57600080fd5b505af1158015610641573d6000803e3d6000fd5b505050506040513d602081101561065757600080fd5b50516106aa576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156106fe57600080fd5b505af1158015610712573d6000803e3d6000fd5b505050506040513d602081101561072857600080fd5b505161077b576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d60205260409020546107959084610f97565b336000818152600d60205260409020919091556107b490600b9061117e565b80156107cd5750336000908152600d6020526040902054155b156107df576107dd600b33611193565b505b505050565b60006107f1600b8361117e565b6107fd57506000610892565b6001600160a01b0382166000908152600d602052604090205461082257506000610892565b6001600160a01b0382166000908152600f6020526040812054610846904290610f97565b6001600160a01b0384166000908152600d6020526040812054600454600354939450909261088c91612710916105bd919082908890610886908990611142565b90611142565b93505050505b919050565b600a5460ff1681565b60006108ac600b6111a8565b90505b90565b6108bb33610fae565b565b600080546001600160a01b031633146108d557600080fd5b6001546001600160a01b0316158015906108f957506002546001600160a01b031615155b6109345760405162461bcd60e51b815260040180806020018281038252603381526020018061133f6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600080546001600160a01b0316331461096157600080fd5b60099190915590565b60075481565b600080546001600160a01b0316331461098857600080fd5b60039190915590565b600a5460ff1615156001146109ed576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610a42576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9c57600080fd5b505af1158015610ab0573d6000803e3d6000fd5b505050506040513d6020811015610ac657600080fd5b5051610b19576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610b2233610fae565b6000610b3f6127106105bd6005548561114290919063ffffffff16565b90506000610b4d8383610f97565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b505050506040513d6020811015610bd357600080fd5b5051610c26576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610c4090826111b3565b336000818152600d6020526040902091909155610c5f90600b9061117e565b6107df57610c6e600b336111c2565b50336000908152600e60205260409020429055505050565b60106020526000908152604090205481565b6000546001600160a01b03163314610caf57600080fd5b6001546001600160a01b0384811691161415610cea57610ccd610e9c565b811115610cd957600080fd5b600854610ce690826111b3565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d4157600080fd5b505af1158015610d55573d6000803e3d6000fd5b505050506040513d6020811015610d6b57600080fd5b5050505050565b60035481565b600e6020526000908152604090205481565b600080546001600160a01b03163314610da257600080fd5b6001600160a01b03831615801590610dc257506001600160a01b03821615155b610dfd5760405162461bcd60e51b815260040180806020018281038252602a815260200180611372602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b60065481565b60045481565b600d6020526000908152604090205481565b6002546001600160a01b031681565b60085481565b60055481565b600080546001600160a01b03163314610e8157600080fd5b60059290925560065590565b6001546001600160a01b031681565b600060095460085410610eb1575060006108af565b6000610eca600854600954610f9790919063ffffffff16565b91505090565b6000546001600160a01b03163314610ee757600080fd5b6001600160a01b038116610efa57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600f6020526000908152604090205481565b6000546001600160a01b031681565b600080546001600160a01b03163314610f8e57600080fd5b60079190915590565b600082821115610fa357fe5b508082035b92915050565b6000610fb9826107e4565b90508015611125576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561101757600080fd5b505af115801561102b573d6000803e3d6000fd5b505050506040513d602081101561104157600080fd5b5051611094576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152601060205260409020546110b790826111b3565b6001600160a01b0383166000908152601060205260409020556008546110dd90826111b3565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b600082820283158061115c57508284828161115957fe5b04145b61116257fe5b9392505050565b60008082848161117557fe5b04949350505050565b6000611162836001600160a01b0384166111d7565b6000611162836001600160a01b0384166111ef565b6000610fa8826112b5565b60008282018381101561116257fe5b6000611162836001600160a01b0384166112b9565b60009081526001919091016020526040902054151590565b600081815260018301602052604081205480156112ab578354600019808301919081019060009087908390811061122257fe5b906000526020600020015490508087600001848154811061123f57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061126f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610fa8565b6000915050610fa8565b5490565b60006112c583836111d7565b6112fb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610fa8565b506000610fa856fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220c06286f186373cf6e08c69b6d049b13f99eb948c5a3191c139ef04b273e1f7fc64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,329 |
0x291126f6a21d99ae35f382bb47f46cd270861b48
|
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
/*
ApeGene ($APEGENE)
Welcome to the shrewdness. Do you have the $APEGENE within?
Telegram: https://t.me/ApeGene
Website: www.ApeGene.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 ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
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 ApeGene is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ApeGene";
string private constant _symbol = "APEGENE";
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;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 12;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 16;
//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(0x4390DCB54B7127EA24934A70640aF0b097EBa6E5);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x4390DCB54B7127EA24934A70640aF0b097EBa6E5);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000 * 10**9; //2%
uint256 public _maxWalletSize = 40000000 * 10**9; //4%
uint256 public _swapTokensAtAmount = 20000000 * 10**9; //2%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051d578063dd62ed3e1461053d578063ea1644d514610583578063f2fde38b146105a357600080fd5b8063a2a957bb14610498578063a9059cbb146104b8578063bfd79284146104d8578063c3c8cd801461050857600080fd5b80638f70ccf7116100d15780638f70ccf7146104125780638f9a55c01461043257806395d89b411461044857806398a5c3151461047857600080fd5b806374010ece146103be5780637d1db4a5146103de5780638da5cb5b146103f457600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103545780636fc3eaec1461037457806370a0823114610389578063715018a6146103a957600080fd5b8063313ce567146102f857806349bd5a5e146103145780636b9990531461033457600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c25780632fd689e3146102e257600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611963565b6105c3565b005b3480156101ff57600080fd5b5060408051808201909152600781526641706547656e6560c81b60208201525b60405161022c9190611a28565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a7d565b610662565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b50670de0b6b3a76400005b60405190815260200161022c565b3480156102ce57600080fd5b506102556102dd366004611aa9565b610679565b3480156102ee57600080fd5b506102b460185481565b34801561030457600080fd5b506040516009815260200161022c565b34801561032057600080fd5b50601554610285906001600160a01b031681565b34801561034057600080fd5b506101f161034f366004611aea565b6106e2565b34801561036057600080fd5b506101f161036f366004611b17565b61072d565b34801561038057600080fd5b506101f1610775565b34801561039557600080fd5b506102b46103a4366004611aea565b6107c0565b3480156103b557600080fd5b506101f16107e2565b3480156103ca57600080fd5b506101f16103d9366004611b32565b610856565b3480156103ea57600080fd5b506102b460165481565b34801561040057600080fd5b506000546001600160a01b0316610285565b34801561041e57600080fd5b506101f161042d366004611b17565b610885565b34801561043e57600080fd5b506102b460175481565b34801561045457600080fd5b5060408051808201909152600781526641504547454e4560c81b602082015261021f565b34801561048457600080fd5b506101f1610493366004611b32565b6108cd565b3480156104a457600080fd5b506101f16104b3366004611b4b565b6108fc565b3480156104c457600080fd5b506102556104d3366004611a7d565b61093a565b3480156104e457600080fd5b506102556104f3366004611aea565b60106020526000908152604090205460ff1681565b34801561051457600080fd5b506101f1610947565b34801561052957600080fd5b506101f1610538366004611b7d565b61099b565b34801561054957600080fd5b506102b4610558366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058f57600080fd5b506101f161059e366004611b32565b610a3c565b3480156105af57600080fd5b506101f16105be366004611aea565b610a6b565b6000546001600160a01b031633146105f65760405162461bcd60e51b81526004016105ed90611c3a565b60405180910390fd5b60005b815181101561065e5760016010600084848151811061061a5761061a611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065681611c9b565b9150506105f9565b5050565b600061066f338484610b55565b5060015b92915050565b6000610686848484610c79565b6106d884336106d385604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b5565b610b55565b5060019392505050565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105ed90611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107575760405162461bcd60e51b81526004016105ed90611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107aa57506013546001600160a01b0316336001600160a01b0316145b6107b357600080fd5b476107bd816111ef565b50565b6001600160a01b03811660009081526002602052604081205461067390611274565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016105ed90611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108805760405162461bcd60e51b81526004016105ed90611c3a565b601655565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105ed90611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016105ed90611c3a565b601855565b6000546001600160a01b031633146109265760405162461bcd60e51b81526004016105ed90611c3a565b600893909355600a91909155600955600b55565b600061066f338484610c79565b6012546001600160a01b0316336001600160a01b0316148061097c57506013546001600160a01b0316336001600160a01b0316145b61098557600080fd5b6000610990306107c0565b90506107bd816112f8565b6000546001600160a01b031633146109c55760405162461bcd60e51b81526004016105ed90611c3a565b60005b82811015610a365781600560008686858181106109e7576109e7611c6f565b90506020020160208101906109fc9190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2e81611c9b565b9150506109c8565b50505050565b6000546001600160a01b03163314610a665760405162461bcd60e51b81526004016105ed90611c3a565b601755565b6000546001600160a01b03163314610a955760405162461bcd60e51b81526004016105ed90611c3a565b6001600160a01b038116610afa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ed565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ed565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ed565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ed565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ed565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ed565b6000546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b156110ae57601554600160a01b900460ff16610e66576000546001600160a01b03848116911614610e665760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ed565b601654811115610eb85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ed565b6001600160a01b03831660009081526010602052604090205460ff16158015610efa57506001600160a01b03821660009081526010602052604090205460ff16155b610f525760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ed565b6015546001600160a01b03838116911614610fd75760175481610f74846107c0565b610f7e9190611cb6565b10610fd75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ed565b6000610fe2306107c0565b601854601654919250821015908210610ffb5760165491505b8080156110125750601554600160a81b900460ff16155b801561102c57506015546001600160a01b03868116911614155b80156110415750601554600160b01b900460ff165b801561106657506001600160a01b03851660009081526005602052604090205460ff16155b801561108b57506001600160a01b03841660009081526005602052604090205460ff16155b156110ab57611099826112f8565b4780156110a9576110a9476111ef565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f057506001600160a01b03831660009081526005602052604090205460ff165b8061112257506015546001600160a01b0385811691161480159061112257506015546001600160a01b03848116911614155b1561112f575060006111a9565b6015546001600160a01b03858116911614801561115a57506014546001600160a01b03848116911614155b1561116c57600854600c55600954600d555b6015546001600160a01b03848116911614801561119757506014546001600160a01b03858116911614155b156111a957600a54600c55600b54600d555b610a3684848484611472565b600081848411156111d95760405162461bcd60e51b81526004016105ed9190611a28565b5060006111e68486611cce565b95945050505050565b6012546001600160a01b03166108fc6112098360026114a0565b6040518115909202916000818181858888f19350505050158015611231573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124c8360026114a0565b6040518115909202916000818181858888f1935050505015801561065e573d6000803e3d6000fd5b60006006548211156112db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ed565b60006112e56114e2565b90506112f183826114a0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134057611340611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce5565b816001815181106113d0576113d0611c6f565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b55565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d02565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a3657610a36600e54600c55600f54600d55565b60006112f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061162a565b60008060006114ef611658565b90925090506114fe82826114a0565b9250505090565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611737565b6001600160a01b0389166000908152600260205260409020556115c881611796565b6115d284836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6000818361164b5760405162461bcd60e51b81526004016105ed9190611a28565b5060006111e68486611d73565b6006546000908190670de0b6b3a764000061167382826114a0565b82101561168f57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114e2565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b5565b6000806117448385611cb6565b9050838110156112f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ed565b60006117a06114e2565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114a0565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b857506000610673565b60006118c48385611d95565b9050826118d18583611d73565b146112f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ed565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bd57600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112f18161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112f182611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112f18161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c0f5def429b5dcaf28e41e08185468d9024e7c63f3543e2a23040690fc6cd9064736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 2,330 |
0x570b31ac247db77b4fcd52f9123c3f3ee402f964
|
/**
*Submitted for verification at Etherscan.io on 2022-05-03
*/
/**
- https://t.me/GuerrillaInuETH
- http://GuerrillaInu.com
- Guerrilla Inu will be taking over the crypto social platform space, giving aspiring snappers a chance for financial freedom!
- max txn 2%
- max wallet 3%
*/
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 GuerrillaInu 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 = 10000000000 * 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 = "Guerrilla Inu";
string private constant _symbol = "GINU";
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(0x6632b1ef27Be357b23E3A5Bb3a70ca42EAaDBaA5);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_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 = 7;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
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 = 7;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function 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");
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(20).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033e578063b87f137a1461035e578063c3c8cd801461037e578063c9567bf914610393578063dd62ed3e146103a857600080fd5b806370a082311461029f578063715018a6146102bf578063751039fc146102d45780638da5cb5b146102e957806395d89b411461031157600080fd5b8063273123b7116100e7578063273123b71461020e578063313ce5671461022e5780635932ead11461024a578063677daa571461026a5780636fc3eaec1461028a57600080fd5b806306fdde031461012f578063095ea7b31461017757806318160ddd146101a75780631b3f71ae146101cc57806323b872dd146101ee57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600d81526c4775657272696c6c6120496e7560981b60208201525b60405161016e91906115b1565b60405180910390f35b34801561018357600080fd5b5061019761019236600461162b565b6103ee565b604051901515815260200161016e565b3480156101b357600080fd5b50678ac7230489e800005b60405190815260200161016e565b3480156101d857600080fd5b506101ec6101e736600461166d565b610405565b005b3480156101fa57600080fd5b50610197610209366004611732565b6104a4565b34801561021a57600080fd5b506101ec610229366004611773565b61050d565b34801561023a57600080fd5b506040516009815260200161016e565b34801561025657600080fd5b506101ec61026536600461179e565b610558565b34801561027657600080fd5b506101ec6102853660046117bb565b6105a0565b34801561029657600080fd5b506101ec6105fa565b3480156102ab57600080fd5b506101be6102ba366004611773565b610627565b3480156102cb57600080fd5b506101ec610649565b3480156102e057600080fd5b506101ec6106bd565b3480156102f557600080fd5b506000546040516001600160a01b03909116815260200161016e565b34801561031d57600080fd5b5060408051808201909152600481526347494e5560e01b6020820152610161565b34801561034a57600080fd5b5061019761035936600461162b565b6106fa565b34801561036a57600080fd5b506101ec6103793660046117bb565b610707565b34801561038a57600080fd5b506101ec61075b565b34801561039f57600080fd5b506101ec610791565b3480156103b457600080fd5b506101be6103c33660046117d4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fb3384846109af565b5060015b92915050565b6000546001600160a01b031633146104385760405162461bcd60e51b815260040161042f9061180d565b60405180910390fd5b60005b81518110156104a05760016006600084848151811061045c5761045c611842565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104988161186e565b91505061043b565b5050565b60006104b1848484610ad3565b61050384336104fe856040518060600160405280602881526020016119d1602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610edd565b6109af565b5060019392505050565b6000546001600160a01b031633146105375760405162461bcd60e51b815260040161042f9061180d565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105825760405162461bcd60e51b815260040161042f9061180d565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105ca5760405162461bcd60e51b815260040161042f9061180d565b600081116105d757600080fd5b6105f460646105ee678ac7230489e8000084610f17565b90610fa0565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061a57600080fd5b4761062481610fe2565b50565b6001600160a01b0381166000908152600260205260408120546103ff9061101c565b6000546001600160a01b031633146106735760405162461bcd60e51b815260040161042f9061180d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260040161042f9061180d565b678ac7230489e80000600f819055601055565b60006103fb338484610ad3565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161042f9061180d565b6000811161073e57600080fd5b61075560646105ee678ac7230489e8000084610f17565b60105550565b600c546001600160a01b0316336001600160a01b03161461077b57600080fd5b600061078630610627565b905061062481611099565b6000546001600160a01b031633146107bb5760405162461bcd60e51b815260040161042f9061180d565b600e54600160a01b900460ff16156108155760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042f565b600d546001600160a01b031663f305d719473061083181610627565b6000806108466000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108ae573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108d39190611887565b5050600e805461ffff60b01b191661010160b01b179055506109046103e86105ee678ac7230489e800006014610f17565b600f556109206103e86105ee678ac7230489e80000601e610f17565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801561098b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062491906118b5565b6001600160a01b038316610a115760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042f565b6001600160a01b038216610a725760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b375760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042f565b6001600160a01b038216610b995760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042f565b60008111610bfb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042f565b6000600a556007600b55610c176000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610c4657506000546001600160a01b03838116911614155b15610ecd576001600160a01b03831660009081526006602052604090205460ff16158015610c8d57506001600160a01b03821660009081526006602052604090205460ff16155b610c9657600080fd5b600e546001600160a01b038481169116148015610cc15750600d546001600160a01b03838116911614155b8015610ce657506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfb5750600e54600160b81b900460ff165b15610e0057600f54811115610d525760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042f565b60105481610d5f84610627565b610d6991906118d2565b1115610db75760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042f565b6001600160a01b0382166000908152600760205260409020544211610ddb57600080fd5b610de642601e6118d2565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610e2b5750600d546001600160a01b03848116911614155b8015610e5057506001600160a01b03831660009081526005602052604090205460ff16155b15610e60576000600a556007600b555b6000610e6b30610627565b600e54909150600160a81b900460ff16158015610e965750600e546001600160a01b03858116911614155b8015610eab5750600e54600160b01b900460ff165b15610ecb57610eb981611099565b478015610ec957610ec947610fe2565b505b505b610ed8838383611213565b505050565b60008184841115610f015760405162461bcd60e51b815260040161042f91906115b1565b506000610f0e84866118ea565b95945050505050565b600082600003610f29575060006103ff565b6000610f358385611901565b905082610f428583611920565b14610f995760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042f565b9392505050565b6000610f9983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061121e565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a0573d6000803e3d6000fd5b60006008548211156110835760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042f565b600061108d61124c565b9050610f998382610fa0565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e1576110e1611842565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e9190611942565b8160018151811061117157611171611842565b6001600160a01b039283166020918202929092010152600d5461119791309116846109af565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d090859060009086903090429060040161195f565b600060405180830381600087803b1580156111ea57600080fd5b505af11580156111fe573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b610ed883838361126f565b6000818361123f5760405162461bcd60e51b815260040161042f91906115b1565b506000610f0e8486611920565b6000806000611259611366565b90925090506112688282610fa0565b9250505090565b600080600080600080611281876113a6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112b39087611403565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112e29086611445565b6001600160a01b038916600090815260026020526040902055611304816114a4565b61130e84836114ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135391815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e800006113818282610fa0565b82101561139d57505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006113c38a600a54600b54611512565b92509250925060006113d361124c565b905060008060006113e68e878787611561565b919e509c509a509598509396509194505050505091939550919395565b6000610f9983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610edd565b60008061145283856118d2565b905083811015610f995760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042f565b60006114ae61124c565b905060006114bc8383610f17565b306000908152600260205260409020549091506114d99082611445565b30600090815260026020526040902055505050565b6008546114fb9083611403565b60085560095461150b9082611445565b6009555050565b600080808061152660646105ee8989610f17565b9050600061153960646105ee8a89610f17565b905060006115518261154b8b86611403565b90611403565b9992985090965090945050505050565b60008080806115708886610f17565b9050600061157e8887610f17565b9050600061158c8888610f17565b9050600061159e8261154b8686611403565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156115de578581018301518582016040015282016115c2565b818111156115f0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062457600080fd5b803561162681611606565b919050565b6000806040838503121561163e57600080fd5b823561164981611606565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561168057600080fd5b823567ffffffffffffffff8082111561169857600080fd5b818501915085601f8301126116ac57600080fd5b8135818111156116be576116be611657565b8060051b604051601f19603f830116810181811085821117156116e3576116e3611657565b60405291825284820192508381018501918883111561170157600080fd5b938501935b82851015611726576117178561161b565b84529385019392850192611706565b98975050505050505050565b60008060006060848603121561174757600080fd5b833561175281611606565b9250602084013561176281611606565b929592945050506040919091013590565b60006020828403121561178557600080fd5b8135610f9981611606565b801515811461062457600080fd5b6000602082840312156117b057600080fd5b8135610f9981611790565b6000602082840312156117cd57600080fd5b5035919050565b600080604083850312156117e757600080fd5b82356117f281611606565b9150602083013561180281611606565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161188057611880611858565b5060010190565b60008060006060848603121561189c57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118c757600080fd5b8151610f9981611790565b600082198211156118e5576118e5611858565b500190565b6000828210156118fc576118fc611858565b500390565b600081600019048311821515161561191b5761191b611858565b500290565b60008261193d57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561195457600080fd5b8151610f9981611606565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119af5784516001600160a01b03168352938301939183019160010161198a565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cdea74bde8612bb2df74ef3691f5a0341ceea39767626e258217c2520de16a8e64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,331 |
0xBCFB62D206543f74f162BEf85Fb65B5FB7AFd828
|
pragma solidity ^0.4.24;
// File: /zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: /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 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: /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) 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];
}
}
// File: /zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: /zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_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;
}
}
// 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 OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: /zeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
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;
}
}
// 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 {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: /zeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(
ERC20Basic _token,
address _to,
uint256 _value
)
internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
)
internal
{
require(_token.approve(_spender, _value));
}
}
// File: /zeppelin-solidity/contracts/ownership/CanReclaimToken.sol
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param _token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic _token) external onlyOwner {
uint256 balance = _token.balanceOf(this);
_token.safeTransfer(owner, balance);
}
}
// File: /zeppelin-solidity/contracts/ownership/HasNoTokens.sol
/**
* @title Contracts that should not own Tokens
* @author Remco Bloemen <remco@2π.com>
* @dev This blocks incoming ERC223 tokens to prevent accidental loss of tokens.
* Should tokens (any ERC20Basic compatible) end up in the contract, it allows the
* owner to reclaim the tokens.
*/
contract HasNoTokens is CanReclaimToken {
/**
* @dev Reject all ERC223 compatible tokens
* @param _from address The address that is transferring the tokens
* @param _value uint256 the amount of the specified token
* @param _data Bytes The data passed from the caller.
*/
function tokenFallback(
address _from,
uint256 _value,
bytes _data
)
external
pure
{
_from;
_value;
_data;
revert();
}
}
// File: contracts/TradeJPY.sol
/**
*@contract TradeJPY
*/
contract TradeJPY is StandardToken, Ownable, HasNoTokens, BurnableToken, MintableToken{
string public name = "TradeJPY";
string public symbol = "TJPY";
uint public decimals = 8;
event Transfer(address indexed from, address indexed to, uint value, bytes data);
constructor(uint256 initialSupply) public {
totalSupply_ = initialSupply;
owner = msg.sender;
balances[msg.sender] = initialSupply;
}
/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a contract.
* The token transfer fails if the recipient is a contract
* but does not implement the `tokenFallback` function
* or the fallback function to receive funds.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
* @param _data Transaction metadata.
*/
function transfer(address _to, uint _value, bytes _data) public {
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
uint codeLength;
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
HasNoTokens receiver = HasNoTokens(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
emit Transfer(msg.sender, _to, _value, _data);
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde0314610151578063095ea7b3146101e157806317ffc3201461024657806318160ddd1461028957806323b872dd146102b4578063313ce5671461033957806340c10f191461036457806342966c68146103c957806366188463146103f657806370a082311461045b578063715018a6146104b25780637d64bcb4146104c95780638da5cb5b146104f857806395d89b411461054f578063a9059cbb146105df578063be45fd6214610644578063c0ee0b8a146106d7578063d73dd6231461073c578063dd62ed3e146107a1578063f2fde38b14610818575b600080fd5b34801561012e57600080fd5b5061013761085b565b604051808215151515815260200191505060405180910390f35b34801561015d57600080fd5b5061016661086e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b5061022c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061090c565b604051808215151515815260200191505060405180910390f35b34801561025257600080fd5b50610287600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109fe565b005b34801561029557600080fd5b5061029e610b85565b6040518082815260200191505060405180910390f35b3480156102c057600080fd5b5061031f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b8f565b604051808215151515815260200191505060405180910390f35b34801561034557600080fd5b5061034e610f4a565b6040518082815260200191505060405180910390f35b34801561037057600080fd5b506103af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f50565b604051808215151515815260200191505060405180910390f35b3480156103d557600080fd5b506103f460048036038101908080359060200190929190505050611136565b005b34801561040257600080fd5b50610441600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611143565b604051808215151515815260200191505060405180910390f35b34801561046757600080fd5b5061049c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d5565b6040518082815260200191505060405180910390f35b3480156104be57600080fd5b506104c761141d565b005b3480156104d557600080fd5b506104de611522565b604051808215151515815260200191505060405180910390f35b34801561050457600080fd5b5061050d6115ea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055b57600080fd5b50610564611610565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105a4578082015181840152602081019050610589565b50505050905090810190601f1680156105d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105eb57600080fd5b5061062a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116ae565b604051808215151515815260200191505060405180910390f35b34801561065057600080fd5b506106d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506118ce565b005b3480156106e357600080fd5b5061073a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001919091929391929390505050611c09565b005b34801561074857600080fd5b50610787600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c0e565b604051808215151515815260200191505060405180910390f35b3480156107ad57600080fd5b50610802600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e0a565b6040518082815260200191505060405180910390f35b34801561082457600080fd5b50610859600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e91565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109045780601f106108d957610100808354040283529160200191610904565b820191906000526020600020905b8154815290600101906020018083116108e757829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a5c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610af757600080fd5b505af1158015610b0b573d6000803e3d6000fd5b505050506040513d6020811015610b2157600080fd5b81019080805190602001909291905050509050610b81600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16611ef99092919063ffffffff16565b5050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610bde57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c6957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ca557600080fd5b610cf6826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d89826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e5a82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fae57600080fd5b600360149054906101000a900460ff16151515610fca57600080fd5b610fdf8260015461200090919063ffffffff16565b600181905550611036826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b611140338261201c565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515611255576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112e9565b6112688382611fe790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561158057600080fd5b600360149054906101000a900460ff1615151561159c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116a65780601f1061167b576101008083540402835291602001916116a6565b820191906000526020600020905b81548152906001019060200180831161168957829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116fd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561173957600080fd5b61178a826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080843b9150611926846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119b9846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200090919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000821115611b30578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ac9578082015181840152602081019050611aae565b50505050905090810190601f168015611af65780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611b1757600080fd5b505af1158015611b2b573d6000803e3d6000fd5b505050505b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611bc7578082015181840152602081019050611bac565b50505050905090810190601f168015611bf45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35050505050565b600080fd5b6000611c9f82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611eed57600080fd5b611ef6816121cf565b50565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b505050506040513d6020811015611fc657600080fd5b81019080805190602001909291905050501515611fe257600080fd5b505050565b6000828211151515611ff557fe5b818303905092915050565b6000818301905082811015151561201357fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561206957600080fd5b6120ba816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061211181600154611fe790919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561220b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058209816d743634e7eb55118917ca3ab8cc1e296f5b2d57ef5e95852c707527f79340029
|
{"success": true, "error": null, "results": {}}
| 2,332 |
0xe7a3849a565cb0ad0e694f7a8c47efac2a20ac1d
|
/*
/ Australian Dingo (DINGO)
/CMC and CG listing application in place.
/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 DINGO 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 { }
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826116b0565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b61076284848461179c565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118e3565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116f55760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561174d5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b038316600081815260036020526040902090611806576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118129084610fb2565b6001600160a01b03851660009081526020819052604090205410156118685760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b6000816001015411801561187f5750806001015442115b156118905760006001820181905581555b6001810182905580546118a39084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119285760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461199b576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220782ad2ea994e6d44bc1f4095e6a6757c9acee70df52fd4358538d5356835e92964736f6c63430007030033
|
{"success": true, "error": null, "results": {}}
| 2,333 |
0xc7edcdc92f46235fd407666b569c2200d5f34bb1
|
/*
🐴WELCOME TO Bojack Horseman 🐴
Supply 1B
🔥Burn 40%
💹Tokenomics:
4% Tax
2% Reward for Holders
TG : @BojackToken
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BojackToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "@BojackToken";
string private constant _symbol = "Bojack";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 4;
uint256 private _redisfee = 2;
//Bots
mapping (address => bool) bannedUsers;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 4;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function removebot(address account, bool banned) public {
require(_msgSender() == _teamAddress);
if (banned) {
require( block.timestamp + 3 days > block.timestamp, "x");
bannedUsers[account] = true;
} else {
delete bannedUsers[account];
}
emit WalletBanStatusUpdated(account, banned);
}
function unban(address account) public {
require(_msgSender() == _teamAddress);
bannedUsers[account] = false;
}
event WalletBanStatusUpdated(address user, bool banned);
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function maxtx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a1461031f578063b9f145571461033f578063c3c8cd801461035f578063c9567bf914610374578063dd62ed3e1461038957600080fd5b806370a0823114610273578063715018a6146102935780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102ff57600080fd5b80632634e5e8116100e75780632634e5e8146101e0578063313ce56714610202578063445b1a781461021e5780635932ead11461023e5780636fc3eaec1461025e57600080fd5b806306fdde0314610124578063095ea7b31461016b57806318160ddd1461019b57806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600c81526b202137b530b1b5aa37b5b2b760a11b60208201525b6040516101629190611b09565b60405180910390f35b34801561017757600080fd5b5061018b610186366004611990565b6103cf565b6040519015158152602001610162565b3480156101a757600080fd5b50670de0b6b3a76400005b604051908152602001610162565b3480156101cc57600080fd5b5061018b6101db366004611921565b6103e6565b3480156101ec57600080fd5b506102006101fb366004611ac2565b61044f565b005b34801561020e57600080fd5b5060405160098152602001610162565b34801561022a57600080fd5b50610200610239366004611962565b61051d565b34801561024a57600080fd5b50610200610259366004611a88565b610612565b34801561026a57600080fd5b5061020061065a565b34801561027f57600080fd5b506101b261028e3660046118ae565b610687565b34801561029f57600080fd5b506102006106a9565b3480156102b457600080fd5b506000546040516001600160a01b039091168152602001610162565b3480156102dc57600080fd5b50604080518082019091526006815265426f6a61636b60d01b6020820152610155565b34801561030b57600080fd5b5061018b61031a366004611990565b61071d565b34801561032b57600080fd5b5061020061033a3660046119bc565b61072a565b34801561034b57600080fd5b5061020061035a3660046118ae565b6107c0565b34801561036b57600080fd5b50610200610801565b34801561038057600080fd5b50610200610837565b34801561039557600080fd5b506101b26103a43660046118e8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103dc338484610bf9565b5060015b92915050565b60006103f3848484610d1d565b610445843361044085604051806060016040528060288152602001611cf5602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061112f565b610bf9565b5060019392505050565b600d546001600160a01b0316336001600160a01b03161461046f57600080fd5b600081116104c45760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064015b60405180910390fd5b6104e26127106104dc670de0b6b3a764000084611169565b906111ef565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600d546001600160a01b0316336001600160a01b03161461053d57600080fd5b80156105aa5742610551816203f480611c04565b116105825760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016104bb565b6001600160a01b0382166000908152600a60205260409020805460ff191660011790556105cb565b6001600160a01b0382166000908152600a60205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b6000546001600160a01b0316331461063c5760405162461bcd60e51b81526004016104bb90611b5e565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461067a57600080fd5b4761068481611231565b50565b6001600160a01b0381166000908152600260205260408120546103e0906112b6565b6000546001600160a01b031633146106d35760405162461bcd60e51b81526004016104bb90611b5e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103dc338484610d1d565b6000546001600160a01b031633146107545760405162461bcd60e51b81526004016104bb90611b5e565b60005b81518110156107bc576001600b600084848151811061077857610778611ca5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107b481611c74565b915050610757565b5050565b600d546001600160a01b0316336001600160a01b0316146107e057600080fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600d546001600160a01b0316336001600160a01b03161461082157600080fd5b600061082c30610687565b905061068481611333565b6000546001600160a01b031633146108615760405162461bcd60e51b81526004016104bb90611b5e565b601054600160a01b900460ff16156108bb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104bb565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108f73082670de0b6b3a7640000610bf9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561093057600080fd5b505afa158015610944573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096891906118cb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b057600080fd5b505afa1580156109c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e891906118cb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6891906118cb565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a9881610687565b600080610aad6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b1057600080fd5b505af1158015610b24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b499190611adb565b5050601080546702c68af0bb14000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bc9190611aa5565b6001600160a01b038316610c5b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104bb565b6001600160a01b038216610cbc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104bb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104bb565b6001600160a01b038216610de35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104bb565b60008111610e455760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104bb565b6000546001600160a01b03848116911614801590610e7157506000546001600160a01b03838116911614155b156110d257601054600160b81b900460ff1615610f58576001600160a01b0383163014801590610eaa57506001600160a01b0382163014155b8015610ec45750600f546001600160a01b03848116911614155b8015610ede5750600f546001600160a01b03838116911614155b15610f5857600f546001600160a01b0316336001600160a01b03161480610f1857506010546001600160a01b0316336001600160a01b0316145b610f585760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104bb565b601154811115610f6757600080fd5b6001600160a01b0383166000908152600b602052604090205460ff16158015610fa957506001600160a01b0382166000908152600b602052604090205460ff16155b610fb257600080fd5b6010546001600160a01b038481169116148015610fdd5750600f546001600160a01b03838116911614155b801561100257506001600160a01b03821660009081526005602052604090205460ff16155b80156110175750601054600160b81b900460ff165b15611065576001600160a01b0382166000908152600c6020526040902054421161104057600080fd5b61104b426078611c04565b6001600160a01b0383166000908152600c60205260409020555b600061107030610687565b601054909150600160a81b900460ff1615801561109b57506010546001600160a01b03858116911614155b80156110b05750601054600160b01b900460ff165b156110d0576110be81611333565b4780156110ce576110ce47611231565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061111457506001600160a01b03831660009081526005602052604090205460ff165b1561111d575060005b611129848484846114bc565b50505050565b600081848411156111535760405162461bcd60e51b81526004016104bb9190611b09565b5060006111608486611c5d565b95945050505050565b600082611178575060006103e0565b60006111848385611c3e565b9050826111918583611c1c565b146111e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104bb565b9392505050565b60006111e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e8565b600d546001600160a01b03166108fc61124b8360026111ef565b6040518115909202916000818181858888f19350505050158015611273573d6000803e3d6000fd5b50600e546001600160a01b03166108fc61128e8360026111ef565b6040518115909202916000818181858888f193505050501580156107bc573d6000803e3d6000fd5b600060065482111561131d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104bb565b6000611327611516565b90506111e883826111ef565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137b5761137b611ca5565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113cf57600080fd5b505afa1580156113e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140791906118cb565b8160018151811061141a5761141a611ca5565b6001600160a01b039283166020918202929092010152600f546114409130911684610bf9565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611479908590600090869030904290600401611b93565b600060405180830381600087803b15801561149357600080fd5b505af11580156114a7573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b806114c9576114c9611539565b6114d484848461155c565b806111295761112960046008556002600955565b600081836115095760405162461bcd60e51b81526004016104bb9190611b09565b5060006111608486611c1c565b6000806000611523611653565b909250905061153282826111ef565b9250505090565b6008541580156115495750600954155b1561155057565b60006008819055600955565b60008060008060008061156e87611693565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115a090876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115cf9086611732565b6001600160a01b0389166000908152600260205260409020556115f181611791565b6115fb84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161164091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061166e82826111ef565b82101561168a57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116b08a6008546009546117ff565b92509250925060006116c0611516565b905060008060006116d38e87878761184e565b919e509c509a509598509396509194505050505091939550919395565b60006111e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061112f565b60008061173f8385611c04565b9050838110156111e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104bb565b600061179b611516565b905060006117a98383611169565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b600080808061181360646104dc8989611169565b9050600061182660646104dc8a89611169565b9050600061183e826118388b866116f0565b906116f0565b9992985090965090945050505050565b600080808061185d8886611169565b9050600061186b8887611169565b905060006118798888611169565b9050600061188b8261183886866116f0565b939b939a50919850919650505050505050565b80356118a981611cd1565b919050565b6000602082840312156118c057600080fd5b81356111e881611cd1565b6000602082840312156118dd57600080fd5b81516111e881611cd1565b600080604083850312156118fb57600080fd5b823561190681611cd1565b9150602083013561191681611cd1565b809150509250929050565b60008060006060848603121561193657600080fd5b833561194181611cd1565b9250602084013561195181611cd1565b929592945050506040919091013590565b6000806040838503121561197557600080fd5b823561198081611cd1565b9150602083013561191681611ce6565b600080604083850312156119a357600080fd5b82356119ae81611cd1565b946020939093013593505050565b600060208083850312156119cf57600080fd5b823567ffffffffffffffff808211156119e757600080fd5b818501915085601f8301126119fb57600080fd5b813581811115611a0d57611a0d611cbb565b8060051b604051601f19603f83011681018181108582111715611a3257611a32611cbb565b604052828152858101935084860182860187018a1015611a5157600080fd5b600095505b83861015611a7b57611a678161189e565b855260019590950194938601938601611a56565b5098975050505050505050565b600060208284031215611a9a57600080fd5b81356111e881611ce6565b600060208284031215611ab757600080fd5b81516111e881611ce6565b600060208284031215611ad457600080fd5b5035919050565b600080600060608486031215611af057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611b3657858101830151858201604001528201611b1a565b81811115611b48576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611be35784516001600160a01b031683529383019391830191600101611bbe565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c1757611c17611c8f565b500190565b600082611c3957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c5857611c58611c8f565b500290565b600082821015611c6f57611c6f611c8f565b500390565b6000600019821415611c8857611c88611c8f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461068457600080fd5b801515811461068457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206683e49799126cba11ac63c113d9c14098a079c9529d9b9c9797f054d78b958664736f6c63430008070033
|
{"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"}]}}
| 2,334 |
0x5b25737e8c976111e3e9ff3d7d4c095c34d36d16
|
/**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
// SPDX-License-Identifier: MIT
//
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract MagicInternetMoney is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'MagicInernetMoney ';
string private _symbol = 'MIM';
uint8 private _decimals = 18;
uint256 public maxTxAmount = 1000000000000000e18;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () public {
_mint(_msgSender(), 1000000000000000e18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender != owner() && recipient != owner())
require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() {
require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9');
maxTxAmount = _maxTxAmount;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122022ff4854c001ec0392b2e254febdc32221d38452ef1ed6cdf1c2ef17ae6b35de64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,335 |
0x312d22b7c9da5bdfa86635de368cd0f494e4bd48
|
/**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
/*
█▀█ █▀▀ █░█ █▀█ █░░ █░█ ▀█▀ █ █▀█ █▄░█ ▄▀█ █▀█ █▄█ █▀█ █▀█ █▄▀ █▀▀ █▄░█ █▀█ █▀▄▀█ █ █▀▀ █▀ ▀█▀ █░█ █▀▀
█▀▄ ██▄ ▀▄▀ █▄█ █▄▄ █▄█ ░█░ █ █▄█ █░▀█ █▀█ █▀▄ ░█░ █▀▀ █▄█ █░█ ██▄ █░▀█ █▄█ █░▀░█ █ █▄▄ ▄█ ░█░ █▀█ ██▄
█▀▀ █ █▀█ █▀ ▀█▀ ▄▀█ █▄░█ █ █▀▄▀█ █▀▀ █░░ ▄▀█ █░█ █▄░█ █▀▀ █░█ █▀█ ▄▀█ █▀▄
█▀░ █ █▀▄ ▄█ ░█░ █▀█ █░▀█ █ █░▀░█ ██▄ █▄▄ █▀█ █▄█ █░▀█ █▄▄ █▀█ █▀▀ █▀█ █▄▀
Website: https://mewtwoinu.com/
Twitter: https://twitter.com/InuMewtwo
https://t.me/MewtwoInu
*/
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 MewtwoINU 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 = ' MEWTWO INU';
string private _symbol = 'MEWTWO';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220434851420202bb50672a400df51323ac4e957867041b631f96cac0cfe6c4743264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,336 |
0xfce43251e6deeba84f9b736b3b18cf4e37438162
|
pragma solidity ^0.4.24;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract braggerContract {
/*********************************/
/*********** MAPPINGS ************/
/*********************************/
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) private isUser;
mapping (address => bool) private hasPicture;
mapping (address => string) private userWalletToUserName;
mapping (string => address) private userNameToUserWallet;
mapping (string => string) private userNameToPicture;
mapping (address => string) private userWalletToPicture;
mapping (address => uint256) private fineLevel;
/*********************************/
/************* EVENTS ************/
/*********************************/
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/*********************************/
/******** FREE VARIABLES *********/
/*********************************/
address public ownerAddress = 0x000;
address private bragAddress = 0x845EC9f9C0650b98f70E05fc259F4A04f6AC366e;
string private initialQuote = "Teach your people with your wisdom.";
/******SET PICTURE*/
string private initialPicture = "https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/user_male2-512.png";
uint256 basicFine = 25000000000000000;
uint256 blocks;
uint256 totalBraggedValue = 0;
uint256 winningpot = 0;
uint256 totalbrags = 0;
/*********************************/
/*********** DATA TYPES **********/
/*********************************/
struct Bragger{
address braggerAddress;
uint256 braggedAmount;
string braggerQuote;
}
Bragger[] private braggers;
struct User{
address userAddress;
string userName;
}
User[] private users;
/*********************************/
/*********** MODIFIER ************/
/*********************************/
/// @dev Access modifier for CEO-only functionality
modifier onlyCreator() {
require(msg.sender == ownerAddress);
_;
}
/*********************************/
/********** CONSTRUCTOR **********/
/*********************************/
constructor() public {
blocks=0;
ownerAddress = msg.sender;
}
function random() private view returns (uint8) {
return uint8(uint256(keccak256(block.timestamp, block.difficulty))%251);
}
function random2() private view returns (uint8) {
return uint8(uint256(keccak256(blocks, block.difficulty))%251);
}
function random3() private view returns (uint8) {
return uint8(uint256(keccak256(blocks, block.difficulty))%braggers.length);
}
/*********************************/
/************ GETTERS ************/
/*********************************/
function getTotalBraggedVolume() public view returns (uint256 _amount){
return totalBraggedValue;
}
function getCurrentBragKing() public view returns(address _bragger, uint256 _amount, string _quote, string _username, string _picture){
_bragger = braggers[braggers.length-1].braggerAddress;
_amount = braggers[braggers.length-1].braggedAmount;
_quote = braggers[braggers.length-1].braggerQuote;
if(isAlreadyUser(_bragger)){
_username = getUserNameByWallet(_bragger);
} else {
_username = "";
}
if(hasPicture[_bragger]){
_picture = userWalletToPicture[_bragger];
} else {
_picture = initialPicture;
}
return (_bragger, _amount, _quote, _username, _picture);
}
function arrayLength()public view returns(uint256 length){
length = braggers.length;
return length;
}
function getBraggerAtIndex(uint256 _index) public view returns(address _bragger, uint256 _brag, string _username, string _picture){
_bragger = braggers[_index].braggerAddress;
_brag = braggers[_index].braggedAmount;
if(isAlreadyUser(_bragger)){
_username = getUserNameByWallet(_bragger);
} else {
_username = "";
}
if(hasPicture[_bragger]){
_picture = userWalletToPicture[_bragger];
} else {
_picture = initialPicture;
}
return (_bragger, _brag, _username, _picture);
}
function getUserNameByWallet(address _wallet) public view returns (string _username){
require(isAlreadyUser(_wallet));
_username = userWalletToUserName[_wallet];
return _username;
}
function getUserPictureByWallet(address _wallet) public view returns (string _url){
require(isAlreadyUser(_wallet));
_url = userWalletToPicture[_wallet];
return _url;
}
function getUserWalletByUsername(string _username) public view returns(address _address){
address _user = userNameToUserWallet[_username];
return (_user);
}
function getUserPictureByUsername(string _username) public view returns(string _url){
_url = userNameToPicture[_username];
return (_url);
}
function getFineLevelOfAddress(address _user) public view returns(uint256 _fineLevel, uint256 _fineAmount){
_fineLevel = fineLevel[_user];
_fineAmount = _fineLevel * basicFine;
return (_fineLevel, _fineAmount);
}
function getFineLevelOfUsername(string _username) public view returns(uint256 _fineLevel, uint256 _fineAmount){
address _user = userNameToUserWallet[_username];
_fineLevel = fineLevel[_user];
_fineAmount = _fineLevel * basicFine;
return (_fineLevel, _fineAmount);
}
function getTotalBrags() public view returns(uint256){
return totalbrags;
}
function getWinnerPot() public view returns(uint256){
return winningpot;
}
/*********************************/
/****** BRAGING FUNCTIONS ********/
/*********************************/
function getCurrentPot() public view returns (uint256 _amount){
return address(this).balance;
}
function brag() public payable{
uint256 shortage = SafeMath.mul(30,SafeMath.div(msg.value, 100));
if(braggers.length != 0){
require(braggers[braggers.length-1].braggedAmount < msg.value);
}
Bragger memory _bragger = Bragger({
braggerAddress: msg.sender,
braggedAmount: msg.value,
braggerQuote: initialQuote
});
braggers.push(_bragger);
totalBraggedValue = totalBraggedValue + msg.value;
winningpot = winningpot + SafeMath.sub(msg.value, shortage);
bragAddress.transfer(shortage);
if(random() == random2()){
address sender = msg.sender;
sender.transfer(SafeMath.mul(SafeMath.div(address(this).balance,100), 70));
uint256 luckyIndex = random3();
address luckyGuy = braggers[luckyIndex].braggerAddress;
luckyGuy.transfer(address(this).balance);
}
blocks = SafeMath.add(blocks, random());
totalbrags += 1;
}
/*********************************/
/******* USER INTERACTION ********/
/*********************************/
function setTheKingsQuote(string _message) public payable{
if(fineLevel[msg.sender] > 0){
require(msg.value > (basicFine * fineLevel[msg.sender]));
}
address currentKing = braggers[braggers.length-1].braggerAddress;
require(msg.sender == currentKing);
braggers[braggers.length-1].braggerQuote = _message;
}
/*********************************/
/********* USER CREATION *********/
/*********************************/
function isAlreadyUser(address _address) public view returns (bool status){
if (isUser[_address]){
return true;
} else {
return false;
}
}
function hasProfilePicture(address _address) public view returns (bool status){
if (isUser[_address]){
return true;
} else {
return false;
}
}
function createNewUser(string _username, string _pictureUrl) public {
require(!isAlreadyUser(msg.sender));
User memory _user = User({
userAddress: msg.sender,
userName: _username
});
userWalletToUserName[msg.sender] = _username;
userNameToUserWallet[_username] = msg.sender;
userNameToPicture[_username] = _pictureUrl;
userWalletToPicture[msg.sender] = _pictureUrl;
fineLevel[msg.sender] = 0;
users.push(_user) - 1;
isUser[msg.sender] = true;
hasPicture[msg.sender] = true;
}
/*********************************/
/******** OWNER FUNCTIONS ********/
/*********************************/
function resetQuote()public onlyCreator{
braggers[braggers.length-1].braggerQuote = initialQuote;
fineLevel[braggers[braggers.length-1].braggerAddress] = fineLevel[braggers[braggers.length-1].braggerAddress] + 1;
}
function resetUsername(string _username)public onlyCreator{
address user = userNameToUserWallet[_username];
userWalletToUserName[user] = "Mick";
fineLevel[user] = fineLevel[user] + 1;
}
function resetUserPicture(string _username)public onlyCreator{
address user = userNameToUserWallet[_username];
userWalletToPicture[user] = initialPicture;
fineLevel[user] = fineLevel[user] + 1;
}
/********** ResetUserPicture */
/*********************************/
/******** LEGACY FUNCIONS ********/
/*********************************/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function reset()public onlyCreator {
selfdestruct(ownerAddress);
}
}
/*********************************/
/*********** CALC LIB ************/
/*********************************/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101735763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166210ed998114610178578063095ea7b31461028e57806323b872dd146102c65780632de3ad02146102f05780634dfa3f181461036557806366ec60c7146103fe57806369ddaad11461047057806370a08231146104855780637a55d4bd146104b85780637b24a251146106315780638925d7bb146106525780638f84aa09146106675780639bef0c471461067c5780639f468e8e14610631578063a0b43a4e14610712578063a9059cbb14610727578063ae014f1d1461074b578063b2a9ab9c1461076c578063b9d5d7fe14610781578063ba770154146107da578063c394690914610833578063cae9ca511461087f578063cb0cedb8146108e8578063d826f88f14610909578063dd62ed3e1461091e578063e554482e14610945578063e7eed1f71461095a578063ec64f52f1461096f578063f90f327814610977575b600080fd5b34801561018457600080fd5b506101906004356109d0565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156101ef5781810151838201526020016101d7565b50505050905090810190601f16801561021c5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b8381101561024f578181015183820152602001610237565b50505050905090810190601f16801561027c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561029a57600080fd5b506102b2600160a060020a0360043516602435610bb5565b604080519115158252519081900360200190f35b3480156102d257600080fd5b506102b2600160a060020a0360043581169060243516604435610bdf565b3480156102fc57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610349943694929360249392840191908190840183828082843750949750610c4e9650505050505050565b60408051600160a060020a039092168252519081900360200190f35b34801561037157600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103fc94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610cc19650505050505050565b005b34801561040a57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610457943694929360249392840191908190840183828082843750949750610f249650505050505050565b6040805192835260208301919091528051918290030190f35b34801561047c57600080fd5b506103fc610fb3565b34801561049157600080fd5b506104a6600160a060020a036004351661109e565b60408051918252519081900360200190f35b3480156104c457600080fd5b506104cd6110b0565b6040518086600160a060020a0316600160a060020a03168152602001858152602001806020018060200180602001848103845287818151815260200191508051906020019080838360005b83811015610530578181015183820152602001610518565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b50848103835286518152865160209182019188019080838360005b83811015610590578181015183820152602001610578565b50505050905090810190601f1680156105bd5780820380516001836020036101000a031916815260200191505b50848103825285518152855160209182019187019080838360005b838110156105f05781810151838201526020016105d8565b50505050905090810190601f16801561061d5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b34801561063d57600080fd5b506102b2600160a060020a0360043516611359565b34801561065e57600080fd5b506104a661138b565b34801561067357600080fd5b50610349611392565b34801561068857600080fd5b5061069d600160a060020a03600435166113a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156106d75781810151838201526020016106bf565b50505050905090810190601f1680156107045780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561071e57600080fd5b506104a6611460565b34801561073357600080fd5b506103fc600160a060020a0360043516602435611466565b34801561075757600080fd5b5061069d600160a060020a0360043516611475565b34801561077857600080fd5b506104a66114fd565b34801561078d57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103fc9436949293602493928401919081908401838280828437509497506115039650505050505050565b3480156107e657600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261069d9436949293602493928401919081908401838280828437509497506115e89650505050505050565b6040805160206004803580820135601f81018490048402850184019095528484526103fc9436949293602493928401919081908401838280828437509497506116a59650505050505050565b34801561088b57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102b2948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506117539650505050505050565b3480156108f457600080fd5b50610457600160a060020a036004351661186c565b34801561091557600080fd5b506103fc61188f565b34801561092a57600080fd5b506104a6600160a060020a03600435811690602435166118b4565b34801561095157600080fd5b506104a66118d1565b34801561096657600080fd5b506104a66118d7565b6103fc6118dc565b34801561098357600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103fc943694929360249392840191908190840183828082843750949750611c029650505050505050565b6000806060806012858154811015156109e557fe5b600091825260209091206003909102015460128054600160a060020a0390921695509086908110610a1257fe5b9060005260206000209060030201600101549250610a2f84611359565b15610a4457610a3d84611475565b9150610a56565b60408051602081019091526000815291505b600160a060020a03841660009081526003602052604090205460ff1615610b2057600160a060020a03841660009081526007602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610b145780601f10610ae957610100808354040283529160200191610b14565b820191906000526020600020905b815481529060010190602001808311610af757829003601f168201915b50505050509050610bae565b600c805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610ba65780601f10610b7b57610100808354040283529160200191610ba6565b820191906000526020600020905b815481529060010190602001808311610b8957829003601f168201915b505050505090505b9193509193565b336000908152600160208181526040808420600160a060020a039690961684529490529290205590565b600160a060020a0383166000908152600160209081526040808320338452909152812054821115610c0f57600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902080548390039055610c44848484611cd6565b5060019392505050565b6000806005836040518082805190602001908083835b60208310610c835780518252601f199092019160209182019101610c64565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a031695945050505050565b610cc9611ebc565b610cd233611359565b15610cdc57600080fd5b5060408051808201825233808252602080830186905260009182526004815292902084519192610d0f9290860190611ed4565b50336005846040518082805190602001908083835b60208310610d435780518252601f199092019160209182019101610d24565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039690961695909517909455505084518492600692879290918291908401908083835b60208310610dd05780518252601f199092019160209182019101610db1565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381019093208451610e119591949190910192509050611ed4565b503360009081526007602090815260409091208351610e3292850190611ed4565b50336000908152600860209081526040822082905560138054600181810180845592909452845160029091027f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09081018054600160a060020a039390931673ffffffffffffffffffffffffffffffffffffffff1990931692909217825585840151805193948794610ee8937f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a091019290910190611ed4565b50503360009081526002602090815260408083208054600160ff1991821681179092556003909352922080549091169091179055505050505050565b60008060006005846040518082805190602001908083835b60208310610f5b5780518252601f199092019160209182019101610f3c565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820190942054600160a060020a0316600090815260089091529290922054600d5490979088029650945050505050565b600954600160a060020a03163314610fca57600080fd5b60128054600b91906000198101908110610fe057fe5b90600052602060002090600302016002019080546001816001161561010002031660029004611010929190611f52565b5060128054600891600091600019810190811061102957fe5b60009182526020808320600390920290910154600160a060020a031683528201929092526040018120546012805460019290920192600892909190600019810190811061107257fe5b60009182526020808320600390920290910154600160a060020a03168352820192909252604001902055565b60006020819052908152604090205481565b600080606080606060126001601280549050038154811015156110cf57fe5b600091825260209091206003909102015460128054600160a060020a03909216965090600019810190811061110057fe5b9060005260206000209060030201600101549350601260016012805490500381548110151561112b57fe5b600091825260209182902060026003909202018101805460408051601f6000196101006001861615020190931694909404918201859004850284018501905280835291929091908301828280156111c35780601f10611198576101008083540402835291602001916111c3565b820191906000526020600020905b8154815290600101906020018083116111a657829003601f168201915b505050505092506111d385611359565b156111e8576111e185611475565b91506111fa565b60408051602081019091526000815291505b600160a060020a03851660009081526003602052604090205460ff16156112c457600160a060020a03851660009081526007602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156112b85780601f1061128d576101008083540402835291602001916112b8565b820191906000526020600020905b81548152906001019060200180831161129b57829003601f168201915b50505050509050611352565b600c805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561134a5780601f1061131f5761010080835404028352916020019161134a565b820191906000526020600020905b81548152906001019060200180831161132d57829003601f168201915b505050505090505b9091929394565b600160a060020a03811660009081526002602052604081205460ff161561138257506001611386565b5060005b919050565b6011545b90565b600954600160a060020a031681565b60606113ac82611359565b15156113b757600080fd5b600160a060020a03821660009081526007602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156114545780601f1061142957610100808354040283529160200191611454565b820191906000526020600020905b81548152906001019060200180831161143757829003601f168201915b50939695505050505050565b60105490565b611471338383611cd6565b5050565b606061148082611359565b151561148b57600080fd5b600160a060020a03821660009081526004602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156114545780601f1061142957610100808354040283529160200191611454565b600f5490565b600954600090600160a060020a0316331461151d57600080fd5b6005826040518082805190602001908083835b6020831061154f5780518252601f199092019160209182019101611530565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820190972054600160a060020a031660008181526007909252969020600c80549798506115c69791965094506002600182161590940290910116919091049050611f52565b50600160a060020a031660009081526008602052604090208054600101905550565b60606006826040518082805190602001908083835b6020831061161c5780518252601f1990920191602091820191016115fd565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188208054601f60026001831615909802909501169590950492830182900482028801820190528187529294509250508301828280156114545780601f1061142957610100808354040283529160200191611454565b336000908152600860205260408120548110156116db5733600090815260086020526040902054600d540234116116db57600080fd5b6012805460001981019081106116ed57fe5b6000918252602090912060039091020154600160a060020a0316905033811461171557600080fd5b60128054839190600019810190811061172a57fe5b9060005260206000209060030201600201908051906020019061174e929190611ed4565b505050565b6000836117608185610bb5565b15611864576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b838110156117f85781810151838201526020016117e0565b50505050905090810190601f1680156118255780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561184757600080fd5b505af115801561185b573d6000803e3d6000fd5b50505050600191505b509392505050565b600160a060020a038116600090815260086020526040902054600d548102915091565b600954600160a060020a031633146118a657600080fd5b600954600160a060020a0316ff5b600160209081526000928352604080842090915290825290205481565b60125490565b303190565b60006118e6611fc7565b6000806000611900601e6118fb346064611ddb565b611df7565b6012549095501561193e5760128054349190600019810190811061192057fe5b90600052602060002090600302016001015410151561193e57600080fd5b6040805160608101825233815234602080830191909152600b80548451601f6002600019610100600186161502019093169290920491820184900484028101840186528181529394850193928301828280156119db5780601f106119b0576101008083540402835291602001916119db565b820191906000526020600020905b8154815290600101906020018083116119be57829003601f168201915b5050509190925250506012805460018101808355600092909252825160039091027fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344481018054600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff199093169290921782556020808501517fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34458301556040850151805195995093948994611ab1937fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344601920190611ed4565b5050505034600f5401600f81905550611aca3486611e29565b60108054919091019055600a54604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015611b0e573d6000803e3d6000fd5b50611b17611e3b565b60ff16611b22611e61565b60ff161415611bd957339250826108fc611b48611b4130316064611ddb565b6046611df7565b6040518115909202916000818181858888f19350505050158015611b70573d6000803e3d6000fd5b50611b79611e84565b60ff169150601282815481101515611b8d57fe5b60009182526020822060039091020154604051600160a060020a0390911692508291303180156108fc02929091818181858888f19350505050158015611bd7573d6000803e3d6000fd5b505b611bef600e54611be7611e61565b60ff16611ead565b600e555050601180546001019055505050565b600954600090600160a060020a03163314611c1c57600080fd5b6005826040518082805190602001908083835b60208310611c4e5780518252601f199092019160209182019101611c2f565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852054858201825260048087527f4d69636b00000000000000000000000000000000000000000000000000000000878501908152600160a060020a039092166000818152919094529190912094519195506115c69493509150611ed4565b6000600160a060020a0383161515611ced57600080fd5b600160a060020a038416600090815260208190526040902054821115611d1257600080fd5b600160a060020a03831660009081526020819052604090205482810111611d3857600080fd5b50600160a060020a03808316600081815260208181526040808320805495891680855282852080548981039091559486905281548801909155815187815291519390950194927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3600160a060020a03808416600090815260208190526040808220549287168252902054018114611dd557fe5b50505050565b6000808284811515611de957fe5b0490508091505b5092915050565b600080831515611e0a5760009150611df0565b50828202828482811515611e1a57fe5b0414611e2257fe5b9392505050565b600082821115611e3557fe5b50900390565b600e546040805191825244602083015280519182900301902060009060fb905b06905090565b60408051428152446020820152815190819003909101902060009060fb90611e5b565b601254600e546040805191825244602083015280519182900301902060009190811515611e5b57fe5b600082820183811015611e2257fe5b60408051808201909152600081526060602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f1557805160ff1916838001178555611f42565b82800160010185558215611f42579182015b82811115611f42578251825591602001919060010190611f27565b50611f4e929150611fe6565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f8b5780548555611f42565b82800160010185558215611f4257600052602060002091601f016020900482015b82811115611f42578254825591600101919060010190611fac565b6040805160608181018352600080835260208301529181019190915290565b61138f91905b80821115611f4e5760008155600101611fec5600a165627a7a723058207b21df31c80dccef0b622ddc0b8ac10f7f745e912c446da0ced191b823318bfb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}]}}
| 2,337 |
0xf6c43ab377d37b0aad655b9bb12c60d48cced357
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract sarestoken is MintableToken{
string public name = "sarestoken";
string public symbol = "SARE";
uint public decimals = 0;
constructor (uint initialSupply) public{
totalSupply_ = initialSupply;
balances[msg.sender] = initialSupply;
}
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610125578063095ea7b3146101b557806318160ddd1461021a57806323b872dd14610245578063313ce567146102ca57806340c10f19146102f5578063661884631461035a57806370a08231146103bf578063715018a6146104165780637d64bcb41461042d5780638da5cb5b1461045c57806395d89b41146104b3578063a9059cbb14610543578063d73dd623146105a8578063dd62ed3e1461060d578063f2fde38b14610684575b600080fd5b34801561010257600080fd5b5061010b6106c7565b604051808215151515815260200191505060405180910390f35b34801561013157600080fd5b5061013a6106da565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017a57808201518184015260208101905061015f565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c157600080fd5b50610200600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610778565b604051808215151515815260200191505060405180910390f35b34801561022657600080fd5b5061022f61086a565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610874565b604051808215151515815260200191505060405180910390f35b3480156102d657600080fd5b506102df610c2e565b6040518082815260200191505060405180910390f35b34801561030157600080fd5b50610340600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c34565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1a565b604051808215151515815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ab565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b6110f3565b005b34801561043957600080fd5b506104426111f8565b604051808215151515815260200191505060405180910390f35b34801561046857600080fd5b506104716112c0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104bf57600080fd5b506104c86112e6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105085780820151818401526020810190506104ed565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054f57600080fd5b5061058e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611384565b604051808215151515815260200191505060405180910390f35b3480156105b457600080fd5b506105f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115a3565b604051808215151515815260200191505060405180910390f35b34801561061957600080fd5b5061066e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061179f565b6040518082815260200191505060405180910390f35b34801561069057600080fd5b506106c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611826565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107705780601f1061074557610100808354040283529160200191610770565b820191906000526020600020905b81548152906001019060200180831161075357829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108b157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108fe57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561098957600080fd5b6109da826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9257600080fd5b600360149054906101000a900460ff16151515610cae57600080fd5b610cc3826001546118a790919063ffffffff16565b600181905550610d1a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f2b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fbf565b610f3e838261188e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114f57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125657600080fd5b600360149054906101000a900460ff1615151561127257600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561137c5780601f106113515761010080835404028352916020019161137c565b820191906000526020600020905b81548152906001019060200180831161135f57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113c157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561140e57600080fd5b61145f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061163482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188257600080fd5b61188b816118c3565b50565b600082821115151561189c57fe5b818303905092915050565b600081830190508281101515156118ba57fe5b80905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118ff57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058200292ca8d591fd75682094c103bb84ed71665369437d9cc98e2498bffe6d033270029
|
{"success": true, "error": null, "results": {}}
| 2,338 |
0x2DFF79373D68BF4197bDAd4198DB2d8B924F7483
|
/**
*Submitted for verification at Etherscan.io on 2022-03-26
*/
// SPDX-License-Identifier: UNLICENSED
/**
t.me/beebeetoken
**/
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 BeeBeeToken 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 _feeAddrWallet1;
string private constant _name = "Bee Bee Token";
string private constant _symbol = "BBT";
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(_msgSender());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.div(100);
emit Transfer(address(_msgSender()), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
_feeAddr1 = 7;
_feeAddr2 = 5;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 minutes);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 7;
_feeAddr2 = 5;
}
require(cooldown[from] < block.timestamp);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 500000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function 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());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a1461030e578063c3c8cd801461032e578063c9567bf914610343578063dd62ed3e14610358578063e9e1831a1461039e57600080fd5b8063715018a6146102855780638da5cb5b1461029a57806395d89b41146102c2578063a9059cbb146102ee57600080fd5b8063273123b7116100dc578063273123b7146101d6578063313ce567146102145780635932ead1146102305780636fc3eaec1461025057806370a082311461026557600080fd5b806306fdde0314610119578063095ea7b31461016157806318160ddd1461019157806323b872dd146101b657600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600d81526c2132b2902132b2902a37b5b2b760991b60208201525b604051610158919061156b565b60405180910390f35b34801561016d57600080fd5b5061018161017c3660046115e5565b6103b3565b6040519015158152602001610158565b34801561019d57600080fd5b5067016345785d8a00005b604051908152602001610158565b3480156101c257600080fd5b506101816101d1366004611611565b6103ca565b3480156101e257600080fd5b506102126101f1366004611652565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561022057600080fd5b5060405160098152602001610158565b34801561023c57600080fd5b5061021261024b36600461167d565b610433565b34801561025c57600080fd5b50610212610484565b34801561027157600080fd5b506101a8610280366004611652565b610491565b34801561029157600080fd5b506102126104b3565b3480156102a657600080fd5b506000546040516001600160a01b039091168152602001610158565b3480156102ce57600080fd5b5060408051808201909152600381526210909560ea1b602082015261014b565b3480156102fa57600080fd5b506101816103093660046115e5565b610527565b34801561031a57600080fd5b506102126103293660046116b0565b610534565b34801561033a57600080fd5b5061021261065e565b34801561034f57600080fd5b50610212610674565b34801561036457600080fd5b506101a8610373366004611775565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103aa57600080fd5b5061021261089b565b60006103c0338484610a61565b5060015b92915050565b60006103d7848484610b85565b610429843361042485604051806060016040528060288152602001611972602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610eda565b610a61565b5060019392505050565b6000546001600160a01b031633146104665760405162461bcd60e51b815260040161045d906117ae565b60405180910390fd5b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761048e81610f14565b50565b6001600160a01b0381166000908152600260205260408120546103c490610f4e565b6000546001600160a01b031633146104dd5760405162461bcd60e51b815260040161045d906117ae565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c0338484610b85565b60005b815181101561065a57600d5482516001600160a01b0390911690839083908110610563576105636117e3565b60200260200101516001600160a01b0316141580156105b45750600e5482516001600160a01b03909116908390839081106105a0576105a06117e3565b60200260200101516001600160a01b031614155b80156105eb5750306001600160a01b03168282815181106105d7576105d76117e3565b60200260200101516001600160a01b031614155b1561064857600160066000848481518110610608576106086117e3565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806106528161180f565b915050610537565b5050565b600061066930610491565b905061048e81610fcb565b6000546001600160a01b0316331461069e5760405162461bcd60e51b815260040161045d906117ae565b600e54600160a01b900460ff16156106f85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045d565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610734308267016345785d8a0000610a61565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107969190611828565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108079190611828565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108789190611828565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108c55760405162461bcd60e51b815260040161045d906117ae565b600d546001600160a01b031663f305d71947306108e181610491565b6000806108f66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561095e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109839190611845565b5050600e805463ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190611873565b6000610a5a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611145565b9392505050565b6001600160a01b038316610ac35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045d565b6001600160a01b038216610b245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610be95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045d565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045d565b60008111610cad5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045d565b6001600160a01b03831660009081526006602052604090205460ff16158015610cef57506001600160a01b03821660009081526006602052604090205460ff16155b610cf857600080fd5b6007600a556005600b556000546001600160a01b03848116911614801590610d2e57506000546001600160a01b03838116911614155b15610eca57600e546001600160a01b038481169116148015610d5e5750600d546001600160a01b03838116911614155b8015610d8357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d985750600e54600160b81b900460ff165b15610dd257600f54811115610dac57600080fd5b610db842610708611890565b6001600160a01b0383166000908152600760205260409020555b600d546001600160a01b03848116911614801590610e0957506001600160a01b03831660009081526005602052604090205460ff16155b15610e5357600e546001600160a01b0390811690831603610e2f576007600a556005600b555b6001600160a01b0383166000908152600760205260409020544211610e5357600080fd5b6000610e5e30610491565b600e54909150600160a81b900460ff16158015610e895750600e546001600160a01b03858116911614155b8015610e9e5750600e54600160b01b900460ff165b15610ec857610eac81610fcb565b476706f05b59d3b20000811115610ec657610ec647610f14565b505b505b610ed5838383611173565b505050565b60008184841115610efe5760405162461bcd60e51b815260040161045d919061156b565b506000610f0b84866118a8565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561065a573d6000803e3d6000fd5b6000600854821115610fb55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045d565b6000610fbf61117e565b9050610a5a8382610a18565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611013576110136117e3565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561106c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110909190611828565b816001815181106110a3576110a36117e3565b6001600160a01b039283166020918202929092010152600d546110c99130911684610a61565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111029085906000908690309042906004016118bf565b600060405180830381600087803b15801561111c57600080fd5b505af1158015611130573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600081836111665760405162461bcd60e51b815260040161045d919061156b565b506000610f0b8486611930565b610ed58383836111a1565b600080600061118b611298565b909250905061119a8282610a18565b9250505090565b6000806000806000806111b3876112d8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e59087611335565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112149086611377565b6001600160a01b038916600090815260026020526040902055611236816113d6565b6112408483611420565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128591815260200190565b60405180910390a3505050505050505050565b600854600090819067016345785d8a00006112b38282610a18565b8210156112cf5750506008549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006112f58a600a54600b54611444565b925092509250600061130561117e565b905060008060006113188e878787611499565b919e509c509a509598509396509194505050505091939550919395565b6000610a5a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610eda565b6000806113848385611890565b905083811015610a5a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045d565b60006113e061117e565b905060006113ee83836114e9565b3060009081526002602052604090205490915061140b9082611377565b30600090815260026020526040902055505050565b60085461142d9083611335565b60085560095461143d9082611377565b6009555050565b600080808061145e606461145889896114e9565b90610a18565b9050600061147160646114588a896114e9565b90506000611489826114838b86611335565b90611335565b9992985090965090945050505050565b60008080806114a888866114e9565b905060006114b688876114e9565b905060006114c488886114e9565b905060006114d6826114838686611335565b939b939a50919850919650505050505050565b6000826000036114fb575060006103c4565b60006115078385611952565b9050826115148583611930565b14610a5a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045d565b600060208083528351808285015260005b818110156115985785810183015185820160400152820161157c565b818111156115aa576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461048e57600080fd5b80356115e0816115c0565b919050565b600080604083850312156115f857600080fd5b8235611603816115c0565b946020939093013593505050565b60008060006060848603121561162657600080fd5b8335611631816115c0565b92506020840135611641816115c0565b929592945050506040919091013590565b60006020828403121561166457600080fd5b8135610a5a816115c0565b801515811461048e57600080fd5b60006020828403121561168f57600080fd5b8135610a5a8161166f565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116c357600080fd5b823567ffffffffffffffff808211156116db57600080fd5b818501915085601f8301126116ef57600080fd5b8135818111156117015761170161169a565b8060051b604051601f19603f830116810181811085821117156117265761172661169a565b60405291825284820192508381018501918883111561174457600080fd5b938501935b828510156117695761175a856115d5565b84529385019392850192611749565b98975050505050505050565b6000806040838503121561178857600080fd5b8235611793816115c0565b915060208301356117a3816115c0565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611821576118216117f9565b5060010190565b60006020828403121561183a57600080fd5b8151610a5a816115c0565b60008060006060848603121561185a57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561188557600080fd5b8151610a5a8161166f565b600082198211156118a3576118a36117f9565b500190565b6000828210156118ba576118ba6117f9565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561190f5784516001600160a01b0316835293830193918301916001016118ea565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261194d57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561196c5761196c6117f9565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b1f0cd4e0143fe1d4ee4acbabd7a8665edf34b971c8e159a2ba48fc991f1ee5164736f6c634300080d0033
|
{"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"}]}}
| 2,339 |
0x8e1444684fe016f616be5cf9f2f967ec74958755
|
/**Network manifests itself as a decentralized financial network and platform without the need of interference by an intermediary. Anyone who joined the Network earns universal basic income by contributing to dedicated activities.
* The Network, fueled by a native token CFRN and built on top of the smart contract platform, aims at creating decentralized services.
*/
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 Coinfarm {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582049bda42d5a9419176521ff1fe2b1cf4d79f3a474ca7a553614eebec9acccf14564736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 2,340 |
0x203a29fdbe0fb1f608a7b4f67f7307668ddcf2c7
|
/**
*Submitted for verification at Etherscan.io on 2022-01-19
*/
/*
丂闩爪ㄩ尺讠𝓝ㄩ
A new token called $SAMINU will be launching tomorrow that's combining the best of $SHINJA along with NFT P2E.
The developer of this token is well-known. One of their best ones hit over $75 million dollar market cap.
I think the trailer and website is well done. Would recommend anyone to check this out immediately.
Be sure to do your research and do your due diligence!
Mission Statement:
Samurinu -The last Inu Dynasty is the future of gaming, where players will win tokens while being immersed in an exciting open world scenario inhabited by mythical and ancient creatures.
This thrilling gaming experience will effectively be integrated within the Ethereum blockchain, and will have a decentralized ecosystem containing unique NFT characters and power-ups, a marketplace, and its own token $SAMINU, increasing the value for our community and becoming a benchmark in the space.
https://samurinu.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 Samurinu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Samurinu ' ;
string private _symbol = 'SAMINU ' ;
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220df7b2bff3d01cd3639d5fac146144dce7f7171bef92962e74a220fdf3da49cfa64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,341 |
0x6e13c38eb8c5659d98ad0c547430f9311ebaad18
|
/**
*Submitted for verification at Etherscan.io on 2021-03-24
*/
pragma solidity 0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract MuteGovernance {
using SafeMath for uint256;
mapping (address => address) internal _delegates;
struct Checkpoint {
uint32 fromBlock;
uint256 votes;
}
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
mapping (address => uint32) public numCheckpoints;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
mapping (address => uint) public nonces;
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
function delegates(address delegator) external view returns (address) {
return _delegates[delegator];
}
function getCurrentVotes(address account) external view returns (uint256) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) {
require(blockNumber < block.number, "Gov::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint256 srcRepNew = srcRepOld.sub(amount);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint256 dstRepNew = dstRepOld.add(amount);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Gov::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
contract Mute is MuteGovernance {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint16 public TAX_FRACTION;
address public taxReceiveAddress;
bool public isTaxEnabled;
mapping(address => bool) public nonTaxedAddresses;
address private _owner = address(0);
mapping (address => bool) private _minters;
uint256 public vaultThreshold;
address public _dao;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
modifier onlyOwner() {
require(msg.sender == _owner, "Mute::OnlyOwner: Not the owner");
_;
}
modifier onlyMinter() {
require(_minters[msg.sender] == true);
_;
}
modifier onlyDAO() {
require(_owner == msg.sender || _dao == msg.sender, "Mute::onlyDAO: caller is not the dao");
_;
}
function initialize() public {
require(_owner == address(0), "Mute::Initialize: Contract has already been initialized");
_owner = msg.sender;
_name = "Mute.io";
_symbol = "MUTE";
_decimals = 18;
TAX_FRACTION = 100;
vaultThreshold = 10000 * 10 ** 18;
nonTaxedAddresses[msg.sender] = true;
}
function setDAO(address dao) external onlyOwner {
_dao = dao;
}
function addMinter(address account) external onlyOwner {
require(account != address(0));
_minters[account] = true;
}
function removeMinter(address account) external onlyOwner {
require(account != address(0));
_minters[account] = false;
}
function setVaultThreshold(uint256 _vaultThreshold) external onlyDAO {
vaultThreshold = _vaultThreshold;
}
function setTaxReceiveAddress(address _taxReceiveAddress) external onlyDAO {
taxReceiveAddress = _taxReceiveAddress;
}
function setAddressTax(address _address, bool ignoreTax) external onlyDAO {
nonTaxedAddresses[_address] = ignoreTax;
}
function setTaxFraction(uint16 _tax_fraction) external onlyDAO {
TAX_FRACTION = _tax_fraction;
}
function owner() public view returns (address) {
return _owner;
}
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 returns (uint256) {
return _totalSupply;
}
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 recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
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, "Mute: transfer amount exceeds allowance"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "Mute: transfer from the zero address");
require(recipient != address(0), "Mute: transfer to the zero address");
if(nonTaxedAddresses[sender] == true || TAX_FRACTION == 0 || balanceOf(taxReceiveAddress) > vaultThreshold){
_balances[sender] = _balances[sender].sub(amount, "Mute: transfer amount exceeds balance");
if(balanceOf(taxReceiveAddress) > vaultThreshold){
IMuteVault(taxReceiveAddress).reward();
}
_balances[recipient] = _balances[recipient].add(amount);
_moveDelegates(_delegates[sender], _delegates[recipient], amount);
emit Transfer(sender, recipient, amount);
return;
}
uint256 feeAmount = amount.mul(TAX_FRACTION).div(10000);
uint256 newAmount = amount.sub(feeAmount);
require(amount == feeAmount.add(newAmount), "Mute: math is broken");
_balances[sender] = _balances[sender].sub(amount, "Mute: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(newAmount);
_moveDelegates(_delegates[sender], _delegates[recipient], newAmount);
_balances[taxReceiveAddress] = _balances[taxReceiveAddress].add(feeAmount);
_moveDelegates(_delegates[sender], _delegates[taxReceiveAddress], feeAmount);
emit Transfer(sender, recipient, newAmount);
emit Transfer(sender, taxReceiveAddress, feeAmount);
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(msg.sender, spender, 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, "Mute: decreased allowance below zero"));
return true;
}
function _approve(address owner_, address spender, uint256 amount) internal {
require(owner_ != address(0), "Mute: approve from the zero address");
require(spender != address(0), "Mute: approve to the zero address");
_allowances[owner_][spender] = amount;
emit Approval(owner_, spender, amount);
}
function Burn(uint256 amount) external returns (bool) {
require(msg.sender != address(0), "Mute: burn from the zero address");
_moveDelegates(_delegates[msg.sender], address(0), amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount, "Mute: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
function Mint(address account, uint256 amount) external onlyMinter returns (bool) {
require(account != address(0), "Mute: mint to the zero address");
_moveDelegates(address(0), _delegates[account], amount);
_balances[account] = _balances[account].add(amount);
_totalSupply = _totalSupply.add(amount);
emit Transfer(address(0), account, amount);
return true;
}
function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Mute::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Mute::delegateBySig: invalid nonce");
require(now <= expiry, "Mute::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = _delegates[delegator];
uint256 delegatorBalance = balanceOf(delegator);
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
}
interface IMuteVault {
function reward() external returns (bool);
}
|
0x608060405234801561001057600080fd5b50600436106102325760003560e01c80638da5cb5b11610130578063ba6047f4116100b8578063e06837261161007c578063e068372614610c49578063e6c1909b14610c7d578063e73a914c14610c9d578063e7a324dc14610ce1578063f1127ed814610cff57610232565b8063ba6047f414610ad6578063c3cda52014610b08578063ca65d3fa14610b81578063ccb75d7f14610baf578063dd62ed3e14610bd157610232565b8063a457c2d7116100ff578063a457c2d714610918578063a9059cbb1461097c578063b4b5ea57146109e0578063b8337daf14610a38578063b90306ad14610a9257610232565b80638da5cb5b146107e957806395d89b411461081d578063983b2d56146108a0578063a1bd2a66146108e457610232565b806339509351116101be57806370a082311161018257806370a0823114610689578063782d6fe1146106e15780637c78421c146107435780637ecebe00146107875780638129fc1c146107df57610232565b806339509351146104c5578063587cde1e146105295780635c19a95c146105975780636aea7bf7146105db5780636fcfff451461062b57610232565b806320606b701161020557806320606b70146103a057806323b872dd146103be5780633092afd51461044257806330fd85d314610486578063313ce567146104a457610232565b806306fdde0314610237578063095ea7b3146102ba5780630f6798a51461031e57806318160ddd14610382575b600080fd5b61023f610d74565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027f578082015181840152602081019050610264565b50505050905090810190601f1680156102ac5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610306600480360360408110156102d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e16565b60405180821515815260200191505060405180910390f35b61036a6004803603604081101561033457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b61038a6110b9565b6040518082815260200191505060405180910390f35b6103a86110c3565b6040518082815260200191505060405180910390f35b61042a600480360360608110156103d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e7565b60405180821515815260200191505060405180910390f35b6104846004803603602081101561045857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b2565b005b61048e61130a565b6040518082815260200191505060405180910390f35b6104ac611310565b604051808260ff16815260200191505060405180910390f35b610511600480360360408110156104db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611327565b60405180821515815260200191505060405180910390f35b61056b6004803603602081101561053f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113cc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105d9600480360360208110156105ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611434565b005b610629600480360360408110156105f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611441565b005b61066d6004803603602081101561064157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061159a565b604051808263ffffffff16815260200191505060405180910390f35b6106cb6004803603602081101561069f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115bd565b6040518082815260200191505060405180910390f35b61072d600480360360408110156106f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611606565b6040518082815260200191505060405180910390f35b6107856004803603602081101561075957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c7565b005b6107c96004803603602081101561079d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b09565b6040518082815260200191505060405180910390f35b6107e7611b21565b005b6107f1611d46565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610825611d70565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561086557808201518184015260208101905061084a565b50505050905090810190601f1680156108925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108e2600480360360208110156108b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e12565b005b6108ec611f6a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6109646004803603604081101561092e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f90565b60405180821515815260200191505060405180910390f35b6109c86004803603604081101561099257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061204f565b60405180821515815260200191505060405180910390f35b610a22600480360360208110156109f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612066565b6040518082815260200191505060405180910390f35b610a7a60048036036020811015610a4e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061213c565b60405180821515815260200191505060405180910390f35b610abe60048036036020811015610aa857600080fd5b810190808035906020019092919050505061215c565b60405180821515815260200191505060405180910390f35b610b0660048036036020811015610aec57600080fd5b81019080803561ffff1690602001909291905050506123a3565b005b610b7f600480360360c0811015610b1e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803560ff16906020019092919080359060200190929190803590602001909291905050506124c1565b005b610bad60048036036020811015610b9757600080fd5b8101908080359060200190929190505050612825565b005b610bb761292d565b604051808261ffff16815260200191505060405180910390f35b610c3360048036036040811015610be757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612941565b6040518082815260200191505060405180910390f35b610c516129c8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c856129ee565b60405180821515815260200191505060405180910390f35b610cdf60048036036020811015610cb357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a01565b005b610ce9612b08565b6040518082815260200191505060405180910390f35b610d5160048036036040811015610d1557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803563ffffffff169060200190929190505050612b2c565b604051808363ffffffff1681526020018281526020019250505060405180910390f35b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e0c5780601f10610de157610100808354040283529160200191610e0c565b820191906000526020600020905b815481529060010190602001808311610def57829003601f168201915b5050505050905090565b6000610e23338484612b6d565b6001905092915050565b600060011515600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610e8c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d7574653a206d696e7420746f20746865207a65726f2061646472657373000081525060200191505060405180910390fd5b610f9960008060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612d64565b610feb82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461300190919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110438260065461300190919063ffffffff16565b6006819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600654905090565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60006110f4848484613089565b6111a784336111a28560405180606001604052806027815260200161445360279139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b319092919063ffffffff16565b612b6d565b600190509392505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d7574653a3a4f6e6c794f776e65723a204e6f7420746865206f776e6572000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112af57600080fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d5481565b6000600960009054906101000a900460ff16905090565b60006113c233846113bd85600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461300190919063ffffffff16565b612b6d565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61143e3382613bf1565b50565b3373ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806114ea57503373ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61153f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061453b6024913960400191505060405180910390fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60026020528060005260406000206000915054906101000a900463ffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000438210611660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061437b6026913960400191505060405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1614156116cd5760009150506119c1565b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16116117b757600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff168152602001908152602001600020600101549150506119c1565b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611156118385760009150506119c1565b6000806001830390505b8163ffffffff168163ffffffff16111561195b576000600283830363ffffffff168161186a57fe5b048203905061187761429c565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600182015481525050905086816000015163ffffffff161415611933578060200151955050505050506119c1565b86816000015163ffffffff16101561194d57819350611954565b6001820392505b5050611842565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206001015493505050505b92915050565b3373ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611a7057503373ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611ac5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061453b6024913960400191505060405180910390fd5b80600960036101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60036020528060005260406000206000915090505481565b600073ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611bc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806144bf6037913960400191505060405180910390fd5b33600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060400160405280600781526020017f4d7574652e696f0000000000000000000000000000000000000000000000000081525060079080519060200190611c549291906142bc565b506040518060400160405280600481526020017f4d5554450000000000000000000000000000000000000000000000000000000081525060089080519060200190611ca09291906142bc565b506012600960006101000a81548160ff021916908360ff1602179055506064600960016101000a81548161ffff021916908361ffff16021790555069021e19e0c9bab2400000600d819055506001600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e085780601f10611ddd57610100808354040283529160200191611e08565b820191906000526020600020905b815481529060010190602001808311611deb57829003601f168201915b5050505050905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ed5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d7574653a3a4f6e6c794f776e65723a204e6f7420746865206f776e6572000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f0f57600080fd5b6001600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006120453384612040856040518060600160405280602481526020016143a160249139600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b319092919063ffffffff16565b612b6d565b6001905092915050565b600061205c338484613089565b6001905092915050565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff16116120d0576000612134565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff168152602001908152602001600020600101545b915050919050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415612200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d7574653a206275726e2066726f6d20746865207a65726f206164647265737381525060200191505060405180910390fd5b61226a6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600084612d64565b6122d68260405180606001604052806021815260200161435a60219139600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b319092919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232e82600654613d6090919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061244c57503373ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6124a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061453b6024913960400191505060405180910390fd5b80600960016101000a81548161ffff021916908361ffff16021790555050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666124ec610d74565b805190602001206124fb613daa565b30604051602001808581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019450505050506040516020818303038152906040528051906020012090506000828260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561267f573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612711576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806143e66026913960400191505060405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505589146127b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061449d6022913960400191505060405180910390fd5b8742111561280f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806145926026913960400191505060405180910390fd5b612819818b613bf1565b50505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806128ce57503373ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061453b6024913960400191505060405180910390fd5b80600d8190555050565b600960019054906101000a900461ffff1681565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960179054906101000a900460ff1681565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ac4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d7574653a3a4f6e6c794f776e65723a204e6f7420746865206f776e6572000081525060200191505060405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6001602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060010154905082565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612bf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061447a6023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c79576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806143c56021913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612da05750600081115b15612ffc57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612ed0576000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611612e43576000612ea7565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff168152602001908152602001600020600101545b90506000612ebe8483613d6090919063ffffffff16565b9050612ecc86848484613db7565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612ffb576000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611612f6e576000612fd2565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff168152602001908152602001600020600101545b90506000612fe9848361300190919063ffffffff16565b9050612ff785848484613db7565b5050505b5b505050565b60008082840190508381101561307f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561310f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806144f66024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613195576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806144316022913960400191505060405180910390fd5b60011515600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148061320857506000600960019054906101000a900461ffff1661ffff16145b8061323e5750600d5461323c600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115bd565b115b15613593576132af8160405180606001604052806025815260200161440c60259139600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b319092919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54613320600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115bd565b11156133cd57600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663228cb7336040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561339057600080fd5b505af11580156133a4573d6000803e3d6000fd5b505050506040513d60208110156133ba57600080fd5b8101908080519060200190929190505050505b61341f81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461300190919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135296000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683612d64565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613b2c565b60006135d06127106135c2600960019054906101000a900461ffff1661ffff168561404b90919063ffffffff16565b6140d190919063ffffffff16565b905060006135e78284613d6090919063ffffffff16565b90506135fc818361300190919063ffffffff16565b8314613670576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d7574653a206d6174682069732062726f6b656e00000000000000000000000081525060200191505060405180910390fd5b6136dc8360405180606001604052806025815260200161440c60259139600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613b319092919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061377181600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461300190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061387b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683612d64565b6138ef8260046000600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461300190919063ffffffff16565b60046000600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a3d6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600080600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612d64565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600960039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505b505050565b6000838311158290613bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613ba3578082015181840152602081019050613b88565b50505050905090810190601f168015613bd05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000613c5f846115bd565b9050826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4613d5a828483612d64565b50505050565b6000613da283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613b31565b905092915050565b6000804690508091505090565b6000613ddb4360405180606001604052806033815260200161455f6033913961411b565b905060008463ffffffff16118015613e7057508063ffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15613ee15781600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060010181905550613fee565b60405180604001604052808263ffffffff16815260200183815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff1602179055506020820151816001015590505060018401600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051808381526020018281526020019250505060405180910390a25050505050565b60008083141561405e57600090506140cb565b600082840290508284828161406f57fe5b04146140c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061451a6021913960400191505060405180910390fd5b809150505b92915050565b600061411383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506141d6565b905092915050565b6000640100000000831082906141cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614191578082015181840152602081019050614176565b50505050905090810190601f1680156141be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5082905092915050565b60008083118290614282576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561424757808201518184015260208101905061422c565b50505050905090810190601f1680156142745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161428e57fe5b049050809150509392505050565b6040518060400160405280600063ffffffff168152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106142fd57805160ff191683800117855561432b565b8280016001018555821561432b579182015b8281111561432a57825182559160200191906001019061430f565b5b509050614338919061433c565b5090565b5b8082111561435557600081600090555060010161433d565b509056fe4d7574653a206275726e20616d6f756e7420657863656564732062616c616e6365476f763a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e65644d7574653a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4d7574653a20617070726f766520746f20746865207a65726f20616464726573734d7574653a3a64656c656761746542795369673a20696e76616c6964207369676e61747572654d7574653a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d7574653a207472616e7366657220746f20746865207a65726f20616464726573734d7574653a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654d7574653a20617070726f76652066726f6d20746865207a65726f20616464726573734d7574653a3a64656c656761746542795369673a20696e76616c6964206e6f6e63654d7574653a3a496e697469616c697a653a20436f6e74726163742068617320616c7265616479206265656e20696e697469616c697a65644d7574653a207472616e736665722066726f6d20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d7574653a3a6f6e6c7944414f3a2063616c6c6572206973206e6f74207468652064616f476f763a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d7574653a3a64656c656761746542795369673a207369676e61747572652065787069726564a2646970667358221220880c055ab3415041aaff85b02e9bd6d038409ab1bf7c1620b672e62dd63c90e264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,342 |
0xf2ebb20a325fe25efd86f598a2bdbd3ca6ee23da
|
/*
Telegram: https://t.me/whalecumofficial
Website: https://whalecum.net/
WhaleCum will launch without a presale, neither private nor public, with anti bot measures in place. Liquidity will be provided by the devs, who will be rewarded by a 5-6% transaction fee directly in Ethereum to prevent dumping. The devs will own 0 WhaleCum tokens unless they personally decide to buy on Launch, like the rest of the community members.
*Anti Bot measures includes a buy limit at launch as well as a cooldown timer to prevent bots or any person to buy large stacks.
*Devs are rewarded in Ethereum, by a small transaction fee. No marketing/team wallets are present, the devs can't dump $WCUM by design.
*Everyone can participate in the launch, no public or private presale.
Token Information
1. 1,000,000,000,000 Total Supply
2. 0,2% transaction buy limit on launch (will be lifted after launch)
3. Sells limited to <2.5% price impact (lower than 2.5%)
4. Sell cooldown increases on consecutive sells, 4 sells within a 8 hours period are allowed (1H, 2H, 4H, 8H)
5. 2% redistribution to holders on all buys
6. 2% goes to liquidity
7. 3% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
8. 5-6% developer fee split within the team
*/
/*
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 WhaleCum is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "WhaleCum";
string private constant _symbol = "WCUM";
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;
uint256 private _liquidityFee = 2;
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 _numTokensSellToAddToLiquidity = 1.5 * 10**9 * 10**9;
uint256 private _maxTxAmount = _tTotal;
uint256 private _totalTeamFee = 0;
uint256 private _totalLiquidityFee = 0;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity,
uint256 contractTokenBalance
);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Create a uniswap pair for this new token
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
// set the rest of the contract variables
uniswapV2Router = _uniswapV2Router;
_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 && _liquidityFee == 0) return;
_taxFee = 0;
_teamFee = 0;
_liquidityFee = 0;
}
function restoreAllFee() private {
_taxFee = 3;
_teamFee = 5;
_liquidityFee = 2;
}
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");
uint256 contractTokenBalance = _totalLiquidityFee;
bool overMinTokenBalance =
contractTokenBalance >= _numTokensSellToAddToLiquidity;
if (overMinTokenBalance && !inSwap && from != uniswapV2Pair) {
contractTokenBalance = _numTokensSellToAddToLiquidity;
swapAndLiquify(contractTokenBalance);
_totalLiquidityFee = _totalLiquidityFee.sub(contractTokenBalance);
}
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;
}
contractTokenBalance = _totalTeamFee;
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(25).div(1000) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (8 hours) < 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 + (4 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (8 hours);
}
swapTokensForEth(contractTokenBalance);
_totalTeamFee = 0;
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, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_totalTeamFee = _totalTeamFee.add(rTeam);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity.mul(currentRate);
_totalLiquidityFee = _totalLiquidityFee.add(rLiquidity);
_rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);
}
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) {
uint256 __tAmount = tAmount;
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam, uint256 tLiquidity) = _getTValues(__tAmount, _taxFee, _teamFee, _liquidityFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(__tAmount, tFee, tTeam, tLiquidity, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam, tLiquidity);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee, uint256 liquidityFee) private pure returns (uint256, uint256, uint256, uint256) {
uint256 __tAmount = tAmount;
uint256 tFee = __tAmount.mul(taxFee).div(100);
uint256 tTeam = __tAmount.mul(teamFee).div(100);
uint256 tLiquidity = __tAmount.mul(liquidityFee).div(100);
uint256 tTransferAmount = __tAmount.sub(tFee).sub(tTeam).sub(tLiquidity);
return (tTransferAmount, tFee, tTeam, tLiquidity);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rLiquidity = tLiquidity.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam).sub(rLiquidity);
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 maxTxAmount) external onlyOwner() {
require(maxTxAmount > 0, "Amount must be greater than 0");
_maxTxAmount = maxTxAmount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
// split the contract balance into halves
uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current BNB balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for BNB
swapTokensForETH(half);
// how much BNB did we just swap into?
uint256 newBalance = address(this).balance.sub(initialBalance);
// add liquidity to uniswap
addLiquidity(otherHalf, newBalance);
emit SwapAndLiquify(half, newBalance, otherHalf, contractTokenBalance);
}
function swapTokensForETH(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b60405161013091906138d1565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190613458565b610418565b60405161016d91906138b6565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613a53565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190613409565b610447565b6040516101d591906138b6565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b6040516102009190613b0d565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190613494565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b919061337b565b61064d565b60405161027d9190613a53565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf91906137e8565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea91906138d1565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190613458565b610857565b60405161032791906138b6565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b50610385600480360381019061038091906134e6565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a991906133cd565b610ad5565b6040516103bb9190613a53565b60405180910390f35b3480156103d057600080fd5b506103d9610b5c565b005b60606040518060400160405280600881526020017f5768616c6543756d000000000000000000000000000000000000000000000000815250905090565b600061042c610425611068565b8484611070565b6001905092915050565b6000683635c9adc5dea00000905090565b600061045484848461123b565b61051584610460611068565b610510856040518060600160405280602881526020016140f760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611068565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120bf9092919063ffffffff16565b611070565b600190509392505050565b60006009905090565b610531611068565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906139b3565b60405180910390fd5b80601360186101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611068565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a81612123565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221e565b9050919050565b6106a6611068565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906139b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5743554d00000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611068565b848461123b565b6001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611068565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec8161228c565b50565b6108f7611068565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906139b3565b60405180910390fd5b601360159054906101000a900460ff1661099d57600080fd5b6001601360146101000a81548160ff021916908315150217905550565b6109c2611068565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906139b3565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990613973565b60405180910390fd5b806015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610aca9190613a53565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b64611068565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be8906139b3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c8130601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611070565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc757600080fd5b505afa158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cff91906133a4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6157600080fd5b505afa158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9991906133a4565b6040518363ffffffff1660e01b8152600401610db6929190613803565b602060405180830381600087803b158015610dd057600080fd5b505af1158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0891906133a4565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e913061064d565b600080610e9c6107f1565b426040518863ffffffff1660e01b8152600401610ebe96959493929190613855565b6060604051808303818588803b158015610ed757600080fd5b505af1158015610eeb573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f10919061350f565b5050506001601360176101000a81548160ff0219169083151502179055506001601360186101000a81548160ff0219169083151502179055506001601360156101000a81548160ff0219169083151502179055506729a2241af62c0000601581905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161101292919061382c565b602060405180830381600087803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106491906134bd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d790613a13565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790613933565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161122e9190613a53565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a2906139f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561131b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611312906138f3565b60405180910390fd5b6000811161135e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611355906139d3565b60405180910390fd5b60006017549050600060145482101590508080156113895750601360169054906101000a900460ff16155b80156113e35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156114125760145491506113f682612586565b61140b8260175461265e90919063ffffffff16565b6017819055505b61141a6107f1565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415801561148857506114586107f1565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ffa57601360189054906101000a900460ff16156116bb573073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415801561150a57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156115be5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156116ba57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611604611068565b73ffffffffffffffffffffffffffffffffffffffff16148061167a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611662611068565b73ffffffffffffffffffffffffffffffffffffffff16145b6116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613a33565b60405180910390fd5b5b5b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561175f5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61176857600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480156118135750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118695750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118815750601360189054906101000a900460ff165b1561195a57601360149054906101000a900460ff1661189f57600080fd5b6015548311156118ae57600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118f957600080fd5b601e426119069190613b7d565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b6016549150601360169054906101000a900460ff161580156119ca5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156119e25750601360179054906101000a900460ff165b15611ff957611a396103e8611a2b6019611a1d601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b6126a890919063ffffffff16565b61272390919063ffffffff16565b8311158015611a4a57506015548311155b611a5357600080fd5b42600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a9e57600080fd5b42617080600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aec9190613b7d565b1015611b38576000600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611c6f57600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611bd090613d2c565b919050555042600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611c279190613b7d565b600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f86565b6001600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611d6257600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d0790613d2c565b9190505550611c2042611d1a9190613b7d565b600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f85565b6002600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611e5557600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611dfa90613d2c565b919050555061384042611e0d9190613b7d565b600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f84565b6003600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f8357600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611eed90613d2c565b9190505550617080600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f3f9190613b7d565b600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f8f8261228c565b600060168190555060004790506000811115611faf57611fae47612123565b5b611ff7600f60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461276d565b505b5b600060019050600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120a15750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120ab57600090505b6120b786868684612796565b505050505050565b6000838311158290612107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fe91906138d1565b60405180910390fd5b50600083856121169190613c5e565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61217360028461272390919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561219e573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121ef60028461272390919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561221a573d6000803e3d6000fd5b5050565b6000600654821115612265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225c90613913565b60405180910390fd5b600061226f6127dd565b9050612284818461272390919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156123185781602001602082028036833780820191505090505b5090503081600081518110612356577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123f857600080fd5b505afa15801561240c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243091906133a4565b8160018151811061246a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124d130601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611070565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612535959493929190613a6e565b600060405180830381600087803b15801561254f57600080fd5b505af1158015612563573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6001601360166101000a81548160ff02191690831515021790555060006125b760028361272390919063ffffffff16565b905060006125ce828461265e90919063ffffffff16565b905060004790506125de83612808565b60006125f3824761265e90919063ffffffff16565b90506125ff8382612acc565b7f93efcf28fbf701a930e0ad258987a2e4f08eb3aa99f9c02029e7ba049f69405f848285886040516126349493929190613ac8565b60405180910390a1505050506000601360166101000a81548160ff02191690831515021790555050565b60006126a083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120bf565b905092915050565b6000808314156126bb576000905061271d565b600082846126c99190613c04565b90508284826126d89190613bd3565b14612718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270f90613993565b60405180910390fd5b809150505b92915050565b600061276583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612bc0565b905092915050565b8060085461277b9190613c04565b600881905550600181111561279357600a6009819055505b50565b806127a4576127a3612c23565b5b6127af848484612c6a565b806127bd576127bc6127c3565b5b50505050565b600360088190555060056009819055506002600a81905550565b60008060006127ea612e43565b91509150612801818361272390919063ffffffff16565b9250505090565b6000600267ffffffffffffffff81111561284b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156128795781602001602082028036833780820191505090505b50905030816000815181106128b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561295957600080fd5b505afa15801561296d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299191906133a4565b816001815181106129cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612a3230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611070565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612a96959493929190613a6e565b600060405180830381600087803b158015612ab057600080fd5b505af1158015612ac4573d6000803e3d6000fd5b505050505050565b612af930601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611070565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080612b456107f1565b426040518863ffffffff1660e01b8152600401612b6796959493929190613855565b6060604051808303818588803b158015612b8057600080fd5b505af1158015612b94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612bb9919061350f565b5050505050565b60008083118290612c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bfe91906138d1565b60405180910390fd5b5060008385612c169190613bd3565b9050809150509392505050565b6000600854148015612c3757506000600954145b8015612c4557506000600a54145b15612c4f57612c68565b600060088190555060006009819055506000600a819055505b565b6000806000806000806000612c7e88612ea5565b9650965096509650965096509650612cde87600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265e90919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d7386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f2190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dbf82612f7f565b612dc881613057565b612dd2858461312f565b8873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051612e2f9190613a53565b60405180910390a350505050505050505050565b600080600060065490506000683635c9adc5dea000009050612e79683635c9adc5dea0000060065461272390919063ffffffff16565b821015612e9857600654683635c9adc5dea00000935093505050612ea1565b81819350935050505b9091565b600080600080600080600080889050600080600080612ecc85600854600954600a54613169565b93509350935093506000612ede6127dd565b90506000806000612ef28988888888613249565b9250925092508282828a8a8a8a9f509f509f509f509f509f509f50505050505050505050919395979092949650565b6000808284612f309190613b7d565b905083811015612f75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f6c90613953565b60405180910390fd5b8091505092915050565b6000612f896127dd565b90506000612fa082846126a890919063ffffffff16565b9050612fb781601654612f2190919063ffffffff16565b60168190555061300f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f2190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b60006130616127dd565b9050600061307882846126a890919063ffffffff16565b905061308f81601754612f2190919063ffffffff16565b6017819055506130e781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f2190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6131448260065461265e90919063ffffffff16565b60068190555061315f81600754612f2190919063ffffffff16565b6007819055505050565b6000806000806000889050600061319c606461318e8b856126a890919063ffffffff16565b61272390919063ffffffff16565b905060006131c660646131b88b866126a890919063ffffffff16565b61272390919063ffffffff16565b905060006131f060646131e28b876126a890919063ffffffff16565b61272390919063ffffffff16565b9050600061322b8261321d8561320f888a61265e90919063ffffffff16565b61265e90919063ffffffff16565b61265e90919063ffffffff16565b90508084848498509850985098505050505050945094509450949050565b600080600080613262858a6126a890919063ffffffff16565b90506000613279868a6126a890919063ffffffff16565b90506000613290878a6126a890919063ffffffff16565b905060006132a7888a6126a890919063ffffffff16565b905060006132e2826132d4856132c6888a61265e90919063ffffffff16565b61265e90919063ffffffff16565b61265e90919063ffffffff16565b90508481859750975097505050505050955095509592505050565b60008135905061330c816140b1565b92915050565b600081519050613321816140b1565b92915050565b600081359050613336816140c8565b92915050565b60008151905061334b816140c8565b92915050565b600081359050613360816140df565b92915050565b600081519050613375816140df565b92915050565b60006020828403121561338d57600080fd5b600061339b848285016132fd565b91505092915050565b6000602082840312156133b657600080fd5b60006133c484828501613312565b91505092915050565b600080604083850312156133e057600080fd5b60006133ee858286016132fd565b92505060206133ff858286016132fd565b9150509250929050565b60008060006060848603121561341e57600080fd5b600061342c868287016132fd565b935050602061343d868287016132fd565b925050604061344e86828701613351565b9150509250925092565b6000806040838503121561346b57600080fd5b6000613479858286016132fd565b925050602061348a85828601613351565b9150509250929050565b6000602082840312156134a657600080fd5b60006134b484828501613327565b91505092915050565b6000602082840312156134cf57600080fd5b60006134dd8482850161333c565b91505092915050565b6000602082840312156134f857600080fd5b600061350684828501613351565b91505092915050565b60008060006060848603121561352457600080fd5b600061353286828701613366565b935050602061354386828701613366565b925050604061355486828701613366565b9150509250925092565b600061356a8383613576565b60208301905092915050565b61357f81613c92565b82525050565b61358e81613c92565b82525050565b600061359f82613b38565b6135a98185613b5b565b93506135b483613b28565b8060005b838110156135e55781516135cc888261355e565b97506135d783613b4e565b9250506001810190506135b8565b5085935050505092915050565b6135fb81613ca4565b82525050565b61360a81613ce7565b82525050565b600061361b82613b43565b6136258185613b6c565b9350613635818560208601613cf9565b61363e81613dd3565b840191505092915050565b6000613656602383613b6c565b915061366182613de4565b604082019050919050565b6000613679602a83613b6c565b915061368482613e33565b604082019050919050565b600061369c602283613b6c565b91506136a782613e82565b604082019050919050565b60006136bf601b83613b6c565b91506136ca82613ed1565b602082019050919050565b60006136e2601d83613b6c565b91506136ed82613efa565b602082019050919050565b6000613705602183613b6c565b915061371082613f23565b604082019050919050565b6000613728602083613b6c565b915061373382613f72565b602082019050919050565b600061374b602983613b6c565b915061375682613f9b565b604082019050919050565b600061376e602583613b6c565b915061377982613fea565b604082019050919050565b6000613791602483613b6c565b915061379c82614039565b604082019050919050565b60006137b4601183613b6c565b91506137bf82614088565b602082019050919050565b6137d381613cd0565b82525050565b6137e281613cda565b82525050565b60006020820190506137fd6000830184613585565b92915050565b60006040820190506138186000830185613585565b6138256020830184613585565b9392505050565b60006040820190506138416000830185613585565b61384e60208301846137ca565b9392505050565b600060c08201905061386a6000830189613585565b61387760208301886137ca565b6138846040830187613601565b6138916060830186613601565b61389e6080830185613585565b6138ab60a08301846137ca565b979650505050505050565b60006020820190506138cb60008301846135f2565b92915050565b600060208201905081810360008301526138eb8184613610565b905092915050565b6000602082019050818103600083015261390c81613649565b9050919050565b6000602082019050818103600083015261392c8161366c565b9050919050565b6000602082019050818103600083015261394c8161368f565b9050919050565b6000602082019050818103600083015261396c816136b2565b9050919050565b6000602082019050818103600083015261398c816136d5565b9050919050565b600060208201905081810360008301526139ac816136f8565b9050919050565b600060208201905081810360008301526139cc8161371b565b9050919050565b600060208201905081810360008301526139ec8161373e565b9050919050565b60006020820190508181036000830152613a0c81613761565b9050919050565b60006020820190508181036000830152613a2c81613784565b9050919050565b60006020820190508181036000830152613a4c816137a7565b9050919050565b6000602082019050613a6860008301846137ca565b92915050565b600060a082019050613a8360008301886137ca565b613a906020830187613601565b8181036040830152613aa28186613594565b9050613ab16060830185613585565b613abe60808301846137ca565b9695505050505050565b6000608082019050613add60008301876137ca565b613aea60208301866137ca565b613af760408301856137ca565b613b0460608301846137ca565b95945050505050565b6000602082019050613b2260008301846137d9565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613b8882613cd0565b9150613b9383613cd0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bc857613bc7613d75565b5b828201905092915050565b6000613bde82613cd0565b9150613be983613cd0565b925082613bf957613bf8613da4565b5b828204905092915050565b6000613c0f82613cd0565b9150613c1a83613cd0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c5357613c52613d75565b5b828202905092915050565b6000613c6982613cd0565b9150613c7483613cd0565b925082821015613c8757613c86613d75565b5b828203905092915050565b6000613c9d82613cb0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613cf282613cd0565b9050919050565b60005b83811015613d17578082015181840152602081019050613cfc565b83811115613d26576000848401525b50505050565b6000613d3782613cd0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d6a57613d69613d75565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6140ba81613c92565b81146140c557600080fd5b50565b6140d181613ca4565b81146140dc57600080fd5b50565b6140e881613cd0565b81146140f357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206881d3d220634df2a99459b3fa1aded29b5c81d0ad33efff7073d87529538e3064736f6c63430008040033
|
{"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"}]}}
| 2,343 |
0x3b4c0b56f2b33f09bd75afb157c1398829f49b93
|
/**
*Submitted for verification at Etherscan.io on 2021-08-06
*/
/*
All crypto babies will become a MoonCat in here.
Let's enjoy our launch!
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MoonCat is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Moon Cat";
string private constant _symbol = " MCat ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600881526020017f4d6f6f6e20436174000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f204d436174200000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d44e376c274a69e2db46e1d80a4384e6ef45161fc9c8ad0bdfe21626f6697aa64736f6c63430008040033
|
{"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"}]}}
| 2,344 |
0x92ee1d6B884AcE9c333656Ed0181d5052878aB38
|
pragma solidity ^0.4.25;
/**
* @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;
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract owned {
address public owner = msg.sender;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
contract TokenERC20 is owned {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
totalSupply = 10000000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[owner] = totalSupply; // Give the creator all initial tokens
name = "CASH"; // Set the name for display purposes
symbol = "CASH"; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from].add(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` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function raise(uint256 _value) onlyOwner public returns (bool success) {
balanceOf[owner] = balanceOf[owner].add(_value); // Subtract from the sender
totalSupply = totalSupply.add(_value); // Updates totalSupply
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] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
|
0x6080604052600436106100d95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416624f480381146100de57806306fdde031461010a578063095ea7b31461019457806318160ddd146101b857806323b872dd146101df578063313ce5671461020957806342966c681461023457806370a082311461024c57806379cc67901461026d5780638da5cb5b1461029157806395d89b41146102c2578063a9059cbb146102d7578063cae9ca51146102fd578063dd62ed3e14610366578063f2fde38b1461038d575b600080fd5b3480156100ea57600080fd5b506100f66004356103ae565b604080519115158252519081900360200190f35b34801561011657600080fd5b5061011f610426565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610159578181015183820152602001610141565b50505050905090810190601f1680156101865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a057600080fd5b506100f6600160a060020a03600435166024356104b3565b3480156101c457600080fd5b506101cd6104e0565b60408051918252519081900360200190f35b3480156101eb57600080fd5b506100f6600160a060020a03600435811690602435166044356104e6565b34801561021557600080fd5b5061021e610583565b6040805160ff9092168252519081900360200190f35b34801561024057600080fd5b506100f660043561058c565b34801561025857600080fd5b506101cd600160a060020a036004351661062c565b34801561027957600080fd5b506100f6600160a060020a036004351660243561063e565b34801561029d57600080fd5b506102a661077b565b60408051600160a060020a039092168252519081900360200190f35b3480156102ce57600080fd5b5061011f61078a565b3480156102e357600080fd5b506102fb600160a060020a03600435166024356107e2565b005b34801561030957600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526100f6948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506107f19650505050505050565b34801561037257600080fd5b506101cd600160a060020a036004358116906024351661090a565b34801561039957600080fd5b506102fb600160a060020a0360043516610927565b60008054600160a060020a031633146103c657600080fd5b60008054600160a060020a03168152600560205260409020546103ef908363ffffffff61096d16565b60008054600160a060020a031681526005602052604090205560045461041b908363ffffffff61096d16565b600455506001919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ab5780601f10610480576101008083540402835291602001916104ab565b820191906000526020600020905b81548152906001019060200180831161048e57829003601f168201915b505050505081565b336000908152600660209081526040808320600160a060020a039590951683529390529190912055600190565b60045481565b600160a060020a038316600090815260066020908152604080832033845290915281205482111561051657600080fd5b600160a060020a038416600090815260066020908152604080832033845290915290205461054a908363ffffffff61098616565b600160a060020a038516600090815260066020908152604080832033845290915290205561057984848461099d565b5060019392505050565b60035460ff1681565b336000908152600560205260408120548211156105a857600080fd5b336000908152600560205260409020546105c8908363ffffffff61098616565b336000908152600560205260409020556004546105eb908363ffffffff61098616565b60045560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b60056020526000908152604090205481565b600160a060020a03821660009081526005602052604081205482111561066357600080fd5b600160a060020a038316600090815260066020908152604080832033845290915290205482111561069357600080fd5b600160a060020a0383166000908152600560205260409020546106bc908363ffffffff61098616565b600160a060020a03841660009081526005602090815260408083209390935560068152828220338352905220546106f9908363ffffffff61098616565b600160a060020a0384166000908152600660209081526040808320338452909152902055600454610730908363ffffffff61098616565b600455604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104ab5780601f10610480576101008083540402835291602001916104ab565b6107ed33838361099d565b5050565b6000836107fe81856104b3565b15610902576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b8381101561089657818101518382015260200161087e565b50505050905090810190601f1680156108c35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156108e557600080fd5b505af11580156108f9573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b600054600160a060020a0316331461093e57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282018381101561097f57600080fd5b9392505050565b6000808383111561099657600080fd5b5050900390565b6000600160a060020a03831615156109b457600080fd5b600160a060020a0384166000908152600560205260409020548211156109d957600080fd5b600160a060020a038316600090815260056020526040902054610a02818463ffffffff61096d16565b11610a0c57600080fd5b600160a060020a03808416600090815260056020526040808220549287168252902054610a3e9163ffffffff61096d16565b600160a060020a038516600090815260056020526040902054909150610a6a908363ffffffff61098616565b600160a060020a038086166000908152600560205260408082209390935590851681522054610a9f908363ffffffff61096d16565b600160a060020a0380851660008181526005602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3600160a060020a038084166000908152600560205260408082205492871682529020548291610b2b919063ffffffff61096d16565b14610b3257fe5b505050505600a165627a7a723058206fa924ec46bbc00c2ca7bb30bb9c2b86e3e4bc75bbadcd1c9ec724e1cd64518f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 2,345 |
0x6691e334525b41a26c7398dbdc3c1e68fb3a7898
|
pragma solidity 0.5.17;
interface IUniswapV2Router02 {
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
}
interface IERC20FeeProxy {
event TransferWithReferenceAndFee(
address tokenAddress,
address to,
uint256 amount,
bytes indexed paymentReference,
uint256 feeAmount,
address feeAddress
);
function transferFromWithReferenceAndFee(
address _tokenAddress,
address _to,
uint256 _amount,
bytes calldata _paymentReference,
uint256 _feeAmount,
address _feeAddress
) external;
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract 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 onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeERC20 {
/**
* @notice Call transferFrom ERC20 function and validates the return data of a ERC20 contract call.
* @dev This is necessary because of non-standard ERC20 tokens that don't have a return value.
* @return The return value of the ERC20 call, returning true for non-standard tokens
*/
function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _amount) internal returns (bool result) {
address tokenAddress = address(_token);
/* solium-disable security/no-inline-assembly */
// check if the address is a contract
assembly {
if iszero(extcodesize(tokenAddress)) { revert(0, 0) }
}
// solium-disable-next-line security/no-low-level-calls
(bool success, ) = tokenAddress.call(abi.encodeWithSignature(
"transferFrom(address,address,uint256)",
_from,
_to,
_amount
));
assembly {
switch returndatasize()
case 0 { // not a standard erc20
result := 1
}
case 32 { // standard erc20
returndatacopy(0, 0, 32)
result := mload(0)
}
default { // anything else, should revert for safety
revert(0, 0)
}
}
require(success, "transferFrom() has been reverted");
/* solium-enable security/no-inline-assembly */
return result;
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 _token, address _spender, uint256 _amount) internal returns (bool result) {
address tokenAddress = address(_token);
/* solium-disable security/no-inline-assembly */
// check if the address is a contract
assembly {
if iszero(extcodesize(tokenAddress)) { revert(0, 0) }
}
// solium-disable-next-line security/no-low-level-calls
(bool success, ) = tokenAddress.call(abi.encodeWithSignature(
"approve(address,uint256)",
_spender,
_amount
));
assembly {
switch returndatasize()
case 0 { // not a standard erc20
result := 1
}
case 32 { // standard erc20
returndatacopy(0, 0, 32)
result := mload(0)
}
default { // anything else, should revert for safety
revert(0, 0)
}
}
require(success, "approve() has been reverted");
/* solium-enable security/no-inline-assembly */
return result;
}
}
contract ERC20SwapToPay is Ownable {
using SafeERC20 for IERC20;
IUniswapV2Router02 public swapRouter;
IERC20FeeProxy public paymentProxy;
constructor(address _swapRouterAddress, address _paymentProxyAddress) public {
swapRouter = IUniswapV2Router02(_swapRouterAddress);
paymentProxy = IERC20FeeProxy(_paymentProxyAddress);
}
/**
* @notice Authorizes the proxy to spend a new request currency (ERC20).
* @param _erc20Address Address of an ERC20 used as a request currency
*/
function approvePaymentProxyToSpend(address _erc20Address) public {
IERC20 erc20 = IERC20(_erc20Address);
uint256 max = 2**256 - 1;
erc20.safeApprove(address(paymentProxy), max);
}
/**
* @notice Authorizes the swap router to spend a new payment currency (ERC20).
* @param _erc20Address Address of an ERC20 used for payment
*/
function approveRouterToSpend(address _erc20Address) public {
IERC20 erc20 = IERC20(_erc20Address);
uint256 max = 2**256 - 1;
erc20.safeApprove(address(swapRouter), max);
}
/**
* @notice Performs a token swap between a payment currency and a request currency, and then
* calls a payment proxy to pay the request, including fees.
* @param _to Transfer recipient = request issuer
* @param _amount Amount to transfer in request currency
* @param _amountInMax Maximum amount allowed to spend for currency swap, in payment currency.
This amount should take into account the fees.
@param _path, path of ERC20 tokens to swap from requestedToken to spentToken. The first
address of the path should be the payment currency. The last element should be the
request currency.
* @param _paymentReference Reference of the payment related
* @param _feeAmount Amount of the fee in request currency
* @param _feeAddress Where to pay the fee
* @param _deadline Deadline for the swap to be valid
*/
function swapTransferWithReference(
address _to,
uint256 _amount, // requestedToken
uint256 _amountInMax, // spentToken
address[] calldata _path, // from requestedToken to spentToken
bytes calldata _paymentReference,
uint256 _feeAmount, // requestedToken
address _feeAddress,
uint256 _deadline
)
external
{
IERC20 spentToken = IERC20(_path[0]);
IERC20 requestedToken = IERC20(_path[_path.length-1]);
uint256 requestedTotalAmount = _amount + _feeAmount;
require(spentToken.allowance(msg.sender, address(this)) > _amountInMax, "Not sufficient allowance for swap to pay.");
require(spentToken.safeTransferFrom(msg.sender, address(this), _amountInMax), "Could not transfer payment token from swapper-payer");
// Allow the router to spend all this contract's spentToken
if (spentToken.allowance(address(this),address(swapRouter)) < _amountInMax) {
approveRouterToSpend(address(spentToken));
}
swapRouter.swapTokensForExactTokens(
requestedTotalAmount,
_amountInMax,
_path,
address(this),
_deadline
);
// Allow the payment network to spend all this contract's requestedToken
if (requestedToken.allowance(address(this),address(paymentProxy)) < requestedTotalAmount) {
approvePaymentProxyToSpend(address(requestedToken));
}
// Pay the request and fees
paymentProxy.transferFromWithReferenceAndFee(
address(requestedToken),
_to,
_amount,
_paymentReference,
_feeAmount,
_feeAddress
);
// Give the change back to the payer, in both currencies (only spent token should remain)
if (spentToken.balanceOf(address(this)) > 0) {
spentToken.transfer(msg.sender, spentToken.balanceOf(address(this)));
}
if (requestedToken.balanceOf(address(this)) > 0) {
requestedToken.transfer(msg.sender, requestedToken.balanceOf(address(this)));
}
}
/*
* Admin functions to edit the admin, router address or proxy address
*/
function setPaymentProxy(address _paymentProxyAddress) public onlyOwner {
paymentProxy = IERC20FeeProxy(_paymentProxyAddress);
}
function setRouter(address _newSwapRouterAddress) public onlyOwner {
swapRouter = IUniswapV2Router02(_newSwapRouterAddress);
}
}
|
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b146102b6578063a09b241d14610300578063c0d7865514610344578063c31c9c0714610388578063f2fde38b146103d25761009e565b806330e175c9146100a35780633cd3efef146100e7578063715018a6146101315780637262b4c51461013b5780638d09fe2b1461017f575b600080fd5b6100e5600480360360208110156100b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610416565b005b6100ef610493565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101396104b9565b005b61017d6004803603602081101561015157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610641565b005b6102b4600480360361010081101561019657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156101e757600080fd5b8201836020820111156101f957600080fd5b8035906020019184602083028401116401000000008311171561021b57600080fd5b90919293919293908035906020019064010000000081111561023c57600080fd5b82018360208201111561024e57600080fd5b8035906020019184600183028401116401000000008311171561027057600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061074e565b005b6102be611369565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103426004803603602081101561031657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611392565b005b6103866004803603602081101561035a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140f565b005b61039061151c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610414600480360360208110156103e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611542565b005b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905061048d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff1661174f9092919063ffffffff16565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104c1611984565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610582576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610649611984565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008787600081811061075d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000888860018b8b90500381811061079057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000858c0190508a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561086857600080fd5b505afa15801561087c573d6000803e3d6000fd5b505050506040513d602081101561089257600080fd5b8101908080519060200190929190505050116108f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611c1d6029913960400191505060405180910390fd5b61092633308d8673ffffffffffffffffffffffffffffffffffffffff1661198c909392919063ffffffff16565b61097b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c466033913960400191505060405180910390fd5b8a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d6020811015610a7957600080fd5b81019080805190602001909291905050501015610a9a57610a9983610416565b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee828d8d8d308a6040518763ffffffff1660e01b815260040180878152602001868152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281038252868682818152602001925060200280828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610bc857600080fd5b8101908080516040519392919084640100000000821115610be857600080fd5b83820191506020820185811115610bfe57600080fd5b8251866020820283011164010000000082111715610c1b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610c52578082015181840152602081019050610c37565b5050505090500160405250505050808273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3457600080fd5b505afa158015610d48573d6000803e3d6000fd5b505050506040513d6020811015610d5e57600080fd5b81019080805190602001909291905050501015610d7f57610d7e82611392565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c219a14d838f8f8c8c8c8c6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252868682818152602001925080828437600081840152601f19601f82011690508083019250505098505050505050505050600060405180830381600087803b158015610ecc57600080fd5b505af1158015610ee0573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f6357600080fd5b505afa158015610f77573d6000803e3d6000fd5b505050506040513d6020811015610f8d57600080fd5b8101908080519060200190929190505050111561111f578273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561103e57600080fd5b505afa158015611052573d6000803e3d6000fd5b505050506040513d602081101561106857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110e257600080fd5b505af11580156110f6573d6000803e3d6000fd5b505050506040513d602081101561110c57600080fd5b8101908080519060200190929190505050505b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119e57600080fd5b505afa1580156111b2573d6000803e3d6000fd5b505050506040513d60208110156111c857600080fd5b8101908080519060200190929190505050111561135a578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561127957600080fd5b505afa15801561128d573d6000803e3d6000fd5b505050506040513d60208110156112a357600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b505050506040513d602081101561134757600080fd5b8101908080519060200190929190505050505b50505050505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9050611409600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff1661174f9092919063ffffffff16565b50505050565b611417611984565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61154a611984565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461160b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611691576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611bf76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080849050803b61176057600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff168585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061186e578051825260208201915060208101905060208303925061184b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118d0576040519150601f19603f3d011682016040523d82523d6000602084013e6118d5565b606091505b505090503d600081146118ef57602081146118f857600080fd5b60019350611904565b60206000803e60005193505b5080611978576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f617070726f7665282920686173206265656e207265766572746564000000000081525060200191505060405180910390fd5b82925050509392505050565b600033905090565b600080859050803b61199d57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611adf5780518252602082019150602081019050602083039250611abc565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611b41576040519150601f19603f3d011682016040523d82523d6000602084013e611b46565b606091505b505090503d60008114611b605760208114611b6957600080fd5b60019350611b75565b60206000803e60005193505b5080611be9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f7472616e7366657246726f6d282920686173206265656e20726576657274656481525060200191505060405180910390fd5b829250505094935050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734e6f742073756666696369656e7420616c6c6f77616e636520666f72207377617020746f207061792e436f756c64206e6f74207472616e73666572207061796d656e7420746f6b656e2066726f6d20737761707065722d7061796572a265627a7a72315820128f9ec8416dc6d79d4b4f714bddb99068874a4d305902bfcaae3ca569df43f864736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,346 |
0x767b4e3d51068340729ac658bb35927e3ad57b7a
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-27
*/
/*
ICE DIAMOND
http://t.me/imond_official
*/
// 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 IMOND 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 _isSmallFee;
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 = "Ice Diamond";
string private constant _symbol = 'IMOND \xF0\x9F\x92\xA0';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 12;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _buybackWalletAddress;
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;
address _feeChanger;
event MaxTxAmountUpdated(uint _maxTxAmount);
event FeeChangershipRenounced();
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
modifier onlyFeeChanger() {
require(_msgSender() == _feeChanger, "Caller must be fee changer");
_;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable buybackWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_buybackWalletAddress = buybackWalletAddress;
_feeChanger = _msgSender();
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[buybackWalletAddress] = 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 addSmallFeeAddress(address _beneficiery) external onlyFeeChanger {
_isSmallFee[_beneficiery] = true;
}
function removeFromSmallFeeAddress(address _beneficiery) external onlyFeeChanger {
_isSmallFee[_beneficiery] = false;
}
function excludeFromFee(address _beneficiery) external onlyFeeChanger {
_isExcludedFromFee[_beneficiery] = true;
}
function includeToFee(address _beneficiery) external onlyFeeChanger {
_isExcludedFromFee[_beneficiery] = false;
}
function renounceFeeChangerShip() external onlyFeeChanger {
emit FeeChangershipRenounced();
_feeChanger = address(0);
}
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 reduceFee() private {
if(_taxFee == 0 && _teamFee == 6) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 6;
}
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 + (1 minutes);
}
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;
bool smallFee = false;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _isSmallFee[to]){
takeFee = false;
}
if(_isSmallFee[from]) {
smallFee = true;
}
_tokenTransfer(from,to,amount,takeFee,smallFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
if (tokenAmount == 0) {
return;
}
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(3));
_marketingWalletAddress.transfer(amount.div(3));
_buybackWalletAddress.transfer(amount.div(3));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 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, bool smallFee) private {
if(!takeFee)
removeAllFee();
else if (smallFee)
reduceFee();
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 || !smallFee)
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);
}
}
|
0x6080604052600436106101845760003560e01c8063715018a6116100d6578063c3c8cd801161007f578063cf0848f711610059578063cf0848f7146105c1578063d543dbeb146105f4578063dd62ed3e1461061e5761018b565b8063c3c8cd8014610564578063c9567bf914610579578063ca509e151461058e5761018b565b8063a9059cbb116100b0578063a9059cbb14610448578063b193cbd614610481578063b515566a146104b45761018b565b8063715018a6146103ed5780638da5cb5b1461040257806395d89b41146104335761018b565b8063273123b7116101385780635932ead1116101125780635932ead1146103795780636fc3eaec146103a557806370a08231146103ba5761018b565b8063273123b7146102e8578063313ce5671461031b578063437823ec146103465761018b565b806311bebd921161016957806311bebd921461026757806318160ddd1461027e57806323b872dd146102a55761018b565b806306fdde0314610190578063095ea7b31461021a5761018b565b3661018b57005b600080fd5b34801561019c57600080fd5b506101a5610659565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101df5781810151838201526020016101c7565b50505050905090810190601f16801561020c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022657600080fd5b506102536004803603604081101561023d57600080fd5b506001600160a01b038135169060200135610690565b604080519115158252519081900360200190f35b34801561027357600080fd5b5061027c6106ae565b005b34801561028a57600080fd5b50610293610770565b60408051918252519081900360200190f35b3480156102b157600080fd5b50610253600480360360608110156102c857600080fd5b506001600160a01b0381358116916020810135909116906040013561077d565b3480156102f457600080fd5b5061027c6004803603602081101561030b57600080fd5b50356001600160a01b0316610804565b34801561032757600080fd5b5061033061088f565b6040805160ff9092168252519081900360200190f35b34801561035257600080fd5b5061027c6004803603602081101561036957600080fd5b50356001600160a01b0316610894565b34801561038557600080fd5b5061027c6004803603602081101561039c57600080fd5b50351515610927565b3480156103b157600080fd5b5061027c6109de565b3480156103c657600080fd5b50610293600480360360208110156103dd57600080fd5b50356001600160a01b0316610a12565b3480156103f957600080fd5b5061027c610a7c565b34801561040e57600080fd5b50610417610b48565b604080516001600160a01b039092168252519081900360200190f35b34801561043f57600080fd5b506101a5610b57565b34801561045457600080fd5b506102536004803603604081101561046b57600080fd5b506001600160a01b038135169060200135610b8e565b34801561048d57600080fd5b5061027c600480360360208110156104a457600080fd5b50356001600160a01b0316610ba2565b3480156104c057600080fd5b5061027c600480360360208110156104d757600080fd5b8101906020810181356401000000008111156104f257600080fd5b82018360208201111561050457600080fd5b8035906020019184602083028401116401000000008311171561052657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c35945050505050565b34801561057057600080fd5b5061027c610cfb565b34801561058557600080fd5b5061027c610d38565b34801561059a57600080fd5b5061027c600480360360208110156105b157600080fd5b50356001600160a01b0316611270565b3480156105cd57600080fd5b5061027c600480360360208110156105e457600080fd5b50356001600160a01b0316611300565b34801561060057600080fd5b5061027c6004803603602081101561061757600080fd5b5035611390565b34801561062a57600080fd5b506102936004803603604081101561064157600080fd5b506001600160a01b03813581169160200135166114a7565b60408051808201909152600b81527f496365204469616d6f6e64000000000000000000000000000000000000000000602082015290565b60006106a461069d6114d2565b84846114d6565b5060015b92915050565b6017546001600160a01b03166106c26114d2565b6001600160a01b03161461071d576040805162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206d75737420626520666565206368616e676572000000000000604482015290519081900360640190fd5b6040517f0f5938224c2c79780d3b88b37e7686a8e34ef8109959dba7814e5da63feb088090600090a1601780547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b683635c9adc5dea0000090565b600061078a8484846115c2565b6107fa846107966114d2565b6107f5856040518060600160405280602881526020016127f9602891396001600160a01b038a166000908152600460205260408120906107d46114d2565b6001600160a01b031681526020810191909152604001600020549190611a3d565b6114d6565b5060019392505050565b61080c6114d2565b6000546001600160a01b0390811691161461086e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b600990565b6017546001600160a01b03166108a86114d2565b6001600160a01b031614610903576040805162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206d75737420626520666565206368616e676572000000000000604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b61092f6114d2565b6000546001600160a01b03908116911614610991576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6015805491151577010000000000000000000000000000000000000000000000027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6011546001600160a01b03166109f26114d2565b6001600160a01b031614610a0557600080fd5b47610a0f81611ad4565b50565b6001600160a01b03811660009081526006602052604081205460ff1615610a5257506001600160a01b038116600090815260036020526040902054610a77565b6001600160a01b038216600090815260026020526040902054610a7490611b9c565b90505b919050565b610a846114d2565b6000546001600160a01b03908116911614610ae6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b031690565b60408051808201909152600a81527f494d4f4e4420f09f92a000000000000000000000000000000000000000000000602082015290565b60006106a4610b9b6114d2565b84846115c2565b6017546001600160a01b0316610bb66114d2565b6001600160a01b031614610c11576040805162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206d75737420626520666565206368616e676572000000000000604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b610c3d6114d2565b6000546001600160a01b03908116911614610c9f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b8151811015610cf757600160086000848481518110610cbd57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610ca2565b5050565b6011546001600160a01b0316610d0f6114d2565b6001600160a01b031614610d2257600080fd5b6000610d2d30610a12565b9050610a0f81611bfc565b610d406114d2565b6000546001600160a01b03908116911614610da2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60155474010000000000000000000000000000000000000000900460ff1615610e12576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601480547fffffffffffffffffffffffff000000000000000000000000000000000000000016737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610e739030906001600160a01b0316683635c9adc5dea000006114d6565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610eac57600080fd5b505afa158015610ec0573d6000803e3d6000fd5b505050506040513d6020811015610ed657600080fd5b5051604080517fad5c464800000000000000000000000000000000000000000000000000000000815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610f3f57600080fd5b505afa158015610f53573d6000803e3d6000fd5b505050506040513d6020811015610f6957600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b505050506040513d6020811015610ffd57600080fd5b5051601580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039283161790556014541663f305d719473061104781610a12565b600080611052610b48565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b1580156110bd57600080fd5b505af11580156110d1573d6000803e3d6000fd5b50505050506040513d60608110156110e857600080fd5b5050601580546722b1c8c1227a00006016557fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff9092167601000000000000000000000000000000000000000000001791909116770100000000000000000000000000000000000000000000001716740100000000000000000000000000000000000000001790819055601454604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561124157600080fd5b505af1158015611255573d6000803e3d6000fd5b505050506040513d602081101561126b57600080fd5b505050565b6017546001600160a01b03166112846114d2565b6001600160a01b0316146112df576040805162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206d75737420626520666565206368616e676572000000000000604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6017546001600160a01b03166113146114d2565b6001600160a01b03161461136f576040805162461bcd60e51b815260206004820152601a60248201527f43616c6c6572206d75737420626520666565206368616e676572000000000000604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6113986114d2565b6000546001600160a01b039081169116146113fa576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000811161144f576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b61146d6064611467683635c9adc5dea0000084611e4f565b90611ea8565b601681905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661151b5760405162461bcd60e51b815260040180806020018281038252602481526020018061286f6024913960400191505060405180910390fd5b6001600160a01b0382166115605760405162461bcd60e51b81526004018080602001828103825260228152602001806127b66022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166116075760405162461bcd60e51b815260040180806020018281038252602581526020018061284a6025913960400191505060405180910390fd5b6001600160a01b03821661164c5760405162461bcd60e51b81526004018080602001828103825260238152602001806127696023913960400191505060405180910390fd5b6000811161168b5760405162461bcd60e51b81526004018080602001828103825260298152602001806128216029913960400191505060405180910390fd5b611693610b48565b6001600160a01b0316836001600160a01b0316141580156116cd57506116b7610b48565b6001600160a01b0316826001600160a01b031614155b156119945760155477010000000000000000000000000000000000000000000000900460ff16156117e7576001600160a01b038316301480159061171a57506001600160a01b0382163014155b801561173457506014546001600160a01b03848116911614155b801561174e57506014546001600160a01b03838116911614155b156117e7576014546001600160a01b03166117676114d2565b6001600160a01b0316148061179657506015546001600160a01b031661178b6114d2565b6001600160a01b0316145b6117e7576040805162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b6016548111156117f657600080fd5b6001600160a01b03831660009081526008602052604090205460ff1615801561183857506001600160a01b03821660009081526008602052604090205460ff16155b61184157600080fd5b6015546001600160a01b03848116911614801561186c57506014546001600160a01b03838116911614155b801561189157506001600160a01b03821660009081526005602052604090205460ff16155b80156118ba575060155477010000000000000000000000000000000000000000000000900460ff165b15611902576001600160a01b03821660009081526009602052604090205442116118e357600080fd5b6001600160a01b0382166000908152600960205260409020603c420190555b600061190d30610a12565b6015549091507501000000000000000000000000000000000000000000900460ff1615801561194a57506015546001600160a01b03858116911614155b80156119725750601554760100000000000000000000000000000000000000000000900460ff165b156119925761198081611bfc565b4780156119905761199047611ad4565b505b505b6001600160a01b0383166000908152600560205260408120546001919060ff16806119d757506001600160a01b03841660009081526005602052604090205460ff165b806119fa57506001600160a01b03841660009081526007602052604090205460ff165b15611a0457600091505b6001600160a01b03851660009081526007602052604090205460ff1615611a29575060015b611a368585858585611eea565b5050505050565b60008184841115611acc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a91578181015183820152602001611a79565b50505050905090810190601f168015611abe5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6011546001600160a01b03166108fc611aee836003611ea8565b6040518115909202916000818181858888f19350505050158015611b16573d6000803e3d6000fd5b506012546001600160a01b03166108fc611b31836003611ea8565b6040518115909202916000818181858888f19350505050158015611b59573d6000803e3d6000fd5b506013546001600160a01b03166108fc611b74836003611ea8565b6040518115909202916000818181858888f19350505050158015610cf7573d6000803e3d6000fd5b6000600b54821115611bdf5760405162461bcd60e51b815260040180806020018281038252602a81526020018061278c602a913960400191505060405180910390fd5b6000611be9612024565b9050611bf58382611ea8565b9392505050565b601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000017905580611c4657611e24565b60408051600280825260608083018452926020830190803683370190505090503081600081518110611c7457fe5b6001600160a01b03928316602091820292909201810191909152601454604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b158015611ce157600080fd5b505afa158015611cf5573d6000803e3d6000fd5b505050506040513d6020811015611d0b57600080fd5b5051815182906001908110611d1c57fe5b6001600160a01b039283166020918202929092010152601454611d4291309116846114d6565b6014546040517f791ac947000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611de1578181015183820152602001611dc9565b505050509050019650505050505050600060405180830381600087803b158015611e0a57600080fd5b505af1158015611e1e573d6000803e3d6000fd5b50505050505b50601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055565b600082611e5e575060006106a8565b82820282848281611e6b57fe5b0414611bf55760405162461bcd60e51b81526004018080602001828103825260218152602001806127d86021913960400191505060405180910390fd5b6000611bf583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612047565b81611efc57611ef76120ac565b611f0a565b8015611f0a57611f0a6120de565b6001600160a01b03851660009081526006602052604090205460ff168015611f4b57506001600160a01b03841660009081526006602052604090205460ff16155b15611f6057611f5b858585612113565b61200c565b6001600160a01b03851660009081526006602052604090205460ff16158015611fa157506001600160a01b03841660009081526006602052604090205460ff165b15611fb157611f5b858585612237565b6001600160a01b03851660009081526006602052604090205460ff168015611ff157506001600160a01b03841660009081526006602052604090205460ff165b1561200157611f5b8585856122e0565b61200c858585612353565b811580612017575080155b15611a3657611a36612397565b60008060006120316123a5565b90925090506120408282611ea8565b9250505090565b600081836120965760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611a91578181015183820152602001611a79565b5060008385816120a257fe5b0495945050505050565b600d541580156120bc5750600e54155b156120c6576120dc565b600d8054600f55600e8054601055600091829055555b565b600d541580156120f05750600e546006145b156120fa576120dc565b600d8054600f55600e8054601055600090915560069055565b60008060008060008061212587612524565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506121579088612581565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546121869087612581565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546121b590866125c3565b6001600160a01b0389166000908152600260205260409020556121d78161261d565b6121e184836126a5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061224987612524565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061227b9087612581565b6001600160a01b03808b16600090815260026020908152604080832094909455918b168152600390915220546122b190846125c3565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546121b590866125c3565b6000806000806000806122f287612524565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506123249088612581565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461227b9087612581565b60008060008060008061236587612524565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506121869087612581565b600f54600d55601054600e55565b600b546000908190683635c9adc5dea00000825b600a548110156124e4578260026000600a84815481106123d557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054118061243a57508160036000600a848154811061241357fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b1561245857600b54683635c9adc5dea0000094509450505050612520565b61249860026000600a848154811061246c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612581565b92506124da60036000600a84815481106124ae57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612581565b91506001016123b9565b50600b546124fb90683635c9adc5dea00000611ea8565b82101561251a57600b54683635c9adc5dea00000935093505050612520565b90925090505b9091565b60008060008060008060008060006125418a600d54600e546126c9565b9250925092506000612551612024565b905060008060006125648e878787612718565b919e509c509a509598509396509194505050505091939550919395565b6000611bf583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a3d565b600082820183811015611bf5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000612627612024565b905060006126358383611e4f565b3060009081526002602052604090205490915061265290826125c3565b3060009081526002602090815260408083209390935560069052205460ff161561126b573060009081526003602052604090205461269090846125c3565b30600090815260036020526040902055505050565b600b546126b29083612581565b600b55600c546126c290826125c3565b600c555050565b60008080806126dd60646114678989611e4f565b905060006126f060646114678a89611e4f565b90506000612708826127028b86612581565b90612581565b9992985090965090945050505050565b60008080806127278886611e4f565b905060006127358887611e4f565b905060006127438888611e4f565b90506000612755826127028686612581565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122089a5e2314bb93308fb18ae8fb65a291faf689be6200b1c03063e9f06a9f30dd464736f6c634300060c0033
|
{"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"}]}}
| 2,347 |
0x62c8b4ac2aef3ed13b929ca9fb20cacb222e3fa6
|
pragma solidity ^0.4.11;
contract AddressRegex {
struct State {
bool accepts;
function (byte) constant internal returns (State memory) func;
}
string public constant regex = "0x[0-9a-fA-F]{40}";
function s0(byte c) constant internal returns (State memory) {
c = c;
return State(false, s0);
}
function s1(byte c) constant internal returns (State memory) {
if (c == 48) {
return State(false, s2);
}
return State(false, s0);
}
function s2(byte c) constant internal returns (State memory) {
if (c == 120) {
return State(false, s3);
}
return State(false, s0);
}
function s3(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s4);
}
return State(false, s0);
}
function s4(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s5);
}
return State(false, s0);
}
function s5(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s6);
}
return State(false, s0);
}
function s6(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s7);
}
return State(false, s0);
}
function s7(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s8);
}
return State(false, s0);
}
function s8(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s9);
}
return State(false, s0);
}
function s9(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s10);
}
return State(false, s0);
}
function s10(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s11);
}
return State(false, s0);
}
function s11(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s12);
}
return State(false, s0);
}
function s12(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s13);
}
return State(false, s0);
}
function s13(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s14);
}
return State(false, s0);
}
function s14(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s15);
}
return State(false, s0);
}
function s15(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s16);
}
return State(false, s0);
}
function s16(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s17);
}
return State(false, s0);
}
function s17(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s18);
}
return State(false, s0);
}
function s18(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s19);
}
return State(false, s0);
}
function s19(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s20);
}
return State(false, s0);
}
function s20(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s21);
}
return State(false, s0);
}
function s21(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s22);
}
return State(false, s0);
}
function s22(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s23);
}
return State(false, s0);
}
function s23(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s24);
}
return State(false, s0);
}
function s24(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s25);
}
return State(false, s0);
}
function s25(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s26);
}
return State(false, s0);
}
function s26(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s27);
}
return State(false, s0);
}
function s27(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s28);
}
return State(false, s0);
}
function s28(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s29);
}
return State(false, s0);
}
function s29(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s30);
}
return State(false, s0);
}
function s30(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s31);
}
return State(false, s0);
}
function s31(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s32);
}
return State(false, s0);
}
function s32(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s33);
}
return State(false, s0);
}
function s33(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s34);
}
return State(false, s0);
}
function s34(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s35);
}
return State(false, s0);
}
function s35(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s36);
}
return State(false, s0);
}
function s36(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s37);
}
return State(false, s0);
}
function s37(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s38);
}
return State(false, s0);
}
function s38(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s39);
}
return State(false, s0);
}
function s39(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s40);
}
return State(false, s0);
}
function s40(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s41);
}
return State(false, s0);
}
function s41(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(false, s42);
}
return State(false, s0);
}
function s42(byte c) constant internal returns (State memory) {
if (c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102) {
return State(true, s43);
}
return State(false, s0);
}
function s43(byte c) constant internal returns (State memory) {
// silence unused var warning
c = c;
return State(false, s0);
}
function matches(string input) constant returns (bool) {
var cur = State(false, s1);
for (uint i = 0; i < bytes(input).length; i++) {
var c = bytes(input)[i];
cur = cur.func(c);
}
return cur.accepts;
}
}
|
0x606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166332ac752b811461004857806355e79d29146100ad575b600080fd5b341561005357600080fd5b61009960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061013895505050505050565b604051901515815260200160405180910390f35b34156100b857600080fd5b6100c06101ef565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100fd5780820151818401525b6020016100e4565b50505050905090810190601f16801561012a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000610142612823565b600080604080519081016040526000808252610226602083015290935091505b84518210156101e25784828151811061017757fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000290506101d481846020015163ffffffff16565b92505b600190910190610162565b825193505b505050919050565b60408051908101604052601181527f30785b302d39612d66412d465d7b34307d000000000000000000000000000000602082015281565b61022e612823565b60fc60020a600302600160f860020a0319831614156102645760408051908101604052600081526102826020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b61028a612823565b7f7800000000000000000000000000000000000000000000000000000000000000600160f860020a03198316141561026457604080519081016040526000815261031d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610264612823565b60408051908101604052600081526102f7602082015290505b919050565b610325612823565b60fc60020a600302600160f860020a0319831610801590610357575060f860020a603902600160f860020a0319831611155b8061038f575060f860020a604102600160f860020a031983161080159061038f575060f960020a602302600160f860020a0319831611155b5b806103c8575060f860020a606102600160f860020a03198316108015906103c8575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526104096020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610411612823565b60fc60020a600302600160f860020a0319831610801590610443575060f860020a603902600160f860020a0319831611155b8061047b575060f860020a604102600160f860020a031983161080159061047b575060f960020a602302600160f860020a0319831611155b5b806104b4575060f860020a606102600160f860020a03198316108015906104b4575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526104f56020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6104fd612823565b60fc60020a600302600160f860020a031983161080159061052f575060f860020a603902600160f860020a0319831611155b80610567575060f860020a604102600160f860020a0319831610801590610567575060f960020a602302600160f860020a0319831611155b5b806105a0575060f860020a606102600160f860020a03198316108015906105a0575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526105e16020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6105e9612823565b60fc60020a600302600160f860020a031983161080159061061b575060f860020a603902600160f860020a0319831611155b80610653575060f860020a604102600160f860020a0319831610801590610653575060f960020a602302600160f860020a0319831611155b5b8061068c575060f860020a606102600160f860020a031983161080159061068c575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526106cd6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6106d5612823565b60fc60020a600302600160f860020a0319831610801590610707575060f860020a603902600160f860020a0319831611155b8061073f575060f860020a604102600160f860020a031983161080159061073f575060f960020a602302600160f860020a0319831611155b5b80610778575060f860020a606102600160f860020a0319831610801590610778575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526107b96020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6107c1612823565b60fc60020a600302600160f860020a03198316108015906107f3575060f860020a603902600160f860020a0319831611155b8061082b575060f860020a604102600160f860020a031983161080159061082b575060f960020a602302600160f860020a0319831611155b5b80610864575060f860020a606102600160f860020a0319831610801590610864575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526108a56020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6108ad612823565b60fc60020a600302600160f860020a03198316108015906108df575060f860020a603902600160f860020a0319831611155b80610917575060f860020a604102600160f860020a0319831610801590610917575060f960020a602302600160f860020a0319831611155b5b80610950575060f860020a606102600160f860020a0319831610801590610950575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526109916020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610999612823565b60fc60020a600302600160f860020a03198316108015906109cb575060f860020a603902600160f860020a0319831611155b80610a03575060f860020a604102600160f860020a0319831610801590610a03575060f960020a602302600160f860020a0319831611155b5b80610a3c575060f860020a606102600160f860020a0319831610801590610a3c575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610a7d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610a85612823565b60fc60020a600302600160f860020a0319831610801590610ab7575060f860020a603902600160f860020a0319831611155b80610aef575060f860020a604102600160f860020a0319831610801590610aef575060f960020a602302600160f860020a0319831611155b5b80610b28575060f860020a606102600160f860020a0319831610801590610b28575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610b696020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610b71612823565b60fc60020a600302600160f860020a0319831610801590610ba3575060f860020a603902600160f860020a0319831611155b80610bdb575060f860020a604102600160f860020a0319831610801590610bdb575060f960020a602302600160f860020a0319831611155b5b80610c14575060f860020a606102600160f860020a0319831610801590610c14575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610c556020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610c5d612823565b60fc60020a600302600160f860020a0319831610801590610c8f575060f860020a603902600160f860020a0319831611155b80610cc7575060f860020a604102600160f860020a0319831610801590610cc7575060f960020a602302600160f860020a0319831611155b5b80610d00575060f860020a606102600160f860020a0319831610801590610d00575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610d416020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610d49612823565b60fc60020a600302600160f860020a0319831610801590610d7b575060f860020a603902600160f860020a0319831611155b80610db3575060f860020a604102600160f860020a0319831610801590610db3575060f960020a602302600160f860020a0319831611155b5b80610dec575060f860020a606102600160f860020a0319831610801590610dec575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610e2d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610e35612823565b60fc60020a600302600160f860020a0319831610801590610e67575060f860020a603902600160f860020a0319831611155b80610e9f575060f860020a604102600160f860020a0319831610801590610e9f575060f960020a602302600160f860020a0319831611155b5b80610ed8575060f860020a606102600160f860020a0319831610801590610ed8575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152610f196020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610f21612823565b60fc60020a600302600160f860020a0319831610801590610f53575060f860020a603902600160f860020a0319831611155b80610f8b575060f860020a604102600160f860020a0319831610801590610f8b575060f960020a602302600160f860020a0319831611155b5b80610fc4575060f860020a606102600160f860020a0319831610801590610fc4575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526110056020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b61100d612823565b60fc60020a600302600160f860020a031983161080159061103f575060f860020a603902600160f860020a0319831611155b80611077575060f860020a604102600160f860020a0319831610801590611077575060f960020a602302600160f860020a0319831611155b5b806110b0575060f860020a606102600160f860020a03198316108015906110b0575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526110f16020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6110f9612823565b60fc60020a600302600160f860020a031983161080159061112b575060f860020a603902600160f860020a0319831611155b80611163575060f860020a604102600160f860020a0319831610801590611163575060f960020a602302600160f860020a0319831611155b5b8061119c575060f860020a606102600160f860020a031983161080159061119c575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526111dd6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6111e5612823565b60fc60020a600302600160f860020a0319831610801590611217575060f860020a603902600160f860020a0319831611155b8061124f575060f860020a604102600160f860020a031983161080159061124f575060f960020a602302600160f860020a0319831611155b5b80611288575060f860020a606102600160f860020a0319831610801590611288575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526112c96020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6112d1612823565b60fc60020a600302600160f860020a0319831610801590611303575060f860020a603902600160f860020a0319831611155b8061133b575060f860020a604102600160f860020a031983161080159061133b575060f960020a602302600160f860020a0319831611155b5b80611374575060f860020a606102600160f860020a0319831610801590611374575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526113b56020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6113bd612823565b60fc60020a600302600160f860020a03198316108015906113ef575060f860020a603902600160f860020a0319831611155b80611427575060f860020a604102600160f860020a0319831610801590611427575060f960020a602302600160f860020a0319831611155b5b80611460575060f860020a606102600160f860020a0319831610801590611460575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526114a16020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6114a9612823565b60fc60020a600302600160f860020a03198316108015906114db575060f860020a603902600160f860020a0319831611155b80611513575060f860020a604102600160f860020a0319831610801590611513575060f960020a602302600160f860020a0319831611155b5b8061154c575060f860020a606102600160f860020a031983161080159061154c575060f960020a603302600160f860020a0319831611155b5b1561026457604080519081016040526000815261158d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611595612823565b60fc60020a600302600160f860020a03198316108015906115c7575060f860020a603902600160f860020a0319831611155b806115ff575060f860020a604102600160f860020a03198316108015906115ff575060f960020a602302600160f860020a0319831611155b5b80611638575060f860020a606102600160f860020a0319831610801590611638575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526116796020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611681612823565b60fc60020a600302600160f860020a03198316108015906116b3575060f860020a603902600160f860020a0319831611155b806116eb575060f860020a604102600160f860020a03198316108015906116eb575060f960020a602302600160f860020a0319831611155b5b80611724575060f860020a606102600160f860020a0319831610801590611724575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526117656020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b61176d612823565b60fc60020a600302600160f860020a031983161080159061179f575060f860020a603902600160f860020a0319831611155b806117d7575060f860020a604102600160f860020a03198316108015906117d7575060f960020a602302600160f860020a0319831611155b5b80611810575060f860020a606102600160f860020a0319831610801590611810575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526118516020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611859612823565b60fc60020a600302600160f860020a031983161080159061188b575060f860020a603902600160f860020a0319831611155b806118c3575060f860020a604102600160f860020a03198316108015906118c3575060f960020a602302600160f860020a0319831611155b5b806118fc575060f860020a606102600160f860020a03198316108015906118fc575060f960020a603302600160f860020a0319831611155b5b1561026457604080519081016040526000815261193d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611945612823565b60fc60020a600302600160f860020a0319831610801590611977575060f860020a603902600160f860020a0319831611155b806119af575060f860020a604102600160f860020a03198316108015906119af575060f960020a602302600160f860020a0319831611155b5b806119e8575060f860020a606102600160f860020a03198316108015906119e8575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611a296020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611a31612823565b60fc60020a600302600160f860020a0319831610801590611a63575060f860020a603902600160f860020a0319831611155b80611a9b575060f860020a604102600160f860020a0319831610801590611a9b575060f960020a602302600160f860020a0319831611155b5b80611ad4575060f860020a606102600160f860020a0319831610801590611ad4575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611b156020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611b1d612823565b60fc60020a600302600160f860020a0319831610801590611b4f575060f860020a603902600160f860020a0319831611155b80611b87575060f860020a604102600160f860020a0319831610801590611b87575060f960020a602302600160f860020a0319831611155b5b80611bc0575060f860020a606102600160f860020a0319831610801590611bc0575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611c016020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611c09612823565b60fc60020a600302600160f860020a0319831610801590611c3b575060f860020a603902600160f860020a0319831611155b80611c73575060f860020a604102600160f860020a0319831610801590611c73575060f960020a602302600160f860020a0319831611155b5b80611cac575060f860020a606102600160f860020a0319831610801590611cac575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611ced6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611cf5612823565b60fc60020a600302600160f860020a0319831610801590611d27575060f860020a603902600160f860020a0319831611155b80611d5f575060f860020a604102600160f860020a0319831610801590611d5f575060f960020a602302600160f860020a0319831611155b5b80611d98575060f860020a606102600160f860020a0319831610801590611d98575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611dd96020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611de1612823565b60fc60020a600302600160f860020a0319831610801590611e13575060f860020a603902600160f860020a0319831611155b80611e4b575060f860020a604102600160f860020a0319831610801590611e4b575060f960020a602302600160f860020a0319831611155b5b80611e84575060f860020a606102600160f860020a0319831610801590611e84575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611ec56020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611ecd612823565b60fc60020a600302600160f860020a0319831610801590611eff575060f860020a603902600160f860020a0319831611155b80611f37575060f860020a604102600160f860020a0319831610801590611f37575060f960020a602302600160f860020a0319831611155b5b80611f70575060f860020a606102600160f860020a0319831610801590611f70575060f960020a603302600160f860020a0319831611155b5b15610264576040805190810160405260008152611fb16020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b611fb9612823565b60fc60020a600302600160f860020a0319831610801590611feb575060f860020a603902600160f860020a0319831611155b80612023575060f860020a604102600160f860020a0319831610801590612023575060f960020a602302600160f860020a0319831611155b5b8061205c575060f860020a606102600160f860020a031983161080159061205c575060f960020a603302600160f860020a0319831611155b5b1561026457604080519081016040526000815261209d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b6120a5612823565b60fc60020a600302600160f860020a03198316108015906120d7575060f860020a603902600160f860020a0319831611155b8061210f575060f860020a604102600160f860020a031983161080159061210f575060f960020a602302600160f860020a0319831611155b5b80612148575060f860020a606102600160f860020a0319831610801590612148575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526121896020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b612191612823565b60fc60020a600302600160f860020a03198316108015906121c3575060f860020a603902600160f860020a0319831611155b806121fb575060f860020a604102600160f860020a03198316108015906121fb575060f960020a602302600160f860020a0319831611155b5b80612234575060f860020a606102600160f860020a0319831610801590612234575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526122756020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b61227d612823565b60fc60020a600302600160f860020a03198316108015906122af575060f860020a603902600160f860020a0319831611155b806122e7575060f860020a604102600160f860020a03198316108015906122e7575060f960020a602302600160f860020a0319831611155b5b80612320575060f860020a606102600160f860020a0319831610801590612320575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526123616020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b612369612823565b60fc60020a600302600160f860020a031983161080159061239b575060f860020a603902600160f860020a0319831611155b806123d3575060f860020a604102600160f860020a03198316108015906123d3575060f960020a602302600160f860020a0319831611155b5b8061240c575060f860020a606102600160f860020a031983161080159061240c575060f960020a603302600160f860020a0319831611155b5b1561026457604080519081016040526000815261244d6020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b612455612823565b60fc60020a600302600160f860020a0319831610801590612487575060f860020a603902600160f860020a0319831611155b806124bf575060f860020a604102600160f860020a03198316108015906124bf575060f960020a602302600160f860020a0319831611155b5b806124f8575060f860020a606102600160f860020a03198316108015906124f8575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526125396020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b612541612823565b60fc60020a600302600160f860020a0319831610801590612573575060f860020a603902600160f860020a0319831611155b806125ab575060f860020a604102600160f860020a03198316108015906125ab575060f960020a602302600160f860020a0319831611155b5b806125e4575060f860020a606102600160f860020a03198316108015906125e4575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526126256020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b61262d612823565b60fc60020a600302600160f860020a031983161080159061265f575060f860020a603902600160f860020a0319831611155b80612697575060f860020a604102600160f860020a0319831610801590612697575060f960020a602302600160f860020a0319831611155b5b806126d0575060f860020a606102600160f860020a03198316108015906126d0575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600081526127116020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b612719612823565b60fc60020a600302600160f860020a031983161080159061274b575060f860020a603902600160f860020a0319831611155b80612783575060f860020a604102600160f860020a0319831610801590612783575060f960020a602302600160f860020a0319831611155b5b806127bc575060f860020a606102600160f860020a03198316108015906127bc575060f960020a603302600160f860020a0319831611155b5b156102645760408051908101604052600181526102f76020820152905061027d565b60408051908101604052600081526102f7602082015290505b919050565b610264612823565b60408051908101604052600081526102f7602082015290505b919050565b604080519081016040526000815261283c602082015290565bfe00a165627a7a72305820af0d75906e60279b7a1667b628a05565fbccd5d3772b43f9dd746a12b9e3e2c20029
|
{"success": true, "error": null, "results": {}}
| 2,348 |
0xf639043d58b53b1236b47fef37da768d2dde8507
|
pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract TVToken is PausableToken, MintableToken {
string public name = 'TV Token';
string public symbol = 'TV';
uint8 public decimals = 18;
function TVToken() public {}
function revertFunds(address _from, address _to, uint256 _value) onlyOwner public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(_from, _to, _value);
return true;
}
}
|
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461011757806306fdde0314610144578063095ea7b3146101d257806318160ddd1461022c57806323b872dd14610255578063313ce567146102ce5780633f4ba83a146102fd57806340c10f19146103125780635c975abb1461036c57806366188463146103995780636fa4c766146103f357806370a082311461046c5780637d64bcb4146104b95780638456cb59146104e65780638da5cb5b146104fb57806395d89b4114610550578063a9059cbb146105de578063d73dd62314610638578063dd62ed3e14610692578063f2fde38b146106fe575b600080fd5b341561012257600080fd5b61012a610737565b604051808215151515815260200191505060405180910390f35b341561014f57600080fd5b61015761074a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019757808201518184015260208101905061017c565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610212600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e8565b604051808215151515815260200191505060405180910390f35b341561023757600080fd5b61023f610818565b6040518082815260200191505060405180910390f35b341561026057600080fd5b6102b4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610822565b604051808215151515815260200191505060405180910390f35b34156102d957600080fd5b6102e1610854565b604051808260ff1660ff16815260200191505060405180910390f35b341561030857600080fd5b610310610867565b005b341561031d57600080fd5b610352600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610927565b604051808215151515815260200191505060405180910390f35b341561037757600080fd5b61037f610b0d565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b20565b604051808215151515815260200191505060405180910390f35b34156103fe57600080fd5b610452600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b50565b604051808215151515815260200191505060405180910390f35b341561047757600080fd5b6104a3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dcd565b6040518082815260200191505060405180910390f35b34156104c457600080fd5b6104cc610e15565b604051808215151515815260200191505060405180910390f35b34156104f157600080fd5b6104f9610edd565b005b341561050657600080fd5b61050e610f9e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055b57600080fd5b610563610fc4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105a3578082015181840152602081019050610588565b50505050905090810190601f1680156105d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105e957600080fd5b61061e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611062565b604051808215151515815260200191505060405180910390f35b341561064357600080fd5b610678600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611092565b604051808215151515815260200191505060405180910390f35b341561069d57600080fd5b6106e8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c2565b6040518082815260200191505060405180910390f35b341561070957600080fd5b610735600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611149565b005b600360159054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561080657600080fd5b61081083836112a1565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561084057600080fd5b61084b848484611393565b90509392505050565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108c357600080fd5b600360149054906101000a900460ff1615156108de57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098557600080fd5b600360159054906101000a900460ff161515156109a157600080fd5b6109b68260015461174d90919063ffffffff16565b600181905550610a0d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b3e57600080fd5b610b48838361176b565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bae57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610bea57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c3757600080fd5b610c88826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119fc90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7357600080fd5b600360159054906101000a900460ff16151515610e8f57600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3957600080fd5b600360149054906101000a900460ff16151515610f5557600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561108057600080fd5b61108a8383611a15565b905092915050565b6000600360149054906101000a900460ff161515156110b057600080fd5b6110ba8383611c34565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111e157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113d057600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561141d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114a857600080fd5b6114f9826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119fc90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165d82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119fc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561176157fe5b8091505092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561187c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611910565b61188f83826119fc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000828211151515611a0a57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a5257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a9f57600080fd5b611af0826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119fc90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b83826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611cc582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a723058201fa64f43fbaaaecd4efefa806dbc7d1b5469704073125563399c892871a0296e0029
|
{"success": true, "error": null, "results": {}}
| 2,349 |
0xdb835b3053ed15c0100ca775ec085752be3e9f6a
|
/**
Welcome everyone, GoldenHokk will be launching today! Right now the team are preparing various
methods of marketing to make sure we have marketing for before & after launch!
A Few Things You Should Know About Launch day & after:
⭐️ Stealth Launch
⭐️ Wide range of stickers and emojis for fun posts will be dropped soon
⭐️ Maximum Buy Limit 0.1 At beginning
⭐️ Liquidity Lock
⭐️ Renounce Ownership
⭐️ Various Prestigious Call Channels, starting now
⭐️ Coin Gecko & CoinMarketCap FASTTRACK
⭐️ Admins & Mods In The Chat 24/7
⭐️ Mods in chat and on VC right from the off to help you guys out with any queries for max professionalism
We will also be relying heavily on our dedicated community to help out with simple tasks on launch day. We need everyone to help out with shilling and spreading the word about $GOKK!
Relax, while we will now get calls in. See you all later :)
Website: https://goldenhokk.com/
Telegram: https://t.me/goldenhokk
Twitter: https://twitter.com/goldenhokk?s=21
*/
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 GoldenHokk 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 = 'Golden Hokk ';
string private _symbol = 'GOKK ';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d9f9689b6b6fb61870c90dcab9f05769f9b89792152686ed15915f8d6b24072264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,350 |
0x12f906e4854eedfdb1bd2daa9100d1c3b0cb7631
|
/**
*Submitted for verification at Etherscan.io on 2021-10-18
*/
pragma solidity 0.6.7;
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;
}
abstract contract AuctionHouseLike {
function bids(uint) external view virtual returns (uint, uint, uint, uint, uint48, address, address);
function buyCollateral(uint256 id, uint256 wad) external virtual;
function liquidationEngine() view public virtual returns (LiquidationEngineLike);
function collateralType() view public virtual returns (bytes32);
}
abstract contract SAFEEngineLike {
function tokenCollateral(bytes32, address) virtual public view returns (uint);
function canModifySAFE(address, address) virtual public view returns (uint);
function collateralTypes(bytes32) virtual public view returns (uint, uint, uint, uint, uint);
function coinBalance(address) virtual public view returns (uint);
function safes(bytes32, address) virtual public view returns (uint, uint);
function modifySAFECollateralization(bytes32, address, address, address, int, int) virtual public;
function approveSAFEModification(address) virtual public;
function denySAFEModification(address) virtual public;
function transferInternalCoins(address, address, uint) virtual public;
}
abstract contract CollateralJoinLike {
function decimals() virtual public returns (uint);
function collateral() virtual public returns (CollateralLike);
function join(address, uint) virtual public payable;
function exit(address, uint) virtual public;
function collateralType() virtual public returns (bytes32);
}
abstract contract CoinJoinLike {
function safeEngine() virtual public returns (SAFEEngineLike);
function systemCoin() virtual public returns (CollateralLike);
function join(address, uint) virtual public payable;
function exit(address, uint) virtual public;
}
abstract contract CollateralLike {
function approve(address, uint) virtual public;
function transfer(address, uint) virtual public;
function transferFrom(address, address, uint) virtual public;
function deposit() virtual public payable;
function withdraw(uint) virtual public;
function balanceOf(address) virtual public view returns (uint);
}
abstract contract LiquidationEngineLike {
function chosenSAFESaviour(bytes32, address) virtual view public returns (address);
function safeSaviours(address) virtual view public returns (uint);
function liquidateSAFE(bytes32 collateralType, address safe) virtual external returns (uint256 auctionId);
function safeEngine() view public virtual returns (SAFEEngineLike);
function collateralTypes(bytes32) public virtual returns(AuctionHouseLike,uint,uint);
}
/// @title GEB Multi Collateral Keeper Flash Proxy
/// @notice Trustless proxy that facilitates SAFE liquidation and bidding in collateral auctions using Uniswap V2 flashswaps
/// @notice Multi collateral version, works with both ETH and general ERC20 collateral
contract GebUniswapV2MultiCollateralKeeperFlashProxy {
SAFEEngineLike public safeEngine;
CollateralLike public weth;
CollateralLike public coin;
CoinJoinLike public coinJoin;
IUniswapV2Pair public uniswapPair;
IUniswapV2Factory public uniswapFactory;
LiquidationEngineLike public liquidationEngine;
bytes32 public collateralType;
/// @notice Constructor
/// @param wethAddress WETH address
/// @param systemCoinAddress System coin address
/// @param uniswapFactoryAddress Uniswap V2 factory address
/// @param coinJoinAddress CoinJoin address
/// @param liquidationEngineAddress Liquidation engine address
constructor(
address wethAddress,
address systemCoinAddress,
address uniswapFactoryAddress,
address coinJoinAddress,
address liquidationEngineAddress
) public {
require(wethAddress != address(0), "GebUniswapV2MultiCollateralKeeperFlashProxy/null-weth");
require(systemCoinAddress != address(0), "GebUniswapV2MultiCollateralKeeperFlashProxy/null-system-coin");
require(uniswapFactoryAddress != address(0), "GebUniswapV2MultiCollateralKeeperFlashProxy/null-uniswap-factory");
require(coinJoinAddress != address(0), "GebUniswapV2MultiCollateralKeeperFlashProxy/null-coin-join");
require(liquidationEngineAddress != address(0), "GebUniswapV2MultiCollateralKeeperFlashProxy/null-liquidation-engine");
weth = CollateralLike(wethAddress);
coin = CollateralLike(systemCoinAddress);
uniswapFactory = IUniswapV2Factory(uniswapFactoryAddress);
coinJoin = CoinJoinLike(coinJoinAddress);
liquidationEngine = LiquidationEngineLike(liquidationEngineAddress);
safeEngine = liquidationEngine.safeEngine();
}
// --- Math ---
function subtract(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "GebUniswapV2MultiCollateralKeeperFlashProxy/sub-overflow");
}
function wad(uint rad) internal pure returns (uint) {
return rad / 10 ** 27;
}
// --- Internal Utils ---
/// @notice Initiates a flashwap
/// @param amount Amount to borrow
/// @param data Callback data
function _startSwap(uint amount, bytes memory data) internal {
uint amount0Out = address(coin) == uniswapPair.token0() ? amount : 0;
uint amount1Out = address(coin) == uniswapPair.token1() ? amount : 0;
uniswapPair.swap(amount0Out, amount1Out, address(this), data);
}
// --- External Utils ---
/// @notice Callback for Uniswap V2
/// @param _sender Flashswap requestor (must be this contract)
/// @param _amount0 Amount of token0
/// @param _amount1 Amount of token1
/// @param _data Data sent back from Uniswap
function uniswapV2Call(address _sender, uint _amount0, uint _amount1, bytes calldata _data) external {
require(_sender == address(this), "GebUniswapV2MultiCollateralKeeperFlashProxy/invalid-sender");
require(msg.sender == address(uniswapPair), "GebUniswapV2MultiCollateralKeeperFlashProxy/invalid-uniswap-pair");
(address caller, CollateralJoinLike collateralJoin, AuctionHouseLike auctionHouse, uint auctionId, uint amount) = abi.decode(
_data, (address, CollateralJoinLike, AuctionHouseLike, uint, uint)
);
uint wadAmount = wad(amount) + 1;
// join COIN
coin.approve(address(coinJoin), wadAmount);
coinJoin.join(address(this), wadAmount);
// bid
auctionHouse.buyCollateral(auctionId, amount);
// exit collateral
collateralJoin.exit(address(this), safeEngine.tokenCollateral(collateralJoin.collateralType(), address(this)));
// repay loan
uint pairBalanceTokenBorrow = coin.balanceOf(address(uniswapPair));
uint pairBalanceTokenPay = collateralJoin.collateral().balanceOf(address(uniswapPair));
uint amountToRepay = ((1000 * pairBalanceTokenPay * wadAmount ) / (997 * pairBalanceTokenBorrow)) + 1;
require(amountToRepay <= collateralJoin.collateral().balanceOf(address(this)), "GebUniswapV2MultiCollateralKeeperFlashProxy/profit-not-enough-to-repay-the-flashswap");
collateralJoin.collateral().transfer(address(uniswapPair), amountToRepay);
// send profit back
if (collateralJoin.collateral() == weth) {
uint profit = weth.balanceOf(address(this));
weth.withdraw(profit);
caller.call{value: profit}("");
} else {
collateralJoin.collateral().transfer(caller, collateralJoin.collateral().balanceOf(address(this)));
}
uniswapPair = IUniswapV2Pair(address(0x0));
}
// --- Core Bidding and Settling Logic ---
/// @notice Liquidates an underwater SAFE and settles the auction right away
/// @dev It will revert for protected safes (those that have saviours), these need to be liquidated through the LiquidationEngine
/// @param collateralJoin Join address for a collateral type
/// @param safe A SAFE's ID
/// @return auction Auction ID
function liquidateAndSettleSAFE(CollateralJoinLike collateralJoin, address safe) public returns (uint auction) {
collateralType = collateralJoin.collateralType();
if (liquidationEngine.safeSaviours(liquidationEngine.chosenSAFESaviour(collateralType, safe)) == 1) {
require (liquidationEngine.chosenSAFESaviour(collateralType, safe) == address(0),
"GebUniswapV2MultiCollateralKeeperFlashProxy/safe-is-protected");
}
auction = liquidationEngine.liquidateSAFE(collateralType, safe);
settleAuction(collateralJoin, auction);
}
/// @notice Settle an auction
/// @param collateralJoin Join address for a collateral type
/// @param auctionId ID of the auction to be settled
function settleAuction(CollateralJoinLike collateralJoin, uint auctionId) public {
(AuctionHouseLike auctionHouse,,) = liquidationEngine.collateralTypes(collateralJoin.collateralType());
(uint raisedAmount,,, uint amountToRaise, uint48 auctionDeadline,,) = auctionHouse.bids(auctionId);
require(auctionDeadline > now, "GebUniswapV2MultiCollateralKeeperFlashProxy/auction-expired");
uint amount = subtract(amountToRaise, raisedAmount);
require(amount > 0, "GebUniswapV2MultiCollateralKeeperFlashProxy/auction-already-settled");
bytes memory callbackData = abi.encode(
msg.sender,
address(collateralJoin),
address(auctionHouse),
auctionId,
amount); // rad
uniswapPair = IUniswapV2Pair(uniswapFactory.getPair(address(collateralJoin.collateral()), address(coin)));
safeEngine.approveSAFEModification(address(auctionHouse));
_startSwap(wad(amount) + 1, callbackData);
safeEngine.denySAFEModification(address(auctionHouse));
}
// --- Fallback ---
receive() external payable {
require(msg.sender == address(weth), "GebUniswapV2MultiCollateralKeeperFlashProxy/only-weth-withdrawals-allowed");
}
}
|
0x6080604052600436106100a05760003560e01c80635138b08c116100645780635138b08c146103685780636247077c146103c357806367aea313146104485780638bdb2afa1461049f578063c816841b146104f6578063e824600f1461054d5761014d565b806310d1e85c1461015257806311df99951461020c57806330413a2a146102635780633fc8cef3146102ba57806344bf3c72146103115761014d565b3661014d57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461014b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806127c86049913960600191505060405180910390fd5b005b600080fd5b34801561015e57600080fd5b5061020a6004803603608081101561017557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460018302840111640100000000831117156101fa57600080fd5b9091929391929390505050610578565b005b34801561021857600080fd5b50610221611613565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561026f57600080fd5b50610278611639565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102c657600080fd5b506102cf61165f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031d57600080fd5b50610326611685565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037457600080fd5b506103c16004803603604081101561038b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116ab565b005b3480156103cf57600080fd5b50610432600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dde565b6040518082815260200191505060405180910390f35b34801561045457600080fd5b5061045d61228f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104ab57600080fd5b506104b46122b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050257600080fd5b5061050b6122da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055957600080fd5b50610562612300565b6040518082815260200191505060405180910390f35b3073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180612865603a913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604081526020018061274b6040913960400191505060405180910390fd5b6000806000806000868660a08110156106ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050945094509450945094506000600161074c83612306565b019050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561081a57600080fd5b505af115801561082e573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b4da69f30836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156108db57600080fd5b505af11580156108ef573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff166354ece2d384846040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561094e57600080fd5b505af1158015610962573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff1663ef693bed306000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376e0b4ca8973ffffffffffffffffffffffffffffffffffffffff1663e824600f6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b505050506040513d6020811015610a3257600080fd5b8101908080519060200190929190505050306040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610aab57600080fd5b505afa158015610abf573d6000803e3d6000fd5b505050506040513d6020811015610ad557600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610b4f57600080fd5b505af1158015610b63573d6000803e3d6000fd5b505050506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c2a57600080fd5b505afa158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b8101908080519060200190929190505050905060008673ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610cb157600080fd5b505af1158015610cc5573d6000803e3d6000fd5b505050506040513d6020811015610cdb57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166370a08231600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d8a57600080fd5b505afa158015610d9e573d6000803e3d6000fd5b505050506040513d6020811015610db457600080fd5b8101908080519060200190929190505050905060006001836103e50285846103e8020281610dde57fe5b040190508773ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b505050506040513d6020811015610e5457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ee157600080fd5b505afa158015610ef5573d6000803e3d6000fd5b505050506040513d6020811015610f0b57600080fd5b8101908080519060200190929190505050811115610f74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260548152602001806128116054913960600191505060405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fbc57600080fd5b505af1158015610fd0573d6000803e3d6000fd5b505050506040513d6020811015610fe657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561109f57600080fd5b505af11580156110b3573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561113857600080fd5b505af115801561114c573d6000803e3d6000fd5b505050506040513d602081101561116257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161415611366576000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561123057600080fd5b505afa158015611244573d6000803e3d6000fd5b505050506040513d602081101561125a57600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156112e257600080fd5b505af11580156112f6573d6000803e3d6000fd5b505050508973ffffffffffffffffffffffffffffffffffffffff168160405180600001905060006040518083038185875af1925050503d8060008114611358576040519150601f19603f3d011682016040523d82523d6000602084013e61135d565b606091505b505050506115c1565b8773ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156113ae57600080fd5b505af11580156113c2573d6000803e3d6000fd5b505050506040513d60208110156113d857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8a8a73ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561144d57600080fd5b505af1158015611461573d6000803e3d6000fd5b505050506040513d602081101561147757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561150457600080fd5b505afa158015611518573d6000803e3d6000fd5b505050506040513d602081101561152e57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156115a857600080fd5b505af11580156115bc573d6000803e3d6000fd5b505050505b6000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050505050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d07900bb8473ffffffffffffffffffffffffffffffffffffffff1663e824600f6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561173357600080fd5b505af1158015611747573d6000803e3d6000fd5b505050506040513d602081101561175d57600080fd5b81019080805190602001909291905050506040518263ffffffff1660e01b815260040180828152602001915050606060405180830381600087803b1580156117a457600080fd5b505af11580156117b8573d6000803e3d6000fd5b505050506040513d60608110156117ce57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050905060008060008373ffffffffffffffffffffffffffffffffffffffff16634423c5f1866040518263ffffffff1660e01b81526004018082815260200191505060e06040518083038186803b15801561184d57600080fd5b505afa158015611861573d6000803e3d6000fd5b505050506040513d60e081101561187757600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050509450945050509250428165ffffffffffff161161192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061289f603b913960400191505060405180910390fd5b600061193a8385612325565b905060008111611995576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260438152602001806127086043913960600191505060405180910390fd5b60603388878985604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001955050505050506040516020818303038152906040529050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e6a439058973ffffffffffffffffffffffffffffffffffffffff1663d8dfeb456040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611ae357600080fd5b505af1158015611af7573d6000803e3d6000fd5b505050506040513d6020811015611b0d57600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611bd457600080fd5b505afa158015611be8573d6000803e3d6000fd5b505050506040513d6020811015611bfe57600080fd5b8101908080519060200190929190505050600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d94d4208876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611cef57600080fd5b505af1158015611d03573d6000803e3d6000fd5b50505050611d1c6001611d1584612306565b018261238b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d49d7867876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611dbc57600080fd5b505af1158015611dd0573d6000803e3d6000fd5b505050505050505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1663e824600f6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b505050506040513d6020811015611e5257600080fd5b81019080805190602001909291905050506007819055506001600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635626da24600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c20afc4600754876040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d6020811015611f7c57600080fd5b81019080805190602001909291905050506040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611fed57600080fd5b505afa158015612001573d6000803e3d6000fd5b505050506040513d602081101561201757600080fd5b8101908080519060200190929190505050141561219757600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c20afc4600754856040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d602081101561211957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614612196576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d81526020018061278b603d913960400191505060405180910390fd5b5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c28be57600754846040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561224257600080fd5b505af1158015612256573d6000803e3d6000fd5b505050506040513d602081101561226c57600080fd5b8101908080519060200190929190505050905061228983826116ab565b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60006b033b2e3c9fd0803ce8000000828161231d57fe5b049050919050565b6000828284039150811115612385576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806126d06038913960400191505060405180910390fd5b92915050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156123f557600080fd5b505afa158015612409573d6000803e3d6000fd5b505050506040513d602081101561241f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461248b57600061248d565b825b90506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156124f957600080fd5b505afa15801561250d573d6000803e3d6000fd5b505050506040513d602081101561252357600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461258f576000612591565b835b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663022c0d9f838330876040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612662578082015181840152602081019050612647565b50505050905090810190601f16801561268f5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156126b157600080fd5b505af11580156126c5573d6000803e3d6000fd5b505050505050505056fe476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f7375622d6f766572666c6f77476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f61756374696f6e2d616c72656164792d736574746c6564476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f696e76616c69642d756e69737761702d70616972476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f736166652d69732d70726f746563746564476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f6f6e6c792d776574682d7769746864726177616c732d616c6c6f776564476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f70726f6669742d6e6f742d656e6f7567682d746f2d72657061792d7468652d666c61736873776170476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f696e76616c69642d73656e646572476562556e697377617056324d756c7469436f6c6c61746572616c4b6565706572466c61736850726f78792f61756374696f6e2d65787069726564a2646970667358221220b03710ba9c431f7ab22948479ac6c50d579ecb7fa476b280dfa96ea58b150a9564736f6c63430006070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 2,351 |
0x318d27825678733f381bc7e17ebe82872bad6ff6
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
/******************************************************************************\
* Author: Nick Mudge
*
* Implementation of an example of a diamond.
/******************************************************************************/
interface IDiamondCut {
enum FacetCutAction {Add, Replace, Remove}
struct FacetCut {
address facetAddress;
FacetCutAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(
FacetCut[] calldata _diamondCut,
address _init,
bytes calldata _calldata
) external;
event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}
library LibDiamond {
bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");
struct FacetAddressAndPosition {
address facetAddress;
uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
}
struct FacetFunctionSelectors {
bytes4[] functionSelectors;
uint16 facetAddressPosition; // position of facetAddress in facetAddresses array
}
struct DiamondStorage {
// maps function selector to the facet address and
// the position of the selector in the facetFunctionSelectors.selectors array
mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
// maps facet addresses to function selectors
mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
// facet addresses
address[] facetAddresses;
// Used to query if a contract implements an interface.
// Used to implement ERC-165.
mapping(bytes4 => bool) supportedInterfaces;
// owner of the contract
address contractOwner;
}
function diamondStorage() internal pure returns (DiamondStorage storage ds) {
bytes32 position = DIAMOND_STORAGE_POSITION;
assembly {
ds.slot := position
}
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function setContractOwner(address _newOwner) internal {
DiamondStorage storage ds = diamondStorage();
address previousOwner = ds.contractOwner;
ds.contractOwner = _newOwner;
emit OwnershipTransferred(previousOwner, _newOwner);
}
function contractOwner() internal view returns (address contractOwner_) {
contractOwner_ = diamondStorage().contractOwner;
}
function enforceIsContractOwner() internal view {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
}
modifier onlyOwner {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
_;
}
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
// Internal function version of diamondCut
// This code is almost the same as the external diamondCut,
// except it is using 'FacetCut[] memory _diamondCut' instead of
// 'FacetCut[] calldata _diamondCut'.
// The code is duplicated to prevent copying calldata to memory which
// causes an error for a two dimensional array.
function diamondCut(
IDiamondCut.FacetCut[] memory _diamondCut,
address _init,
bytes memory _calldata
) internal {
for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
addReplaceRemoveFacetSelectors(
_diamondCut[facetIndex].facetAddress,
_diamondCut[facetIndex].action,
_diamondCut[facetIndex].functionSelectors
);
}
emit DiamondCut(_diamondCut, _init, _calldata);
initializeDiamondCut(_init, _calldata);
}
function addReplaceRemoveFacetSelectors(
address _newFacetAddress,
IDiamondCut.FacetCutAction _action,
bytes4[] memory _selectors
) internal {
DiamondStorage storage ds = diamondStorage();
require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut");
// add or replace functions
if (_newFacetAddress != address(0)) {
uint256 facetAddressPosition = ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition;
// add new facet address if it does not exist
if (facetAddressPosition == 0 && ds.facetFunctionSelectors[_newFacetAddress].functionSelectors.length == 0) {
enforceHasContractCode(_newFacetAddress, "LibDiamondCut: New facet has no code");
facetAddressPosition = ds.facetAddresses.length;
ds.facetAddresses.push(_newFacetAddress);
ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
// add or replace selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
// add
if (_action == IDiamondCut.FacetCutAction.Add) {
require(oldFacetAddress == address(0), "LibDiamondCut: Can't add function that already exists");
addSelector(_newFacetAddress, selector);
} else if (_action == IDiamondCut.FacetCutAction.Replace) {
// replace
require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function");
removeSelector(oldFacetAddress, selector);
addSelector(_newFacetAddress, selector);
} else {
revert("LibDiamondCut: Incorrect FacetCutAction");
}
}
} else {
require(_action == IDiamondCut.FacetCutAction.Remove, "LibDiamondCut: action not set to FacetCutAction.Remove");
// remove selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
removeSelector(ds.selectorToFacetAndPosition[selector].facetAddress, selector);
}
}
}
function addSelector(address _newFacet, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
uint256 selectorPosition = ds.facetFunctionSelectors[_newFacet].functionSelectors.length;
ds.facetFunctionSelectors[_newFacet].functionSelectors.push(_selector);
ds.selectorToFacetAndPosition[_selector].facetAddress = _newFacet;
ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = uint16(selectorPosition);
}
function removeSelector(address _oldFacetAddress, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
// if function does not exist then do nothing and return
require(_oldFacetAddress != address(0), "LibDiamondCut: Can't remove or replace function that doesn't exist");
require(_oldFacetAddress != address(this), "LibDiamondCut: Can't remove or replace immutable function");
// replace selector with last selector, then delete last selector
uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;
uint256 lastSelectorPosition = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.length - 1;
// if not the same then replace _selector with lastSelector
if (selectorPosition != lastSelectorPosition) {
bytes4 lastSelector = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[lastSelectorPosition];
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[selectorPosition] = lastSelector;
ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition);
}
// delete the last selector
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.pop();
delete ds.selectorToFacetAndPosition[_selector];
// if no more selectors for facet address then delete the facet address
if (lastSelectorPosition == 0) {
// replace facet address with last facet address and delete last facet address
uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
uint256 facetAddressPosition = ds.facetFunctionSelectors[_oldFacetAddress].facetAddressPosition;
if (facetAddressPosition != lastFacetAddressPosition) {
address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];
ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
ds.facetAddresses.pop();
delete ds.facetFunctionSelectors[_oldFacetAddress];
}
}
function initializeDiamondCut(address _init, bytes memory _calldata) internal {
if (_init == address(0)) {
require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty");
} else {
require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)");
if (_init != address(this)) {
enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
}
(bool success, bytes memory error) = _init.delegatecall(_calldata);
if (!success) {
if (error.length > 0) {
// bubble up the error
revert(string(error));
} else {
revert("LibDiamondCut: _init function reverted");
}
}
}
}
function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
uint256 contractSize;
assembly {
contractSize := extcodesize(_contract)
}
require(contractSize > 0, _errorMessage);
}
}
interface IDiamondLoupe {
/// These functions are expected to be called frequently
/// by tools.
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
/// @notice Gets all facet addresses and their four byte function selectors.
/// @return facets_ Facet
function facets() external view returns (Facet[] memory facets_);
/// @notice Gets all the function selectors supported by a specific facet.
/// @param _facet The facet address.
/// @return facetFunctionSelectors_
function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);
/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses_
function facetAddresses() external view returns (address[] memory facetAddresses_);
/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param _functionSelector The function selector.
/// @return facetAddress_ The facet address.
function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
}
interface IERC173 {
/// @dev This emits when ownership of a contract changes.
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/// @notice Get the address of the owner
/// @return owner_ The address of the owner.
function owner() external view returns (address owner_);
/// @notice Set the address of the new owner of the contract
/// @dev Set _newOwner to address(0) to renounce any ownership.
/// @param _newOwner The address of the new owner of the contract
function transferOwnership(address _newOwner) external;
}
interface IERC165 {
/// @notice Query if a contract implements an interface
/// @param interfaceId The interface identifier, as specified in ERC-165
/// @dev Interface identification is specified in ERC-165. This function
/// uses less than 30,000 gas.
/// @return `true` if the contract implements `interfaceID` and
/// `interfaceID` is not 0xffffffff, `false` otherwise
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
contract Diamond {
constructor(IDiamondCut.FacetCut[] memory _diamondCut, address _owner) payable {
LibDiamond.diamondCut(_diamondCut, address(0), new bytes(0));
LibDiamond.setContractOwner(_owner);
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
// adding ERC165 data
ds.supportedInterfaces[type(IERC165).interfaceId] = true;
ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true;
ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true;
ds.supportedInterfaces[type(IERC173).interfaceId] = true;
}
// Find facet for function that is called and execute the
// function if a facet is found and return any value.
fallback() external payable {
LibDiamond.DiamondStorage storage ds;
bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;
assembly {
ds.slot := position
}
address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress;
require(facet != address(0), "Diamond: Function does not exist");
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
receive() external payable {}
}
contract DiamondFactory {
event DiamondCreated(address tokenAddress);
function deployNewDiamond(
address _owner,
IDiamondCut.FacetCut[] memory diamondCut
) public returns (address) {
Diamond d = new Diamond(diamondCut, _owner);
emit DiamondCreated(address(d));
}
}
|
0x60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602081905260409091205481906001600160a01b0316806100785760405162461bcd60e51b815260040161006f90610e54565b60405180910390fd5b3660008037600080366000845af43d6000803e808015610097573d6000f35b3d6000fd5b60005b8351811015610100576100f88482815181106100b757fe5b6020026020010151600001518583815181106100cf57fe5b6020026020010151602001518684815181106100e757fe5b6020026020010151604001516101dc565b60010161009f565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67383838360405161013493929190610b3f565b60405180910390a16101468282610488565b505050565b60006101556101b8565b6004810180546001600160a01b0385811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006101e66101b8565b905060008251116102095760405162461bcd60e51b815260040161006f90610ce0565b6001600160a01b038416156103f6576001600160a01b038416600090815260018083016020526040909120015461ffff168015801561026057506001600160a01b0385166000908152600183016020526040902054155b156102e95761028785604051806060016040528060248152602001611078602491396105b0565b5060028101805460018082018355600092835260208084208301805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038a16908117909155845281850190526040909220909101805461ffff191661ffff83161790555b60005b83518110156103ef57600084828151811061030357fe5b6020908102919091018101516001600160e01b0319811660009081529186905260408220549092506001600160a01b03169087600281111561034157fe5b141561037d576001600160a01b0381161561036e5760405162461bcd60e51b815260040161006f90610ee6565b61037888836105d1565b6103e5565b600187600281111561038b57fe5b14156103cd57876001600160a01b0316816001600160a01b031614156103c35760405162461bcd60e51b815260040161006f90610fc6565b61036e81836106ae565b60405162461bcd60e51b815260040161006f90610df7565b50506001016102ec565b5050610482565b600283600281111561040457fe5b146104215760405162461bcd60e51b815260040161006f90610d3d565b60005b825181101561048057600083828151811061043b57fe5b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150610477906001600160a01b0316826106ae565b50600101610424565b505b50505050565b6001600160a01b0382166104ba578051156104b55760405162461bcd60e51b815260040161006f90610c26565b6105ac565b60008151116104db5760405162461bcd60e51b815260040161006f90610e89565b6001600160a01b038216301461050d5761050d82604051806060016040528060288152602001611050602891396105b0565b60006060836001600160a01b0316836040516105299190610b23565b600060405180830381855af49150503d8060008114610564576040519150601f19603f3d011682016040523d82523d6000602084013e610569565b606091505b50915091508161048257805115610594578060405162461bcd60e51b815260040161006f9190610c0c565b60405162461bcd60e51b815260040161006f90610c83565b5050565b813b81816104825760405162461bcd60e51b815260040161006f9190610c0c565b60006105db6101b8565b6001600160a01b039390931660008181526001808601602090815260408084208054938401815584528184206008840401805463ffffffff600786166004026101000a9081021990911660e08a901c919091021790556001600160e01b031990961683529590955292909220805473ffffffffffffffffffffffffffffffffffffffff19169092177fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff9094169390930292909217905550565b60006106b86101b8565b90506001600160a01b0383166106e05760405162461bcd60e51b815260040161006f90610f43565b6001600160a01b0383163014156107095760405162461bcd60e51b815260040161006f90610d9a565b6001600160e01b03198216600090815260208281526040808320546001600160a01b038716845260018501909252909120547401000000000000000000000000000000000000000090910461ffff169060001901808214610866576001600160a01b0385166000908152600184016020526040812080548390811061078a57fe5b600091825260208083206008830401546001600160a01b038a168452600188019091526040909220805460079092166004026101000a90920460e01b9250829190859081106107d557fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528490526040902080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8516021790555b6001600160a01b0385166000908152600184016020526040902080548061088957fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319861682528490526040902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169055806104805760028301546001600160a01b03861660009081526001858101602052604090912001546000199091019061ffff168082146109c257600085600201838154811061093f57fe5b6000918252602090912001546002870180546001600160a01b03909216925082918490811061096a57fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0394851617905592909116815260018781019092526040902001805461ffff191661ffff83161790555b846002018054806109cf57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b03891682526001870190526040812090610a238282610a39565b50600101805461ffff1916905550505050505050565b508054600082556007016008900490600052602060002090810190610a5e9190610a61565b50565b5b80821115610a765760008155600101610a62565b5090565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015610ac05781516001600160e01b03191687529582019590820190600101610a9a565b509495945050505050565b60008151808452610ae3816020860160208601611023565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60038110610b1f57fe5b9052565b60008251610b35818460208701611023565b9190910192915050565b60006060808301818452808751808352608086019150602092506080838202870101838a01865b83811015610bde577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808984030185528151610ba2848251610a7a565b86810151610bb288860182610b15565b50604090810151908401889052610bcb84890182610a87565b9587019593505090850190600101610b66565b5050610bec8488018a610a7a565b8681036040880152610bfe8189610acb565b9a9950505050505050505050565b600060208252610c1f6020830184610acb565b9392505050565b6020808252603c908201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860408201527f3029206275745f63616c6c64617461206973206e6f7420656d70747900000000606082015260800190565b60208082526026908201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e20726560408201527f7665727465640000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660408201527f6163657420746f20637574000000000000000000000000000000000000000000606082015260800190565b60208082526036908201527f4c69624469616d6f6e644375743a20616374696f6e206e6f742073657420746f60408201527f204661636574437574416374696f6e2e52656d6f766500000000000000000000606082015260800190565b60208082526039908201527f4c69624469616d6f6e644375743a2043616e27742072656d6f7665206f72207260408201527f65706c61636520696d6d757461626c652066756e6374696f6e00000000000000606082015260800190565b60208082526027908201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560408201527f74416374696f6e00000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f74206578697374604082015260600190565b6020808252603d908201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460408201527f7920627574205f696e6974206973206e6f742061646472657373283029000000606082015260800190565b60208082526035908201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60408201527f6e207468617420616c7265616479206578697374730000000000000000000000606082015260800190565b60208082526042908201527f4c69624469616d6f6e644375743a2043616e27742072656d6f7665206f72207260408201527f65706c6163652066756e6374696f6e207468617420646f65736e27742065786960608201527f7374000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526038908201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60408201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606082015260800190565b60005b8381101561103e578181015183820152602001611026565b83811115610482575050600091015256fe4c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a26469706673582212204b92f54a2868f69a5d9929624c57077f9526790c0a7b7229356b0124a19eba8c64736f6c63430007010033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 2,352 |
0xf444104bd6701fa4f3229f574eb5ab6cef788478
|
/*
RYUZAKI TOKEN ($RZK)
Website: WWW.RYUZAKITOKEN.COM
Twitter: https://twitter.com/Ryuzakitoken
Telegram: https://t.me/RYUZAKITOKEN_PORTAL
*/
// 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 ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
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 RZK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "RYUZAKI";//////////////////////////
string private constant _symbol = "RZK";
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 = 777777777777777777 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xECb4b241bD6C3dB26a1fc1aF7F727F78a684Ca74);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xECb4b241bD6C3dB26a1fc1aF7F727F78a684Ca74);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 777777777777777777 * 10**9; //
uint256 public _maxWalletSize = 777777777777777777 * 10**9; //
uint256 public _swapTokensAtAmount = 777777777777777777 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051d578063dd62ed3e1461053d578063ea1644d514610583578063f2fde38b146105a357600080fd5b8063a2a957bb14610498578063a9059cbb146104b8578063bfd79284146104d8578063c3c8cd801461050857600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047857600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec36600461197a565b6105c3565b005b3480156101ff57600080fd5b506040805180820190915260078152665259555a414b4960c81b60208201525b60405161022c9190611a3f565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a94565b610662565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b506b02835cd9d1a22ad9db6b2a005b60405190815260200161022c565b3480156102d257600080fd5b506102556102e1366004611ac0565b610679565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b506040516009815260200161022c565b34801561032457600080fd5b50601554610285906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611b01565b6106e2565b34801561036457600080fd5b506101f1610373366004611b2e565b61072d565b34801561038457600080fd5b506101f1610775565b34801561039957600080fd5b506102b86103a8366004611b01565b6107c0565b3480156103b957600080fd5b506101f16107e2565b3480156103ce57600080fd5b506101f16103dd366004611b49565b610856565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b0316610285565b34801561042257600080fd5b506101f1610431366004611b2e565b610885565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b50604080518082019091526003815262525a4b60e81b602082015261021f565b34801561048457600080fd5b506101f1610493366004611b49565b6108cd565b3480156104a457600080fd5b506101f16104b3366004611b62565b6108fc565b3480156104c457600080fd5b506102556104d3366004611a94565b61093a565b3480156104e457600080fd5b506102556104f3366004611b01565b60106020526000908152604090205460ff1681565b34801561051457600080fd5b506101f1610947565b34801561052957600080fd5b506101f1610538366004611b94565b61099b565b34801561054957600080fd5b506102b8610558366004611c18565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058f57600080fd5b506101f161059e366004611b49565b610a3c565b3480156105af57600080fd5b506101f16105be366004611b01565b610a6b565b6000546001600160a01b031633146105f65760405162461bcd60e51b81526004016105ed90611c51565b60405180910390fd5b60005b815181101561065e5760016010600084848151811061061a5761061a611c86565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065681611cb2565b9150506105f9565b5050565b600061066f338484610b55565b5060015b92915050565b6000610686848484610c79565b6106d884336106d385604051806060016040528060288152602001611dcc602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b5565b610b55565b5060019392505050565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105ed90611c51565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107575760405162461bcd60e51b81526004016105ed90611c51565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107aa57506013546001600160a01b0316336001600160a01b0316145b6107b357600080fd5b476107bd816111ef565b50565b6001600160a01b03811660009081526002602052604081205461067390611274565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016105ed90611c51565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108805760405162461bcd60e51b81526004016105ed90611c51565b601655565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105ed90611c51565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016105ed90611c51565b601855565b6000546001600160a01b031633146109265760405162461bcd60e51b81526004016105ed90611c51565b600893909355600a91909155600955600b55565b600061066f338484610c79565b6012546001600160a01b0316336001600160a01b0316148061097c57506013546001600160a01b0316336001600160a01b0316145b61098557600080fd5b6000610990306107c0565b90506107bd816112f8565b6000546001600160a01b031633146109c55760405162461bcd60e51b81526004016105ed90611c51565b60005b82811015610a365781600560008686858181106109e7576109e7611c86565b90506020020160208101906109fc9190611b01565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2e81611cb2565b9150506109c8565b50505050565b6000546001600160a01b03163314610a665760405162461bcd60e51b81526004016105ed90611c51565b601755565b6000546001600160a01b03163314610a955760405162461bcd60e51b81526004016105ed90611c51565b6001600160a01b038116610afa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ed565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ed565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ed565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ed565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ed565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ed565b6000546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b156110ae57601554600160a01b900460ff16610e66576000546001600160a01b03848116911614610e665760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ed565b601654811115610eb85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ed565b6001600160a01b03831660009081526010602052604090205460ff16158015610efa57506001600160a01b03821660009081526010602052604090205460ff16155b610f525760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ed565b6015546001600160a01b03838116911614610fd75760175481610f74846107c0565b610f7e9190611ccd565b10610fd75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ed565b6000610fe2306107c0565b601854601654919250821015908210610ffb5760165491505b8080156110125750601554600160a81b900460ff16155b801561102c57506015546001600160a01b03868116911614155b80156110415750601554600160b01b900460ff165b801561106657506001600160a01b03851660009081526005602052604090205460ff16155b801561108b57506001600160a01b03841660009081526005602052604090205460ff16155b156110ab57611099826112f8565b4780156110a9576110a9476111ef565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f057506001600160a01b03831660009081526005602052604090205460ff165b8061112257506015546001600160a01b0385811691161480159061112257506015546001600160a01b03848116911614155b1561112f575060006111a9565b6015546001600160a01b03858116911614801561115a57506014546001600160a01b03848116911614155b1561116c57600854600c55600954600d555b6015546001600160a01b03848116911614801561119757506014546001600160a01b03858116911614155b156111a957600a54600c55600b54600d555b610a3684848484611481565b600081848411156111d95760405162461bcd60e51b81526004016105ed9190611a3f565b5060006111e68486611ce5565b95945050505050565b6012546001600160a01b03166108fc6112098360026114af565b6040518115909202916000818181858888f19350505050158015611231573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124c8360026114af565b6040518115909202916000818181858888f1935050505015801561065e573d6000803e3d6000fd5b60006006548211156112db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ed565b60006112e56114f1565b90506112f183826114af565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134057611340611c86565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139457600080fd5b505afa1580156113a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cc9190611cfc565b816001815181106113df576113df611c86565b6001600160a01b0392831660209182029290920101526014546114059130911684610b55565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143e908590600090869030904290600401611d19565b600060405180830381600087803b15801561145857600080fd5b505af115801561146c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148e5761148e611514565b611499848484611542565b80610a3657610a36600e54600c55600f54600d55565b60006112f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611639565b60008060006114fe611667565b909250905061150d82826114af565b9250505090565b600c541580156115245750600d54155b1561152b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611554876116af565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611586908761170c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b5908661174e565b6001600160a01b0389166000908152600260205260409020556115d7816117ad565b6115e184836117f7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162691815260200190565b60405180910390a3505050505050505050565b6000818361165a5760405162461bcd60e51b81526004016105ed9190611a3f565b5060006111e68486611d8a565b60065460009081906b02835cd9d1a22ad9db6b2a0061168682826114af565b8210156116a6575050600654926b02835cd9d1a22ad9db6b2a0092509050565b90939092509050565b60008060008060008060008060006116cc8a600c54600d5461181b565b92509250925060006116dc6114f1565b905060008060006116ef8e878787611870565b919e509c509a509598509396509194505050505091939550919395565b60006112f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b5565b60008061175b8385611ccd565b9050838110156112f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ed565b60006117b76114f1565b905060006117c583836118c0565b306000908152600260205260409020549091506117e2908261174e565b30600090815260026020526040902055505050565b600654611804908361170c565b600655600754611814908261174e565b6007555050565b6000808080611835606461182f89896118c0565b906114af565b90506000611848606461182f8a896118c0565b905060006118608261185a8b8661170c565b9061170c565b9992985090965090945050505050565b600080808061187f88866118c0565b9050600061188d88876118c0565b9050600061189b88886118c0565b905060006118ad8261185a868661170c565b939b939a50919850919650505050505050565b6000826118cf57506000610673565b60006118db8385611dac565b9050826118e88583611d8a565b146112f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ed565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bd57600080fd5b803561197581611955565b919050565b6000602080838503121561198d57600080fd5b823567ffffffffffffffff808211156119a557600080fd5b818501915085601f8301126119b957600080fd5b8135818111156119cb576119cb61193f565b8060051b604051601f19603f830116810181811085821117156119f0576119f061193f565b604052918252848201925083810185019188831115611a0e57600080fd5b938501935b82851015611a3357611a248561196a565b84529385019392850192611a13565b98975050505050505050565b600060208083528351808285015260005b81811015611a6c57858101830151858201604001528201611a50565b81811115611a7e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611aa757600080fd5b8235611ab281611955565b946020939093013593505050565b600080600060608486031215611ad557600080fd5b8335611ae081611955565b92506020840135611af081611955565b929592945050506040919091013590565b600060208284031215611b1357600080fd5b81356112f181611955565b8035801515811461197557600080fd5b600060208284031215611b4057600080fd5b6112f182611b1e565b600060208284031215611b5b57600080fd5b5035919050565b60008060008060808587031215611b7857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba957600080fd5b833567ffffffffffffffff80821115611bc157600080fd5b818601915086601f830112611bd557600080fd5b813581811115611be457600080fd5b8760208260051b8501011115611bf957600080fd5b602092830195509350611c0f9186019050611b1e565b90509250925092565b60008060408385031215611c2b57600080fd5b8235611c3681611955565b91506020830135611c4681611955565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cc657611cc6611c9c565b5060010190565b60008219821115611ce057611ce0611c9c565b500190565b600082821015611cf757611cf7611c9c565b500390565b600060208284031215611d0e57600080fd5b81516112f181611955565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d695784516001600160a01b031683529383019391830191600101611d44565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611da757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dc657611dc6611c9c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b16a1c646b236194d9e2b103e7e2912ec8e13ef1cc7c32476036f83f153c596b64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 2,353 |
0x1870cae2f321f1d44250e6fc66470f3155459c90
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/*
_____ _____
/ \ ____ ____ ____ / \ _____ ____
/ \ / \ / _ \ / _ \ / \ / \ / \\__ \ / \
/ Y ( <_> | <_> ) | \/ Y \/ __ \| | \
\____|__ /\____/ \____/|___| /\____|__ (____ /___| /
\/ \/ \/ \/ \/
*/
// MoonMan Inu | $MoonMan
// Telegram: https://t.me/MoonManInu
// Fair Launch, no Presale/Dev Tokens. 100% LP.
// Bots will be fucked.
// LP Lock immediately after launch.
// Ownership will be renounced 30 minutes after launch.
// Slippage Recommended: 15%+
// 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 MoonManInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MoonMan Inu";
string private constant _symbol = "MoonMan \xF0\x9F\x8C\x9D";
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 + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f4d6f6f6e4d616e20496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f4d6f6f6e4d616e20f09f8c9d0000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ae7060d9fc9cde9d9d89595d0171a3d7bbe3d836f61c49f19db023414947770564736f6c63430008040033
|
{"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"}]}}
| 2,354 |
0x214cbcefee9a5c3236df119da16286a15f2b4333
|
/**
*Submitted for verification at Etherscan.io on 2021-11-27
*/
/*
🥶KELON🥶
❗️KishuElon ❗️
🚀BIG UPCOMING LAUNCH🚀
GET IN THERE YOU IDIOTS!
Unless you’ve been sleeping during this bullrun you have heard of Dogelon. Kishuelon is dogelons younger brother with actual utility! A P2E game is currently being laid out and developed, this is what sets us aside! Kishuelon is going to be one of the biggest launches in memeseason. The team have a plan to take this to the next level.
Website: https://kishuelonmars.com/
Telegram: https://t.me/kishuelon
Twitter: https://twitter.com/kishuelonn
*/
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 KishuElon 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 = 'KishuElon ' ;
string private _symbol = 'KELON';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122004bdaf7f72cae91f77d326c3a5a22e42a8db38416c9002f4f448af2818ea616764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,355 |
0xa8f7464a96beb5d70ff0dfc0f7ea31eabfe63300
|
/**
🦧 CheeseKong | $CheeseKong Token🦧
,--.
,----.. ,---, ,--/ /|
/ / \ ,--.' | ,---,': / '
| : : | | : : : '/ / ,---. ,---,
. | ;. / : : : .--.--. | ' , ' ,'\ ,-+-. / | ,----._,.
. ; /--` : | |,--. ,---. ,---. / / ' ,---. ' | / / / | ,--.'|' | / / ' /
; | ; | : ' | / \ / \ | : /`./ / \ | ; ; . ; ,. : | | ,"' | | : |
| : | | | /' : / / | / / | | : ;_ / / | : ' \ ' | |: : | | / | | | | .\ .
. | '___ ' : | | | . ' / | . ' / | \ \ `. . ' / | | | ' ' | .; : | | | | | . ; '; |
' ; : .'| | | ' | : ' ; /| ' ; /| `----. \ ' ; /| ' : |. \ | : | | | | |/ ' . . |
' | '/ : | : :_:,' ' | / | ' | / | / /`--' / ' | / | | | '_\.' \ \ / | | |--' `---`-'| |
| : / | | ,' | : | | : | '--'. / | : | ' : | `----' | |/ .'__/\_: |
\ \ .' `--'' \ \ / \ \ / `--'---' \ \ / ; |,' '---' | : :
`---` `----' `----' `----' '---' \ \ /
`--`-'
💻Telegram : https://t.me/CheeseKong
🤖Twitter : https://twitter.com/CheeseKongToken
🌐Website : http://www.cheesekong.info
*/
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 _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 CheeseKong 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 = 700000000 * 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 = "CheeseKong";
string private constant _symbol = "CheeseKong";
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(0xDeC2029010DA2D4F4Df8e76deAeDB2174C6E2397);
_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 = _tTotal.mul(15).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e2b565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612932565b6104b4565b60405161018e9190612e10565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fcd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612972565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128df565b61060c565b60405161021f9190612e10565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612845565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190613042565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129bb565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a15565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612845565b6109db565b6040516103199190612fcd565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612d42565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612e2b565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612932565b610c9a565b6040516103da9190612e10565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a15565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061289f565b6113c3565b60405161046e9190612fcd565b60405180910390f35b60606040518060400160405280600a81526020017f4368656573654b6f6e6700000000000000000000000000000000000000000000815250905090565b60006104c86104c161144a565b8484611452565b6001905092915050565b60006709b6e64a8ec60000905090565b6104ea61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f0d565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61338a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610600906132e3565b91505061057a565b5050565b600061061984848461161d565b6106da8461062561144a565b6106d58560405180606001604052806028815260200161374960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b61144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb09092919063ffffffff16565b611452565b600190509392505050565b6106ed61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612f0d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e661144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612f0d565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b61089861144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612f0d565b60405180910390fd5b6000811161093257600080fd5b6109606064610952836709b6e64a8ec60000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa61144a565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611dd9565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e45565b9050919050565b610a3461144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612f0d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b8761144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612f0d565b60405180910390fd5b6709b6e64a8ec60000600f819055506709b6e64a8ec60000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4368656573654b6f6e6700000000000000000000000000000000000000000000815250905090565b6000610cae610ca761144a565b848461161d565b6001905092915050565b610cc061144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612f0d565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a836709b6e64a8ec60000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd261144a565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611eb3565b50565b610e1361144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612f0d565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612fad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166709b6e64a8ec60000611452565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612872565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612872565b6040518363ffffffff1660e01b81526004016110b4929190612d5d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612872565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612daf565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e9190612a42565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112776103e8611269600f6709b6e64a8ec60000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f819055506112ad6103e861129f601e6709b6e64a8ec60000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161136d929190612d86565b602060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf91906129e8565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b990612f8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152990612ead565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116109190612fcd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490612f4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f490612e4d565b60405180910390fd5b60008111611740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173790612f2d565b60405180910390fd5b6000600a81905550600a600b81905550611758610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c65750611796610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119235750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119795750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119915750600e60179054906101000a900460ff165b15611acf57600f548111156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d290612e6d565b60405180910390fd5b601054816119e8846109db565b6119f29190613103565b1115611a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2a90612f6d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7e57600080fd5b601e42611a8b9190613103565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b7a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611be6576000600a81905550600a600b819055505b6000611bf1306109db565b9050600e60159054906101000a900460ff16158015611c5e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c765750600e60169054906101000a900460ff165b15611c9e57611c8481611eb3565b60004790506000811115611c9c57611c9b47611dd9565b5b505b505b611cab83838361213b565b505050565b6000838311158290611cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cef9190612e2b565b60405180910390fd5b5060008385611d0791906131e4565b9050809150509392505050565b600080831415611d275760009050611d89565b60008284611d35919061318a565b9050828482611d449190613159565b14611d84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7b90612eed565b60405180910390fd5b809150505b92915050565b6000611dd183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061214b565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e41573d6000803e3d6000fd5b5050565b6000600854821115611e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8390612e8d565b60405180910390fd5b6000611e966121ae565b9050611eab8184611d8f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eeb57611eea6133b9565b5b604051908082528060200260200182016040528015611f195781602001602082028036833780820191505090505b5090503081600081518110611f3157611f3061338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd357600080fd5b505afa158015611fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200b9190612872565b8160018151811061201f5761201e61338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611452565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120ea959493929190612fe8565b600060405180830381600087803b15801561210457600080fd5b505af1158015612118573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121468383836121d9565b505050565b60008083118290612192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121899190612e2b565b60405180910390fd5b50600083856121a19190613159565b9050809150509392505050565b60008060006121bb6123a4565b915091506121d28183611d8f90919063ffffffff16565b9250505090565b6000806000806000806121eb87612403565b95509550955095509550955061224986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122de85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232a81612513565b61233484836125d0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123919190612fcd565b60405180910390a3505050505050505050565b6000806000600854905060006709b6e64a8ec6000090506123d86709b6e64a8ec60000600854611d8f90919063ffffffff16565b8210156123f6576008546709b6e64a8ec600009350935050506123ff565b81819350935050505b9091565b60008060008060008060008060006124208a600a54600b5461260a565b92509250925060006124306121ae565b905060008060006124438e8787876126a0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb0565b905092915050565b60008082846124c49190613103565b905083811015612509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250090612ecd565b60405180910390fd5b8091505092915050565b600061251d6121ae565b905060006125348284611d1490919063ffffffff16565b905061258881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e58260085461246b90919063ffffffff16565b600881905550612600816009546124b590919063ffffffff16565b6009819055505050565b6000806000806126366064612628888a611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126606064612652888b611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126898261267b858c61246b90919063ffffffff16565b61246b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126b98589611d1490919063ffffffff16565b905060006126d08689611d1490919063ffffffff16565b905060006126e78789611d1490919063ffffffff16565b9050600061271082612702858761246b90919063ffffffff16565b61246b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273c61273784613082565b61305d565b9050808382526020820190508285602086028201111561275f5761275e6133ed565b5b60005b8581101561278f57816127758882612799565b845260208401935060208301925050600181019050612762565b5050509392505050565b6000813590506127a881613703565b92915050565b6000815190506127bd81613703565b92915050565b600082601f8301126127d8576127d76133e8565b5b81356127e8848260208601612729565b91505092915050565b6000813590506128008161371a565b92915050565b6000815190506128158161371a565b92915050565b60008135905061282a81613731565b92915050565b60008151905061283f81613731565b92915050565b60006020828403121561285b5761285a6133f7565b5b600061286984828501612799565b91505092915050565b600060208284031215612888576128876133f7565b5b6000612896848285016127ae565b91505092915050565b600080604083850312156128b6576128b56133f7565b5b60006128c485828601612799565b92505060206128d585828601612799565b9150509250929050565b6000806000606084860312156128f8576128f76133f7565b5b600061290686828701612799565b935050602061291786828701612799565b92505060406129288682870161281b565b9150509250925092565b60008060408385031215612949576129486133f7565b5b600061295785828601612799565b92505060206129688582860161281b565b9150509250929050565b600060208284031215612988576129876133f7565b5b600082013567ffffffffffffffff8111156129a6576129a56133f2565b5b6129b2848285016127c3565b91505092915050565b6000602082840312156129d1576129d06133f7565b5b60006129df848285016127f1565b91505092915050565b6000602082840312156129fe576129fd6133f7565b5b6000612a0c84828501612806565b91505092915050565b600060208284031215612a2b57612a2a6133f7565b5b6000612a398482850161281b565b91505092915050565b600080600060608486031215612a5b57612a5a6133f7565b5b6000612a6986828701612830565b9350506020612a7a86828701612830565b9250506040612a8b86828701612830565b9150509250925092565b6000612aa18383612aad565b60208301905092915050565b612ab681613218565b82525050565b612ac581613218565b82525050565b6000612ad6826130be565b612ae081856130e1565b9350612aeb836130ae565b8060005b83811015612b1c578151612b038882612a95565b9750612b0e836130d4565b925050600181019050612aef565b5085935050505092915050565b612b328161322a565b82525050565b612b418161326d565b82525050565b6000612b52826130c9565b612b5c81856130f2565b9350612b6c81856020860161327f565b612b75816133fc565b840191505092915050565b6000612b8d6023836130f2565b9150612b988261340d565b604082019050919050565b6000612bb06019836130f2565b9150612bbb8261345c565b602082019050919050565b6000612bd3602a836130f2565b9150612bde82613485565b604082019050919050565b6000612bf66022836130f2565b9150612c01826134d4565b604082019050919050565b6000612c19601b836130f2565b9150612c2482613523565b602082019050919050565b6000612c3c6021836130f2565b9150612c478261354c565b604082019050919050565b6000612c5f6020836130f2565b9150612c6a8261359b565b602082019050919050565b6000612c826029836130f2565b9150612c8d826135c4565b604082019050919050565b6000612ca56025836130f2565b9150612cb082613613565b604082019050919050565b6000612cc8601a836130f2565b9150612cd382613662565b602082019050919050565b6000612ceb6024836130f2565b9150612cf68261368b565b604082019050919050565b6000612d0e6017836130f2565b9150612d19826136da565b602082019050919050565b612d2d81613256565b82525050565b612d3c81613260565b82525050565b6000602082019050612d576000830184612abc565b92915050565b6000604082019050612d726000830185612abc565b612d7f6020830184612abc565b9392505050565b6000604082019050612d9b6000830185612abc565b612da86020830184612d24565b9392505050565b600060c082019050612dc46000830189612abc565b612dd16020830188612d24565b612dde6040830187612b38565b612deb6060830186612b38565b612df86080830185612abc565b612e0560a0830184612d24565b979650505050505050565b6000602082019050612e256000830184612b29565b92915050565b60006020820190508181036000830152612e458184612b47565b905092915050565b60006020820190508181036000830152612e6681612b80565b9050919050565b60006020820190508181036000830152612e8681612ba3565b9050919050565b60006020820190508181036000830152612ea681612bc6565b9050919050565b60006020820190508181036000830152612ec681612be9565b9050919050565b60006020820190508181036000830152612ee681612c0c565b9050919050565b60006020820190508181036000830152612f0681612c2f565b9050919050565b60006020820190508181036000830152612f2681612c52565b9050919050565b60006020820190508181036000830152612f4681612c75565b9050919050565b60006020820190508181036000830152612f6681612c98565b9050919050565b60006020820190508181036000830152612f8681612cbb565b9050919050565b60006020820190508181036000830152612fa681612cde565b9050919050565b60006020820190508181036000830152612fc681612d01565b9050919050565b6000602082019050612fe26000830184612d24565b92915050565b600060a082019050612ffd6000830188612d24565b61300a6020830187612b38565b818103604083015261301c8186612acb565b905061302b6060830185612abc565b6130386080830184612d24565b9695505050505050565b60006020820190506130576000830184612d33565b92915050565b6000613067613078565b905061307382826132b2565b919050565b6000604051905090565b600067ffffffffffffffff82111561309d5761309c6133b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310e82613256565b915061311983613256565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314e5761314d61332c565b5b828201905092915050565b600061316482613256565b915061316f83613256565b92508261317f5761317e61335b565b5b828204905092915050565b600061319582613256565b91506131a083613256565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d9576131d861332c565b5b828202905092915050565b60006131ef82613256565b91506131fa83613256565b92508282101561320d5761320c61332c565b5b828203905092915050565b600061322382613236565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327882613256565b9050919050565b60005b8381101561329d578082015181840152602081019050613282565b838111156132ac576000848401525b50505050565b6132bb826133fc565b810181811067ffffffffffffffff821117156132da576132d96133b9565b5b80604052505050565b60006132ee82613256565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133215761332061332c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61370c81613218565b811461371757600080fd5b50565b6137238161322a565b811461372e57600080fd5b50565b61373a81613256565b811461374557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dc3218e9eba99656fb9882c45da3bd720aefdaa04a2c2167b400825cab9aa71364736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,356 |
0xe4b95f0e5182a2512bcdd15a3b53d18cc45d25eb
|
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256 r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner, "Only allowed by owner");
_;
}
function transferOwnership(address payable _newOwner) external onlyOwner {
require(_newOwner != address(0),"Invalid address passed");
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
contract PreSale is Owned {
using SafeMath for uint256;
address public tokenAddress;
uint256 public constant startSale = 1613502000; // 16 Feb 2021, 7pm GMT
uint256 public constant endSale = 1614106800; // 23 Feb 2021, 7pm GMT
uint256 public constant claimDate = 1614110400; // 23 Feb 2021, 8pm GMT
uint256 public purchasedTokens;
mapping(address => uint256) public investor;
constructor() public {
owner = 0xa97F07bc8155f729bfF5B5312cf42b6bA7c4fCB9;
}
function SetTokenAddress(address _tokenAddress) external onlyOwner {
tokenAddress = _tokenAddress;
}
receive() external payable{
Invest();
}
function Invest() public payable{
require( now > startSale && now < endSale , "Sale is closed");
uint256 tokens = getTokenAmount(msg.value);
investor[msg.sender] += tokens;
purchasedTokens = purchasedTokens + tokens;
owner.transfer(msg.value);
}
function getTokenAmount(uint256 amount) internal view returns(uint256){
uint256 _tokens = 0;
if (now <= startSale + 3 days){
_tokens = amount * 100;
}
if (now > startSale + 3 days){
_tokens = amount * 80;
}
return _tokens;
}
function ClaimTokens() external returns(bool){
require(now >= claimDate, "Token claim date not reached");
require(investor[msg.sender] > 0, "Not an investor");
uint256 tokens = investor[msg.sender];
investor[msg.sender] = 0;
require(IERC20(tokenAddress).transfer(msg.sender, tokens));
return true;
}
function getUnSoldTokens() onlyOwner external{
require(block.timestamp > endSale, "sale is not closed");
// check unsold tokens
uint256 tokensInContract = IERC20(tokenAddress).balanceOf(address(this));
require(tokensInContract > 0, "no unsold tokens in contract");
require(IERC20(tokenAddress).transfer(owner, tokensInContract), "transfer of token failed");
}
}
|
0x6080604052600436106100ab5760003560e01c80638da5cb5b116100645780638da5cb5b1461020d5780639d76ea581461024e578063a1d915b81461028f578063b66a0e5d146102bc578063c0819961146102e7578063f2fde38b146102f1576100ba565b806305971912146100bf5780630db4bad0146100ea5780631b1cd4ff1461011557806333a7e7391461017a578063380d831b146101cb5780638d18c4aa146101f6576100ba565b366100ba576100b8610342565b005b600080fd5b3480156100cb57600080fd5b506100d4610499565b6040518082815260200191505060405180910390f35b3480156100f657600080fd5b506100ff61049f565b6040518082815260200191505060405180910390f35b34801561012157600080fd5b506101646004803603602081101561013857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104a7565b6040518082815260200191505060405180910390f35b34801561018657600080fd5b506101c96004803603602081101561019d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104bf565b005b3480156101d757600080fd5b506101e06105c4565b6040518082815260200191505060405180910390f35b34801561020257600080fd5b5061020b6105cc565b005b34801561021957600080fd5b506102226109a7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025a57600080fd5b506102636109cb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029b57600080fd5b506102a46109f1565b60405180821515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610c8a565b6040518082815260200191505060405180910390f35b6102ef610342565b005b3480156102fd57600080fd5b506103406004803603602081101561031457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c92565b005b63602c163042118015610358575063603550b042105b6103ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f53616c6520697320636c6f73656400000000000000000000000000000000000081525060200191505060405180910390fd5b60006103d534610e93565b905080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806002540160028190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610495573d6000803e3d6000fd5b5050565b60025481565b6360355ec081565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920616c6c6f776564206279206f776e6572000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b63603550b081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461068d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920616c6c6f776564206279206f776e6572000000000000000000000081525060200191505060405180910390fd5b63603550b04211610706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f73616c65206973206e6f7420636c6f736564000000000000000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561079157600080fd5b505afa1580156107a5573d6000803e3d6000fd5b505050506040513d60208110156107bb57600080fd5b8101908080519060200190929190505050905060008111610844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f6e6f20756e736f6c6420746f6b656e7320696e20636f6e74726163740000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156108f757600080fd5b505af115801561090b573d6000803e3d6000fd5b505050506040513d602081101561092157600080fd5b81019080805190602001909291905050506109a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f7472616e73666572206f6620746f6b656e206661696c6564000000000000000081525060200191505060405180910390fd5b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006360355ec0421015610a6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546f6b656e20636c61696d2064617465206e6f7420726561636865640000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610b22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4e6f7420616e20696e766573746f72000000000000000000000000000000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c3e57600080fd5b505af1158015610c52573d6000803e3d6000fd5b505050506040513d6020811015610c6857600080fd5b8101908080519060200190929190505050610c8257600080fd5b600191505090565b63602c163081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f6e6c7920616c6c6f776564206279206f776e6572000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610df6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c69642061646472657373207061737365640000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080600090506203f48063602c1630014211610eb1576064830290505b6203f48063602c163001421115610ec9576050830290505b8091505091905056fea264697066735822122070325e473b56300dd87fcbdb5ceb5995116e8faa6a5e16e215651c9eb1af781d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,357 |
0xae97b6ad7ad9041951517b2afe05c52af2c95cd9
|
//Waifu Inu ($wINU)
//Deflationary yes
//Telegram: https://t.me/waifuinuofficial
//Fair Launch
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WaifuInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Waifu Inu";
string private constant _symbol = "wINU";
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 = 12;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3000000000 * 10**9;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600981526020017f576169667520496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f77494e5500000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f90bac0b3d8ec0cacbd196203881125b98d7b52f3917c838a90c7e917bb77f4f64736f6c63430008040033
|
{"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"}]}}
| 2,358 |
0xdd4a923aee9f85481985d8c2be17df7372542c73
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _symbol = 'MCDAO';
uint8 private _decimals = 18;
uint256 public maxTxAmount = 1000000000000000e18;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () public {
_mint(_msgSender(), 1000000000000000e18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender != owner() && recipient != owner())
require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() {
require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9');
maxTxAmount = _maxTxAmount;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,359 |
0xdb20ff5f9ea23e77fc8921e696ac9a33992e3107
|
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
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) {
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, ownership can be transferred in 2 steps (transfer-accept).
*/
contract Ownable {
address public owner;
address public pendingOwner;
bool isOwnershipTransferActive = false;
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, "Only owner can do that.");
_;
}
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(isOwnershipTransferActive);
require(msg.sender == pendingOwner, "Only nominated pretender can do that.");
_;
}
/**
* @dev Allows the current owner to set the pendingOwner address.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
pendingOwner = _newOwner;
isOwnershipTransferActive = true;
}
/**
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function acceptOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
isOwnershipTransferActive = false;
pendingOwner = address(0);
}
}
/**
* @title ERC20 Token Standard Interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title Aurum Services Presale Contract
* @author Igor Dëmin
* @dev Presale accepting contributions only within a time frame and capped to specific amount.
*/
contract AurumPresale is Ownable {
using SafeMath for uint256;
// How many minimal token units a buyer gets per wei, presale rate (1:5000 x 1.5)
uint256 public constant RATE = 7500;
// presale cap, 7.5M tokens to be sold
uint256 public constant CAP = 1000 ether;
// The token being sold
ERC20 public token;
// Crowdsale opening time
uint256 public openingTime;
// Crowdsale closing time
uint256 public closingTime;
// Amount of wei raised
uint256 public totalWeiRaised;
// address which can be specified by owner for service purposes
address controller;
bool isControllerSpecified = false;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value wei paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor(ERC20 _token, uint256 _openingTime, uint256 _closingTime) public {
require(_token != address(0));
require(_openingTime >= now);
require(_closingTime > _openingTime);
token = _token;
openingTime = _openingTime;
closingTime = _closingTime;
require(token.balanceOf(msg.sender) >= RATE.mul(CAP));
}
modifier onlyWhileActive() {
require(isActive(), "Presale has closed.");
_;
}
/**
* @dev Sets minimal participation threshold
*/
modifier minThreshold(uint256 _amount) {
require(msg.value >= _amount, "Not enough Ether provided.");
_;
}
modifier onlyController() {
require(isControllerSpecified);
require(msg.sender == controller, "Only controller can do that.");
_;
}
/**
* @dev fallback function
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev Reclaim all ERC20 compatible tokens
* @param _token ERC20 The address of the token contract
*/
function reclaimToken(ERC20 _token) external onlyOwner {
require(!isActive());
uint256 tokenBalance = _token.balanceOf(this);
require(_token.transfer(owner, tokenBalance));
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
owner.transfer(address(this).balance);
}
/**
* @dev Specifies service account
*/
function specifyController(address _controller) external onlyOwner {
controller = _controller;
isControllerSpecified = true;
}
/**
* @dev Controller can mark the receipt of funds attracted in other cryptocurrencies,
* in equivalent of ether.
*/
function markFunding(address _beneficiary, uint256 _weiRaised)
external
onlyController
onlyWhileActive
{
require(_beneficiary != address(0));
require(_weiRaised >= 20 finney);
enroll(controller, _beneficiary, _weiRaised);
}
/**
* @dev Checks whether the period in which the pre-sale is open has already elapsed and
* whether pre-sale cap has been reached.
*/
function isActive() public view returns (bool) {
return now >= openingTime && now <= closingTime && !capReached();
}
/**
* @dev Token purchase
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary)
public
payable
onlyWhileActive
minThreshold(20 finney)
{
require(_beneficiary != address(0));
uint256 newWeiRaised = msg.value;
uint256 newTotalWeiRaised = totalWeiRaised.add(newWeiRaised);
uint256 refundValue = 0;
if (newTotalWeiRaised > CAP) {
newWeiRaised = CAP.sub(totalWeiRaised);
refundValue = newTotalWeiRaised.sub(CAP);
}
enroll(msg.sender, _beneficiary, newWeiRaised);
if (refundValue > 0) {
msg.sender.transfer(refundValue);
}
}
/**
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() internal view returns (bool) {
return totalWeiRaised >= CAP;
}
/**
* @dev Calculate amount of tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function getTokenAmount(uint256 _weiAmount) internal pure returns (uint256) {
return _weiAmount.mul(RATE);
}
/**
* @dev common logic for enroll funds
*/
function enroll(address _purchaser, address _beneficiary, uint256 _value) private {
// update sale progress
totalWeiRaised = totalWeiRaised.add(_value);
// calculate token amount
uint256 tokenAmount = getTokenAmount(_value);
require(token.transfer(_beneficiary, tokenAmount));
emit TokenPurchase(_purchaser, _beneficiary, _value, tokenAmount);
}
}
|
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166317e6a08781146100f057806317ffc3201461011457806322f3e2d4146101355780634b6753bc1461015e57806353f4db0114610185578063664e97041461019a5780636d66264f146101af57806379ba5097146101d05780638da5cb5b146101e55780639f727c2714610216578063b7a8807c1461022b578063e30c397814610240578063ec81b48314610255578063ec8ac4d81461026a578063f2fde38b1461027e578063fc0c546a1461029f575b6100ee336102b4565b005b3480156100fc57600080fd5b506100ee600160a060020a036004351660243561043e565b34801561012057600080fd5b506100ee600160a060020a036004351661056b565b34801561014157600080fd5b5061014a610706565b604080519115158252519081900360200190f35b34801561016a57600080fd5b50610173610732565b60408051918252519081900360200190f35b34801561019157600080fd5b50610173610738565b3480156101a657600080fd5b5061017361073e565b3480156101bb57600080fd5b506100ee600160a060020a0360043516610744565b3480156101dc57600080fd5b506100ee6107f3565b3480156101f157600080fd5b506101fa610929565b60408051600160a060020a039092168252519081900360200190f35b34801561022257600080fd5b506100ee610938565b34801561023757600080fd5b506101736109c6565b34801561024c57600080fd5b506101fa6109cc565b34801561026157600080fd5b506101736109db565b6100ee600160a060020a03600435166102b4565b34801561028a57600080fd5b506100ee600160a060020a03600435166109e8565b3480156102ab57600080fd5b506101fa610a97565b60008060006102c1610706565b1515610317576040805160e560020a62461bcd02815260206004820152601360248201527f50726573616c652068617320636c6f7365642e00000000000000000000000000604482015290519081900360640190fd5b66470de4df82000034811115610377576040805160e560020a62461bcd02815260206004820152601a60248201527f4e6f7420656e6f7567682045746865722070726f76696465642e000000000000604482015290519081900360640190fd5b600160a060020a038516151561038c57600080fd5b6005543494506103a2908563ffffffff610aa616565b925060009150683635c9adc5dea000008311156103f4576005546103d690683635c9adc5dea000009063ffffffff610ab916565b93506103f183683635c9adc5dea0000063ffffffff610ab916565b91505b6103ff338686610acb565b600082111561043757604051339083156108fc029084906000818181858888f19350505050158015610435573d6000803e3d6000fd5b505b5050505050565b60065474010000000000000000000000000000000000000000900460ff16151561046757600080fd5b600654600160a060020a031633146104c9576040805160e560020a62461bcd02815260206004820152601c60248201527f4f6e6c7920636f6e74726f6c6c65722063616e20646f20746861742e00000000604482015290519081900360640190fd5b6104d1610706565b1515610527576040805160e560020a62461bcd02815260206004820152601360248201527f50726573616c652068617320636c6f7365642e00000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216151561053c57600080fd5b66470de4df82000081101561055057600080fd5b60065461056790600160a060020a03168383610acb565b5050565b60008054600160a060020a031633146105bc576040805160e560020a62461bcd0281526020600482015260176024820152600080516020610c3e833981519152604482015290519081900360640190fd5b6105c4610706565b156105ce57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561062f57600080fd5b505af1158015610643573d6000803e3d6000fd5b505050506040513d602081101561065957600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b1580156106cf57600080fd5b505af11580156106e3573d6000803e3d6000fd5b505050506040513d60208110156106f957600080fd5b5051151561056757600080fd5b6000600354421015801561071c57506004544211155b801561072d575061072b610bee565b155b905090565b60045481565b60055481565b611d4c81565b600054600160a060020a03163314610794576040805160e560020a62461bcd0281526020600482015260176024820152600080516020610c3e833981519152604482015290519081900360640190fd5b6006805474ff000000000000000000000000000000000000000019600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff19909116179190911674010000000000000000000000000000000000000000179055565b60015474010000000000000000000000000000000000000000900460ff16151561081c57600080fd5b600154600160a060020a031633146108a4576040805160e560020a62461bcd02815260206004820152602560248201527f4f6e6c79206e6f6d696e617465642070726574656e6465722063616e20646f2060448201527f746861742e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03831617905574ffffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600054600160a060020a03163314610988576040805160e560020a62461bcd0281526020600482015260176024820152600080516020610c3e833981519152604482015290519081900360640190fd5b60008054604051600160a060020a0390911691303180156108fc02929091818181858888f193505050501580156109c3573d6000803e3d6000fd5b50565b60035481565b600154600160a060020a031681565b683635c9adc5dea0000081565b600054600160a060020a03163314610a38576040805160e560020a62461bcd0281526020600482015260176024820152600080516020610c3e833981519152604482015290519081900360640190fd5b6001805474ff000000000000000000000000000000000000000019600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff19909116179190911674010000000000000000000000000000000000000000179055565b600254600160a060020a031681565b81810182811015610ab357fe5b92915050565b600082821115610ac557fe5b50900390565b600554600090610ae1908363ffffffff610aa616565b600555610aed82610c00565b600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015260248201859052915193945091169163a9059cbb916044808201926020929091908290030181600087803b158015610b5e57600080fd5b505af1158015610b72573d6000803e3d6000fd5b505050506040513d6020811015610b8857600080fd5b50511515610b9557600080fd5b82600160a060020a031684600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a350505050565b600554683635c9adc5dea00000111590565b6000610ab382611d4c63ffffffff610c1416565b6000821515610c2557506000610ab3565b50818102818382811515610c3557fe5b0414610ab357fe004f6e6c79206f776e65722063616e20646f20746861742e000000000000000000a165627a7a723058208ddb98374460ab041b62cf89bb3941b74455a038860d8d173a515905868d2f490029
|
{"success": true, "error": null, "results": {}}
| 2,360 |
0x05ec4356e1acd89cc2d16adc7415c8c95e736ac1
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,361 |
0xafdf0af47e774c81065b7f994397ca81c8b23e77
|
/**
RELAUNCH
Multi-Gen Capital: $MGC
-You buy on Ethereum, we farm on multiple chains and return the profits to $MGC holders.
Tokenomics:
10% of each buy goes to existing holders.
15% of each sell goes into multi-chain farming to add to the treasury and buy back MGC tokens.
Telegram:
https://t.me/MultiGenCapital
Website:
https://multigencapital.io/
Twitter:
https://twitter.com/multigencap
*/
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 MultiGenCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'MultiGenCapital ' ;
string private _symbol = 'MGC ' ;
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d4c3872c01af4de6e1fd2b23ce36df5bb3a86654f78c963c084c1b1e9ffe9b9764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,362 |
0x63510d3B8D8Cf0232A3f76315F70f4FAB5448042
|
/**
*Submitted for verification at Etherscan.io on 2022-05-03
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contract ShereKhan is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shere Khan";
string private constant _symbol = "SKAN";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant totalTokens = 100 * 1e6 * 1e9;
uint256 public _maxWalletAmount = 200 * 1e4 * 1e9;
uint256 private _previousLiqFee = liqFee;
uint256 private _previousProjectFee = projectTax;
uint256 private liqFee;
uint256 private projectTax;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private bots;
address payable private deployW = payable(0xa8be302873d8ed2153c9b80e4d01075624F04e31);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private inSwap = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), totalTokens);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_balances[_msgSender()] = totalTokens;
emit Transfer(address(0), _msgSender(), totalTokens);
}
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() external pure override returns (uint256) {
return totalTokens;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (projectTax == 0 && liqFee == 0) return;
_previousProjectFee = projectTax;
_previousLiqFee = liqFee;
projectTax = 0;
liqFee = 0;
}
function restoreAllFee() private {
liqFee = _previousLiqFee;
projectTax = _previousProjectFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = !inSwap;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require(!bots[from] && !bots[to]);
}
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
deployW,
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = liqFee.mul(contractTokenBalance).div(projectTax.add(liqFee));
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
uint256 initialBalance = address(this).balance;
swapTokensForEth(otherHalf);
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function removeFromBlacklist(address _address) external onlyOwner() {
require(_msgSender() == deployW);
bots[_address] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(projectTax).div(100);
fees.tLiquidity = amount.mul(liqFee).div(100);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function blacklistmany(address[] memory bots_) external {
require(_msgSender() == deployW);
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function blacklist(address _address) external {
require(_msgSender() == deployW);
bots[_address] = true;
}
function setMaxWalletAmount(uint256 maxWalletAmount) external {
require(_msgSender() == deployW);
require(maxWalletAmount > totalTokens.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= totalTokens, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
}
|
0x60806040526004361061010d5760003560e01c806370a082311161009557806395d89b411161006457806395d89b4114610308578063a9059cbb14610335578063dd62ed3e14610355578063f2fde38b1461039b578063f9f92be4146103bb57600080fd5b806370a082311461027f578063715018a6146102b55780638cf01f6e146102ca5780638da5cb5b146102ea57600080fd5b806327a14fc2116100dc57806327a14fc2146101d3578063313ce567146101f557806349bd5a5e14610211578063537df3b6146102495780636c0a24eb1461026957600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b357600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a81526929b432b9329025b430b760b11b60208201525b6040516101559190610fb1565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611022565b6103db565b6040519015158152602001610155565b34801561019a57600080fd5b5067016345785d8a00005b604051908152602001610155565b3480156101bf57600080fd5b5061017e6101ce36600461104c565b6103f2565b3480156101df57600080fd5b506101f36101ee366004611088565b61045b565b005b34801561020157600080fd5b5060405160098152602001610155565b34801561021d57600080fd5b50600b54610231906001600160a01b031681565b6040516001600160a01b039091168152602001610155565b34801561025557600080fd5b506101f36102643660046110a1565b61056a565b34801561027557600080fd5b506101a560035481565b34801561028b57600080fd5b506101a561029a3660046110a1565b6001600160a01b031660009081526001602052604090205490565b3480156102c157600080fd5b506101f36105d5565b3480156102d657600080fd5b506101f36102e53660046110d2565b61060b565b3480156102f657600080fd5b506000546001600160a01b0316610231565b34801561031457600080fd5b5060408051808201909152600481526329a5a0a760e11b6020820152610148565b34801561034157600080fd5b5061017e610350366004611022565b610697565b34801561036157600080fd5b506101a5610370366004611197565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156103a757600080fd5b506101f36103b63660046110a1565b6106a4565b3480156103c757600080fd5b506101f36103d63660046110a1565b61073f565b60006103e8338484610783565b5060015b92915050565b60006103ff8484846108a7565b610451843361044c856040518060600160405280602881526020016112b7602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610bc6565b610783565b5060019392505050565b6009546001600160a01b0316336001600160a01b03161461047b57600080fd5b61048e67016345785d8a000060c8610c00565b81116104f45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084015b60405180910390fd5b67016345785d8a00008111156105655760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b60648201526084016104eb565b600355565b6000546001600160a01b031633146105945760405162461bcd60e51b81526004016104eb906111ca565b6009546001600160a01b0316336001600160a01b0316146105b457600080fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b6000546001600160a01b031633146105ff5760405162461bcd60e51b81526004016104eb906111ca565b6106096000610c49565b565b6009546001600160a01b0316336001600160a01b03161461062b57600080fd5b60005b81518110156106935760016008600084848151811061064f5761064f6111ff565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b8161122b565b91505061062e565b5050565b60006103e83384846108a7565b6000546001600160a01b031633146106ce5760405162461bcd60e51b81526004016104eb906111ca565b6001600160a01b0381166107335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104eb565b61073c81610c49565b50565b6009546001600160a01b0316336001600160a01b03161461075f57600080fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b6001600160a01b0383166107e55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104eb565b6001600160a01b0382166108465760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104eb565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661090b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104eb565b6001600160a01b03821661096d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104eb565b600081116109cf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104eb565b600b5460ff600160a01b90910416156109f06000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610a1f57506000546001600160a01b03848116911614155b8015610a3457506001600160a01b0384163014155b8015610a4957506001600160a01b0383163014155b15610ba357600b546001600160a01b038581169116148015610a795750600a546001600160a01b03848116911614155b15610b2857600354610aaa83610aa4866001600160a01b031660009081526001602052604090205490565b90610c99565b1115610b285760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104eb565b600b546001600160a01b038481169116148015610b535750600a546001600160a01b03858116911614155b15610ba3576001600160a01b03841660009081526008602052604090205460ff16158015610b9a57506001600160a01b03831660009081526008602052604090205460ff16155b610ba357600080fd5b610baf84848484610cf8565b610bc0600454600655600554600755565b50505050565b60008184841115610bea5760405162461bcd60e51b81526004016104eb9190610fb1565b506000610bf78486611246565b95945050505050565b6000610c4283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d10565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610ca6838561125d565b905083811015610c425760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104eb565b80610d0557610d05610d3e565b610baf848484610d6c565b60008183610d315760405162461bcd60e51b81526004016104eb9190610fb1565b506000610bf78486611275565b600754158015610d4e5750600654155b15610d5557565b600780546005556006805460045560009182905555565b610d9060405180606001604052806000815260200160008152602001600081525090565b610db06064610daa60075485610ef090919063ffffffff16565b90610c00565b6020820152600654610dca90606490610daa908590610ef0565b8082526020820151610de89190610de2908590610f6f565b90610f6f565b6040808301919091526001600160a01b038516600090815260016020522054610e119083610f6f565b6001600160a01b03808616600090815260016020526040808220939093558383015191861681529190912054610e4691610c99565b6001600160a01b038416600090815260016020908152604090912091909155815190820151610e8f91610e799190610c99565b3060009081526001602052604090205490610c99565b30600090815260016020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600082610eff575060006103ec565b6000610f0b8385611297565b905082610f188583611275565b14610c425760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104eb565b6000610c4283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bc6565b600060208083528351808285015260005b81811015610fde57858101830151858201604001528201610fc2565b81811115610ff0576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461101d57600080fd5b919050565b6000806040838503121561103557600080fd5b61103e83611006565b946020939093013593505050565b60008060006060848603121561106157600080fd5b61106a84611006565b925061107860208501611006565b9150604084013590509250925092565b60006020828403121561109a57600080fd5b5035919050565b6000602082840312156110b357600080fd5b610c4282611006565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156110e557600080fd5b823567ffffffffffffffff808211156110fd57600080fd5b818501915085601f83011261111157600080fd5b813581811115611123576111236110bc565b8060051b604051601f19603f83011681018181108582111715611148576111486110bc565b60405291825284820192508381018501918883111561116657600080fd5b938501935b8285101561118b5761117c85611006565b8452938501939285019261116b565b98975050505050505050565b600080604083850312156111aa57600080fd5b6111b383611006565b91506111c160208401611006565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561123f5761123f611215565b5060010190565b60008282101561125857611258611215565b500390565b6000821982111561127057611270611215565b500190565b60008261129257634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156112b1576112b1611215565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205084aaf3d4ef7c6c0f6e49453d12bc521912de6d29cab21493ce35ca1032d98b64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 2,363 |
0xfa5f618b27b26dae1ca33ff2893fb684daebf6e8
|
/**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
// 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 FOXXXY 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 = 100000000000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'WHAT DOES THE FOX SAY';
string private _symbol = 'WDTFS \xF0\x9F\xA6\x8A';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 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);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122083fb4b57692185cefc5677c1abab4ba100bb7bb2b229bcd7f5a83c8c4d25862064736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,364 |
0x4b9635cb63f73b0a9202119eb072b98fc7441e08
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Breast Coin' token contract
//
// Symbol : BRST
// Name : Breast Coin
// Total supply: 10 000 000 000
// Decimals : 8
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract BRST is BurnableToken {
string public constant name = "Breast Coin";
string public constant symbol = "BRST";
uint public constant decimals = 8;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600b81526020017f42726561737420436f696e00000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6008600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f425253540000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220dcfe28d8e04f89282b952c54e878430644c5eabe5a232612d637dff82766ab1464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 2,365 |
0xfc05282b1b119008a481fe6d33a68a4f58986423
|
/*
/* Website: XmasTree.info
/* Telegram: t.me/xtreeETH
/*
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
abstract contract IERC20Extented is IERC20 {
function decimals() external view virtual returns (uint8);
function name() external view virtual returns (string memory);
function symbol() external view virtual returns (string memory);
}
contract XmasTree is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "XMAS Tree";
string private constant _symbol = "XTREE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 100 * 1e6 * 1e9; // 100,000,000
uint256 private _firstBlock;
uint256 private _notpogBlocks;
uint256 public _maxWalletAmount;
// fees
uint256 public _liquidityFee = 20; // divided by 1000
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 public _marketingFee = 80; // divided by 1000
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _marketingPercent = 1000;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private notpogs;
address payable private _marketingAddress = payable(0xA3105bfE5B7449977B5EFd8deA351b583365C9d8);
address payable private _dev = payable(0x7922f162AA1caE70d18Fa8795f5eC361042e8178);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxTxAmount;
bool private tradingOpen = false;
bool private inSwap = false;
bool private trdg = true;
bool private um = true;
bool private pairSwapped = false;
event EndedTrdg(bool trdg);
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply
_maxWalletAmount = _tTotal.div(1); // 100%
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() override external pure returns (string memory) {
return _name;
}
function symbol() override external pure returns (string memory) {
return _symbol;
}
function decimals() override external pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_marketingFee == 0 && _liquidityFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 0;
_liquidityFee = 0;
}
function setNotpogFee() private {
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 900;
_liquidityFee = 0;
}
function restoreAllFee() private {
_marketingFee = _previousMarketingFee;
_liquidityFee = _previousLiquidityFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = true;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
require(tradingOpen);
require(amount <= _maxTxAmount);
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {//buys
if (block.number <= _firstBlock.add(_notpogBlocks)) {
notpogs[to] = true;
}
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
if (notpogs[to]) {
setNotpogFee();
takeFee = true;
}
}
if (!inSwap && from != uniswapV2Pair) { //sells, transfers
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 100000 * 1e9) {
swapAndLiquify(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee));
// split the contract balance into halves
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer((amount).div(5).mul(4));
_dev.transfer((amount).div(5).mul(1));
}
function openTrading(uint256 notpogBlocks) private {
_firstBlock = block.number;
_notpogBlocks = notpogBlocks;
tradingOpen = true;
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(contractETHBalance);
}
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(_marketingFee).div(1000);
fees.tLiquidity = amount.mul(_liquidityFee).div(1000);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
require(maxTxAmount > _tTotal.div(10000), "Amount must be greater than 0.01% of supply");
require(maxTxAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxTxAmount = maxTxAmount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() {
require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
function setTaxes(uint256 marketingFee, uint256 liquidityFee) external onlyOwner() {
uint256 totalFee = marketingFee.add(liquidityFee);
require(totalFee.div(10) < 50, "Sum of fees must be less than 50");
_marketingFee = marketingFee;
_liquidityFee = liquidityFee;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
uint256 totalETHfees = _marketingFee;
_marketingPercent = (_marketingFee.mul(1000)).div(totalETHfees);
emit FeesUpdated(_marketingFee, _liquidityFee);
}
function endTrdg(uint256 notpogBlocks) external onlyOwner() {
require(trdg == true, "done");
trdg = false;
openTrading(notpogBlocks);
emit EndedTrdg(trdg);
}
}
|
0x60806040526004361061012e5760003560e01c80636bc87c3a116100ab578063a9059cbb1161006f578063a9059cbb14610362578063c647b20e14610382578063dd62ed3e146103a2578063ec28438a146103e8578063f2fde38b14610408578063f42938901461042857600080fd5b80636bc87c3a146102b45780636c0a24eb146102ca57806370a08231146102e05780638da5cb5b1461031657806395d89b411461033457600080fd5b806327a14fc2116100f257806327a14fc214610209578063313ce5671461022b57806349bd5a5e1461024757806351bc3c851461027f5780635d12d79d1461029457600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57806322976e0d146101d357806323b872dd146101e957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268584d4153205472656560b81b60208201525b604051610175919061173d565b60405180910390f35b34801561018a57600080fd5b5061019e6101993660046116a8565b61043d565b6040519015158152602001610175565b3480156101ba57600080fd5b5067016345785d8a00005b604051908152602001610175565b3480156101df57600080fd5b506101c5600a5481565b3480156101f557600080fd5b5061019e610204366004611667565b610454565b34801561021557600080fd5b506102296102243660046116d4565b6104bd565b005b34801561023757600080fd5b5060405160098152602001610175565b34801561025357600080fd5b50601154610267906001600160a01b031681565b6040516001600160a01b039091168152602001610175565b34801561028b57600080fd5b50610229610591565b3480156102a057600080fd5b506102296102af3660046116d4565b6105dd565b3480156102c057600080fd5b506101c560085481565b3480156102d657600080fd5b506101c560075481565b3480156102ec57600080fd5b506101c56102fb3660046115f4565b6001600160a01b031660009081526002602052604090205490565b34801561032257600080fd5b506000546001600160a01b0316610267565b34801561034057600080fd5b50604080518082019091526005815264585452454560d81b6020820152610168565b34801561036e57600080fd5b5061019e61037d3660046116a8565b6106aa565b34801561038e57600080fd5b5061022961039d3660046116ed565b6106b7565b3480156103ae57600080fd5b506101c56103bd36600461162e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103f457600080fd5b506102296104033660046116d4565b6107c2565b34801561041457600080fd5b506102296104233660046115f4565b6108bf565b34801561043457600080fd5b50610229610957565b600061044a3384846109da565b5060015b92915050565b6000610461848484610afe565b6104b384336104ae8560405180606001604052806028815260200161193a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610edb565b6109da565b5060019392505050565b6000546001600160a01b031633146104f05760405162461bcd60e51b81526004016104e790611792565b60405180910390fd5b61050367016345785d8a000060c8610991565b81116105645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084016104e7565b67016345785d8a000081111561058c5760405162461bcd60e51b81526004016104e7906117c7565b600755565b6000546001600160a01b031633146105bb5760405162461bcd60e51b81526004016104e790611792565b3060009081526002602052604090205480156105da576105da81610f15565b50565b6000546001600160a01b031633146106075760405162461bcd60e51b81526004016104e790611792565b60135462010000900460ff16151560011461064d5760405162461bcd60e51b81526004016104e790602080825260049082015263646f6e6560e01b604082015260600190565b6013805443600555600683905562ff00ff191660011790556013546040516201000090910460ff16151581527fbbd2154e443da58493f520fb1a0b04614579664458bbef399ac6a4021c401c17906020015b60405180910390a150565b600061044a338484610afe565b6000546001600160a01b031633146106e15760405162461bcd60e51b81526004016104e790611792565b60006106ed8383611098565b905060326106fc82600a610991565b106107495760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e20353060448201526064016104e7565b600a8390556008829055600b8390556009829055826107748161076e816103e86110f7565b90610991565b600c55600a546008546040517f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1926107b492908252602082015260400190565b60405180910390a150505050565b6000546001600160a01b031633146107ec5760405162461bcd60e51b81526004016104e790611792565b61080067016345785d8a0000612710610991565b81116108625760405162461bcd60e51b815260206004820152602b60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e303160448201526a25206f6620737570706c7960a81b60648201526084016104e7565b67016345785d8a000081111561088a5760405162461bcd60e51b81526004016104e7906117c7565b60128190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200161069f565b6000546001600160a01b031633146108e95760405162461bcd60e51b81526004016104e790611792565b6001600160a01b03811661094e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e7565b6105da81611176565b6000546001600160a01b031633146109815760405162461bcd60e51b81526004016104e790611792565b4780156105da576105da816111c6565b60006109d383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061125f565b9392505050565b6001600160a01b038316610a3c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e7565b6001600160a01b038216610a9d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b625760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e7565b6001600160a01b038216610bc45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e7565b60008111610c265760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e7565b6001610c3a6000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c6957506000546001600160a01b03848116911614155b8015610c7e57506001600160a01b0384163014155b8015610c9357506001600160a01b0383163014155b15610e705760135460ff16610ca757600080fd5b601254821115610cb657600080fd5b6011546001600160a01b038581169116148015610ce157506010546001600160a01b03848116911614155b15610e0b57600654600554610cf591611098565b4311610d1f576001600160a01b0383166000908152600d60205260409020805460ff191660011790555b600754610d4b83610d45866001600160a01b031660009081526002602052604090205490565b90611098565b1115610dc95760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104e7565b6001600160a01b0383166000908152600d602052604090205460ff1615610e0b57610e07600a8054600b556008805460095561038490915560009055565b5060015b601354610100900460ff16158015610e3157506011546001600160a01b03858116911614155b15610e705730600090815260026020526040902054655af3107a4000811115610e5d57610e5d8161128d565b478015610e6d57610e6d476111c6565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610eaf57506001600160a01b03831660009081526004602052604090205460ff165b15610eb8575060005b610ec484848484611308565b610ed5600b54600a55600954600855565b50505050565b60008184841115610eff5760405162461bcd60e51b81526004016104e7919061173d565b506000610f0c84866118e1565b95945050505050565b6013805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f5957610f5961190e565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610fad57600080fd5b505afa158015610fc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe59190611611565b81600181518110610ff857610ff861190e565b6001600160a01b03928316602091820292909201015260105461101e91309116846109da565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611057908590600090869030904290600401611817565b600060405180830381600087803b15801561107157600080fd5b505af1158015611085573d6000803e3d6000fd5b50506013805461ff001916905550505050565b6000806110a58385611888565b9050838110156109d35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e7565b6000826111065750600061044e565b600061111283856118c2565b90508261111f85836118a0565b146109d35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600e546001600160a01b03166108fc6111eb60046111e5856005610991565b906110f7565b6040518115909202916000818181858888f19350505050158015611213573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61123360016111e5856005610991565b6040518115909202916000818181858888f1935050505015801561125b573d6000803e3d6000fd5b5050565b600081836112805760405162461bcd60e51b81526004016104e7919061173d565b506000610f0c84866118a0565b6013805461ff001916610100179055600854600a546000916112bf916112b291611098565b60085461076e90856110f7565b905060006112ce826002610991565b905060006112dc8483611320565b9050476112e882610f15565b60006112fc8361076e866111e54787611320565b90506110858482611362565b8061131557611315611446565b610ec4848484611474565b60006109d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610edb565b60105461137a9030906001600160a01b0316846109da565b6010546001600160a01b031663f305d7198230856000806113a36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061143f919061170f565b5050505050565b600a541580156114565750600854155b1561145d57565b600a8054600b556008805460095560009182905555565b61149860405180606001604052806000815260200160008152602001600081525090565b6114b36103e861076e600a54856110f790919063ffffffff16565b60208201526008546114ce906103e89061076e9085906110f7565b80825260208201516114ec91906114e6908590611320565b90611320565b6040808301919091526001600160a01b0385166000908152600260205220546115159083611320565b6001600160a01b0380861660009081526002602052604080822093909355838301519186168152919091205461154a91611098565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516115939161157d9190611098565b3060009081526002602052604090205490611098565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b60006020828403121561160657600080fd5b81356109d381611924565b60006020828403121561162357600080fd5b81516109d381611924565b6000806040838503121561164157600080fd5b823561164c81611924565b9150602083013561165c81611924565b809150509250929050565b60008060006060848603121561167c57600080fd5b833561168781611924565b9250602084013561169781611924565b929592945050506040919091013590565b600080604083850312156116bb57600080fd5b82356116c681611924565b946020939093013593505050565b6000602082840312156116e657600080fd5b5035919050565b6000806040838503121561170057600080fd5b50508035926020909101359150565b60008060006060848603121561172457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561176a5785810183015185820160400152820161174e565b8181111561177c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160408201526f6c20746f20746f74616c537570706c7960801b606082015260800190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118675784516001600160a01b031683529383019391830191600101611842565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561189b5761189b6118f8565b500190565b6000826118bd57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118dc576118dc6118f8565b500290565b6000828210156118f3576118f36118f8565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105da57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206bff5bb3b694375781e867882a3ac8dfef2ada3436f8ec2f0b8f0ee8959406cf64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 2,366 |
0xe1095934cae87c98494dbd5e23365107ecff9e2f
|
pragma solidity ^0.4.25;
/*
* https://cryptominertoken.cloud
* https://discord.gg/ANBgN3P
*
* Crypto Miner Classic concept
*
* [✓] 5% Withdraw fee
* [✓] 15% Deposit fee
* [✓] 1% Token transfer
* [✓] 35% Referal link
*
*/
contract CryptoMinerClassic {
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "Crypto Miner Classic";
string public symbol = "CMC";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 15;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 5;
uint8 constant internal refferalFee_ = 35;
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether;
uint256 constant internal magnitude = 2 ** 64;
uint256 public stakingRequirement = 50e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if (myDividends(true) > 0) {
withdraw();
}
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f610879565b34801561029857600080fd5b5061013f600435151561087f565b3480156102b257600080fd5b5061013f6108c2565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c7565b3480156102e857600080fd5b5061013f6108e2565b3480156102fd57600080fd5b5061013f61092d565b34801561031257600080fd5b5061016661093f565b34801561032757600080fd5b5061033f600160a060020a0360043516602435610999565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3c565b34801561037757600080fd5b50610260610ca8565b61013f600160a060020a0360043516610cd5565b3480156103a057600080fd5b50610260610ce1565b600033818080808080806103c86103c18c600f610d97565b6064610dcd565b96506103d86103c1886023610d97565b95506103e48787610de4565b94506103f08b88610de4565b93506103fb84610df6565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600f610d97565b92506106f48584610de4565b91506106ff82610df6565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846005610d97565b91506106ff8383610de4565b601281565b600080600061075e600161087f565b1161076857600080fd5b339150610775600061087f565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610840576414f46b04009350610873565b610851670de0b6b3a7640000610e9d565b92506108616103c1846005610d97565b915061086d8383610de4565b90508093505b50505090565b60025481565b60003382610895576108908161060c565b6108b9565b600160a060020a0381166000908152600460205260409020546108b78261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109005764199c82cc009350610873565b610911670de0b6b3a7640000610e9d565b92506109216103c184600f610d97565b915061086d8383610e8e565b600033610939816108c7565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109aa61092d565b116109b457600080fd5b336000818152600360205260409020549094508611156109d357600080fd5b60006109df600161087f565b11156109ed576109ed61074f565b6109fb6103c1876001610d97565b9250610a078684610de4565b9150610a1283610e9d565b9050610a2060065484610de4565b600655600160a060020a038416600090815260036020526040902054610a469087610de4565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a759083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610ae99190680100000000000000008402811515610ae357fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b4f61092d565b11610b5957600080fd5b33600081815260036020526040902054909650871115610b7857600080fd5b869450610b8485610e9d565b9350610b946103c1856005610d97565b9250610ba08484610de4565b9150610bae60065486610de4565b600655600160a060020a038616600090815260036020526040902054610bd49086610de4565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4457610c40600754600654680100000000000000008602811515610ae357fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7a6108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cc957610cc981610b3c565b610cd161074f565b5050565b60006108bc34836103a9565b600080600080610cf1600161087f565b11610cfb57600080fd5b610d05600061087f565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d479084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610daa5760009150610dc6565b50828202828482811515610dba57fe5b0414610dc257fe5b8091505b5092915050565b6000808284811515610ddb57fe5b04949350505050565b600082821115610df057fe5b50900390565b6006546000906c01431e0fae6d7217caa00000009082906402540be400610e7b610e75730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f09565b85610de4565b811515610e8457fe5b0403949350505050565b600082820183811015610dc257fe5b600654600090670de0b6b3a7640000838101918101908390610ef66414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610ef057fe5b04610de4565b811515610eff57fe5b0495945050505050565b80600260018201045b818110156108bc578091506002818285811515610f2b57fe5b0401811515610f3657fe5b049050610f125600a165627a7a72305820e334d44ccb69a28eeac21d4235ecbf0dc2a07386eae4642fd38c0b3af8ee42b10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,367 |
0x986b100aeb80b11234b0a62d4c238e1daad71829
|
pragma solidity 0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {return 0;}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function mint(address account, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface Uniswap{
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function WETH() external pure returns (address);
}
interface Pool{
function primary() external view returns (address);
}
contract Poolable{
address payable internal constant _POOLADDRESS = 0xfA0463FcD65AA8668c492e71Eda9653Ac1705C0d;
function primary() private view returns (address) {
return Pool(_POOLADDRESS).primary();
}
modifier onlyPrimary() {
require(msg.sender == primary(), "Caller is not primary");
_;
}
}
contract StakingBalancer is Poolable{
using SafeMath for uint256;
uint constant internal DECIMAL = 10**18;
uint constant public INF = 33136721748;
uint private _rewardValue = 10**21;
mapping (address => uint256) public timePooled;
mapping (address => uint256) private internalTime;
mapping (address => uint256) private LPTokenBalance;
mapping (address => uint256) private rewards;
mapping (address => uint256) private referralEarned;
address public corbV2Address;
address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public WETHAddress = Uniswap(UNIROUTER).WETH();
bool private _unchangeable = false;
bool private _tokenAddressGiven = false;
bool public priceCapped = false;
uint public creationTime = now;
receive() external payable {
if(msg.sender != UNIROUTER){
stake();
}
}
function sendValue(address payable recipient, uint256 amount) internal {
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
//If true, no changes can be made
function unchangeable() public view returns (bool){
return _unchangeable;
}
function rewardValue() public view returns (uint){
return _rewardValue;
}
//THE ONLY ADMIN FUNCTIONS vvvv
//After this is called, no changes can be made
function makeUnchangeable() public {
_unchangeable = true;
}
//Can only be called once to set token address
function setTokenAddress(address input) public {
require(!_tokenAddressGiven, "Function was already called");
_tokenAddressGiven = true;
corbV2Address = input;
}
//Set reward value that has high APY, can't be called if makeUnchangeable() was called
function updateRewardValue(uint input) public {
require(!unchangeable(), "makeUnchangeable() function was already called");
_rewardValue = input;
}
//Cap token price at 1 eth, can't be called if makeUnchangeable() was called
function capPrice(bool input) public {
require(!unchangeable(), "makeUnchangeable() function was already called");
priceCapped = input;
}
//THE ONLY ADMIN FUNCTIONS ^^^^
function sqrt(uint y) public pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
function stake() public payable{
require(creationTime + 1 hours <= now, "It has not been 1 hour since contract creation yet");
address staker = msg.sender;
address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress);
if(price() >= (1.05 * 10**18) && priceCapped){
uint t = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap
uint a = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint x = (sqrt(9*t*t + 3988000*a*t) - 1997*t)/1994;
IERC20(corbV2Address).mint(address(this), x);
address[] memory path = new address[](2);
path[0] = corbV2Address;
path[1] = WETHAddress;
IERC20(corbV2Address).approve(UNIROUTER, x);
Uniswap(UNIROUTER).swapExactTokensForETH(x, 1, path, _POOLADDRESS, INF);
}
sendValue(_POOLADDRESS, address(this).balance/2);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap
uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount);
IERC20(corbV2Address).mint(address(this), toMint);
uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this));
uint amountTokenDesired = IERC20(corbV2Address).balanceOf(address(this));
IERC20(corbV2Address).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens
Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(corbV2Address, amountTokenDesired, 1, 1, address(this), INF);
uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this));
uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore);
rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker));
timePooled[staker] = now;
internalTime[staker] = now;
LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot);
}
function withdrawRewardTokens(uint amount) public {
require(timePooled[msg.sender] + 3 days <= now, "It has not been 3 days since you staked yet");
rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender));
internalTime[msg.sender] = now;
uint removeAmount = ethtimeCalc(amount);
rewards[msg.sender] = rewards[msg.sender].sub(removeAmount);
IERC20(corbV2Address).mint(msg.sender, amount);
}
function viewRecentRewardTokenAmount(address who) internal view returns (uint){
return (viewLPTokenAmount(who).mul( now.sub(internalTime[who]) ));
}
function viewRewardTokenAmount(address who) public view returns (uint){
return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who)) );
}
function viewLPTokenAmount(address who) public view returns (uint){
return LPTokenBalance[who];
}
function viewPooledEthAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function viewPooledTokenAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress);
uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap
return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function price() public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap
return (DECIMAL.mul(ethAmount)).div(tokenAmount);
}
function ethEarnCalc(uint eth, uint time) public view returns(uint){
address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress);
uint totalEth = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint totalLP = IERC20(poolAddress).totalSupply();
uint LP = ((eth/2)*totalLP)/totalEth;
return earnCalc(LP * time);
}
function earnCalc(uint LPTime) public view returns(uint){
return ( rewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL );
}
function ethtimeCalc(uint orb) internal view returns(uint){
return ( orb.mul(31557600 * DECIMAL) ).div( rewardValue() );
}
}
|
0x60806040526004361061014f5760003560e01c8063a035b1fe116100b6578063d28de2731161006f578063d28de273146105f2578063d488ebe814610633578063d8270dce14610698578063e42255d8146106c3578063e91ed7c914610728578063ff2eba681461078d576101a6565b8063a035b1fe1461046a578063a064b44b14610495578063a509bf68146104e4578063b1fd674014610525578063c4fcf8261461058a578063cb43b2dd146105b7576101a6565b8063475d873311610108578063475d8733146103185780634caacd751461032f578063677342ce1461035c5780637228cd7d146103ab5780638439a541146104045780639d2a679f1461043f576101a6565b80630af88b24146101ab57806312c7df73146101ec57806326a4e8d21461021757806329b83c2e146102685780632dd31000146102cd5780633a4b66f11461030e576101a6565b366101a657737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101a4576101a36107ca565b5b005b600080fd5b3480156101b757600080fd5b506101c061184c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f857600080fd5b50610201611872565b6040518082815260200191505060405180910390f35b34801561022357600080fd5b506102666004803603602081101561023a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061187b565b005b34801561027457600080fd5b506102b76004803603602081101561028b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061195d565b6040518082815260200191505060405180910390f35b3480156102d957600080fd5b506102e2611975565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103166107ca565b005b34801561032457600080fd5b5061032d61198d565b005b34801561033b57600080fd5b506103446119aa565b60405180821515815260200191505060405180910390f35b34801561036857600080fd5b506103956004803603602081101561037f57600080fd5b81019080803590602001909291905050506119c1565b6040518082815260200191505060405180910390f35b3480156103b757600080fd5b506103ee600480360360408110156103ce57600080fd5b810190808035906020019092919080359060200190929190505050611a23565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b5061043d6004803603602081101561042757600080fd5b8101908080359060200190929190505050611cbe565b005b34801561044b57600080fd5b50610454611d26565b6040518082815260200191505060405180910390f35b34801561047657600080fd5b5061047f611d2f565b6040518082815260200191505060405180910390f35b3480156104a157600080fd5b506104ce600480360360208110156104b857600080fd5b8101908080359060200190929190505050612011565b6040518082815260200191505060405180910390f35b3480156104f057600080fd5b506104f961204b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053157600080fd5b506105746004803603602081101561054857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612071565b6040518082815260200191505060405180910390f35b34801561059657600080fd5b5061059f61230c565b60405180821515815260200191505060405180910390f35b3480156105c357600080fd5b506105f0600480360360208110156105da57600080fd5b810190808035906020019092919050505061231f565b005b3480156105fe57600080fd5b506106076125ee565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063f57600080fd5b506106826004803603602081101561065657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612606565b6040518082815260200191505060405180910390f35b3480156106a457600080fd5b506106ad612671565b6040518082815260200191505060405180910390f35b3480156106cf57600080fd5b50610712600480360360208110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612677565b6040518082815260200191505060405180910390f35b34801561073457600080fd5b506107776004803603602081101561074b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612912565b6040518082815260200191505060405180910390f35b34801561079957600080fd5b506107c8600480360360208110156107b057600080fd5b8101908080351515906020019092919050505061295b565b005b42610e10600854011115610829576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612ed66032913960400191505060405180910390fd5b60003390506000735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561090d57600080fd5b505afa158015610921573d6000803e3d6000fd5b505050506040513d602081101561093757600080fd5b81019080805190602001909291905050509050670e92596fd629000061095b611d2f565b101580156109755750600760169054906101000a900460ff165b15610fb7576000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a0557600080fd5b505afa158015610a19573d6000803e3d6000fd5b505050506040513d6020811015610a2f57600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610acd57600080fd5b505afa158015610ae1573d6000803e3d6000fd5b505050506040513d6020811015610af757600080fd5b8101908080519060200190929190505050905060006107ca836107cd02610b2b8585623cda200202868760090202016119c1565b0381610b3357fe5b049050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610bc957600080fd5b505af1158015610bdd573d6000803e3d6000fd5b505050506060600267ffffffffffffffff81118015610bfb57600080fd5b50604051908082528060200260200182016040528015610c2a5781602001602082028036833780820191505090505b509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110610c5d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110610cc757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3737a250d5630b4cf539739df2c5dacb4c659f2488d846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610da857600080fd5b505af1158015610dbc573d6000803e3d6000fd5b505050506040513d6020811015610dd257600080fd5b810190808051906020019092919050505050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff166318cbafe58360018473fa0463fcd65aa8668c492e71eda9653ac1705c0d6407b71a3f546040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015610eb3578082015181840152602081019050610e98565b505050509050019650505050505050600060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610f1a57600080fd5b8101908080516040519392919084640100000000821115610f3a57600080fd5b83820191506020820185811115610f5057600080fd5b8251866020820283011164010000000082111715610f6d57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610fa4578082015181840152602081019050610f89565b5050505090500160405250505050505050505b610fdf73fa0463fcd65aa8668c492e71eda9653ac1705c0d60024781610fd957fe5b046129d6565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561106a57600080fd5b505afa15801561107e573d6000803e3d6000fd5b505050506040513d602081101561109457600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561113257600080fd5b505afa158015611146573d6000803e3d6000fd5b505050506040513d602081101561115c57600080fd5b810190808051906020019092919050505090506000611196836111888447612a9a90919063ffffffff16565b612b2090919063ffffffff16565b9050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561122b57600080fd5b505af115801561123f573d6000803e3d6000fd5b5050505060008473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156112ac57600080fd5b505afa1580156112c0573d6000803e3d6000fd5b505050506040513d60208110156112d657600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561137457600080fd5b505afa158015611388573d6000803e3d6000fd5b505050506040513d602081101561139e57600080fd5b81019080805190602001909291905050509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3737a250d5630b4cf539739df2c5dacb4c659f2488d836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561145857600080fd5b505af115801561146c573d6000803e3d6000fd5b505050506040513d602081101561148257600080fd5b810190808051906020019092919050505050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663f305d71947600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600180306407b71a3f546040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561157757600080fd5b505af115801561158b573d6000803e3d6000fd5b50505050506040513d60608110156115a257600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505050505060008673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561163357600080fd5b505afa158015611647573d6000803e3d6000fd5b505050506040513d602081101561165d57600080fd5b8101908080519060200190929190505050905060006116858483612b6a90919063ffffffff16565b90506116e16116938a612bb4565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2990919063ffffffff16565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117fe81600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2990919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054905090565b600760159054906101000a900460ff16156118fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f46756e6374696f6e2077617320616c72656164792063616c6c6564000000000081525060200191505060405180910390fd5b6001600760156101000a81548160ff02191690831515021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915090505481565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b6001600760146101000a81548160ff021916908315150217905550565b6000600760149054906101000a900460ff16905090565b60006003821115611a105781905060006001600284816119dd57fe5b040190505b81811015611a0a578091506002818285816119f957fe5b040181611a0257fe5b0490506119e2565b50611a1e565b60008214611a1d57600190505b5b919050565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611b0357600080fd5b505afa158015611b17573d6000803e3d6000fd5b505050506040513d6020811015611b2d57600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611bcb57600080fd5b505afa158015611bdf573d6000803e3d6000fd5b505050506040513d6020811015611bf557600080fd5b8101908080519060200190929190505050905060008273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c5057600080fd5b505afa158015611c64573d6000803e3d6000fd5b505050506040513d6020811015611c7a57600080fd5b810190808051906020019092919050505090506000828260028981611c9b57fe5b040281611ca457fe5b049050611cb2868202612011565b94505050505092915050565b611cc66119aa565b15611d1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612f33602e913960400191505060405180910390fd5b8060008190555050565b6407b71a3f5481565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611e0f57600080fd5b505afa158015611e23573d6000803e3d6000fd5b505050506040513d6020811015611e3957600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611ed757600080fd5b505afa158015611eeb573d6000803e3d6000fd5b505050506040513d6020811015611f0157600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611f9f57600080fd5b505afa158015611fb3573d6000803e3d6000fd5b505050506040513d6020811015611fc957600080fd5b8101908080519060200190929190505050905061200981611ffb84670de0b6b3a7640000612a9a90919063ffffffff16565b612b2090919063ffffffff16565b935050505090565b6000670de0b6b3a76400006301e187e00261203c8361202e611872565b612a9a90919063ffffffff16565b8161204357fe5b049050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561215157600080fd5b505afa158015612165573d6000803e3d6000fd5b505050506040513d602081101561217b57600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561221957600080fd5b505afa15801561222d573d6000803e3d6000fd5b505050506040513d602081101561224357600080fd5b810190808051906020019092919050505090506123038273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561229f57600080fd5b505afa1580156122b3573d6000803e3d6000fd5b505050506040513d60208110156122c957600080fd5b81019080805190602001909291905050506122f56122e687612912565b84612a9a90919063ffffffff16565b612b2090919063ffffffff16565b92505050919050565b600760169054906101000a900460ff1681565b426203f480600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111156123bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612f08602b913960400191505060405180910390fd5b6124166123c833612bb4565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2990919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006124a882612cb1565b90506124fc81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6a90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156125d257600080fd5b505af11580156125e6573d6000803e3d6000fd5b505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b600061266a61266561261784612bb4565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2990919063ffffffff16565b612011565b9050919050565b60085481565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561281f57600080fd5b505afa158015612833573d6000803e3d6000fd5b505050506040513d602081101561284957600080fd5b810190808051906020019092919050505090506129098273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156128a557600080fd5b505afa1580156128b9573d6000803e3d6000fd5b505050506040513d60208110156128cf57600080fd5b81019080805190602001909291905050506128fb6128ec87612912565b84612a9a90919063ffffffff16565b612b2090919063ffffffff16565b92505050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6129636119aa565b156129b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612f33602e913960400191505060405180910390fd5b80600760166101000a81548160ff02191690831515021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d8060008114612a36576040519150601f19603f3d011682016040523d82523d6000602084013e612a3b565b606091505b5050905080612a95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180612e7b603a913960400191505060405180910390fd5b505050565b600080831415612aad5760009050612b1a565b6000828402905082848281612abe57fe5b0414612b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612eb56021913960400191505060405180910390fd5b809150505b92915050565b6000612b6283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cf4565b905092915050565b6000612bac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612dba565b905092915050565b6000612c22612c0b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442612b6a90919063ffffffff16565b612c1484612912565b612a9a90919063ffffffff16565b9050919050565b600080828401905083811015612ca7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612ced612cbe611872565b612cdf670de0b6b3a76400006301e187e00285612a9a90919063ffffffff16565b612b2090919063ffffffff16565b9050919050565b60008083118290612da0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d65578082015181840152602081019050612d4a565b50505050905090810190601f168015612d925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612dac57fe5b049050809150509392505050565b6000838311158290612e67576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612e2c578082015181840152602081019050612e11565b50505050905090810190601f168015612e595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77497420686173206e6f74206265656e203120686f75722073696e636520636f6e7472616374206372656174696f6e20796574497420686173206e6f74206265656e203320646179732073696e636520796f75207374616b6564207965746d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a26469706673582212201a29df39eeba44beeb51faa29e28775a83920ddf1bdb45fdfbb77a0142c6ccb264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,368 |
0xc9fd74b9fef8ee576e36259ad3f1f5950f19fdaf
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title 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;
}
}
/**
* CAPToken
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @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. Allowed for owner only
* @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);
}
}
contract CAPToken is StandardToken, BurnableToken, Ownable {
// Constants
string public constant name = "CapitaliseCrypto";
string public constant symbol = "CAP";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 250000000 * (10 ** uint256(decimals));
// Properties
address public creatorAddress;
/**
* Constructor - instantiates token supply and allocates balance of
* to the admin (msg.sender).
*/
function CAPToken(address _creator) public {
// Mint all tokens to creator
balances[msg.sender] = INITIAL_SUPPLY;
totalSupply_ = INITIAL_SUPPLY;
// Set creator address
creatorAddress = _creator;
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e57806342966c68146102cd57806366188463146102f057806370a082311461034a5780638da5cb5b1461039757806395d89b41146103ec578063a9059cbb1461047a578063d73dd623146104d4578063dd62ed3e1461052e578063e927fc5c1461059a578063f2fde38b146105ef575b600080fd5b34156100f657600080fd5b6100fe610628565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610661565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610753565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061075d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610b17565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610b28565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610b2d565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c7f565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f10565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f58565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f757600080fd5b6103ff610f7e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043f578082015181840152602081019050610424565b50505050905090810190601f16801561046c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048557600080fd5b6104ba600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fb7565b604051808215151515815260200191505060405180910390f35b34156104df57600080fd5b610514600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111d6565b604051808215151515815260200191505060405180910390f35b341561053957600080fd5b610584600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113d2565b6040518082815260200191505060405180910390f35b34156105a557600080fd5b6105ad611459565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105fa57600080fd5b610626600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061147f565b005b6040805190810160405280601081526020017f4361706974616c69736543727970746f0000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561079a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107e757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087257600080fd5b6108c3826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610956826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a2782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a630ee6b2800281565b601281565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b7c57600080fd5b339050610bd0826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c27826001546115d790919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d90576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e24565b610da383826115d790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434150000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ff457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561104157600080fd5b611092826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611125826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061126782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114db57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561151757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156115e557fe5b818303905092915050565b600080828401905083811015151561160457fe5b80915050929150505600a165627a7a723058208d528df75caa912f2881c4940e01702b57582d025f7d5331052916c503af52830029
|
{"success": true, "error": null, "results": {}}
| 2,369 |
0xaaa89105dab822dbc9a6de64a23d045d99d5fd36
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract HireGoToken is MintableToken, BurnableToken {
string public constant name = "HireGo";
string public constant symbol = "HGO";
uint32 public constant decimals = 18;
function HireGoToken() public {
totalSupply = 100000000E18; //100m
balances[owner] = totalSupply; // Add all tokens to issuer balance (crowdsale in this case)
}
}
|
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100f557806306fdde031461011c578063095ea7b3146101a657806318160ddd146101c857806323b872dd146101ed578063313ce5671461021557806340c10f191461024157806342966c6814610263578063661884631461027b57806370a082311461029d5780637d64bcb4146102bc5780638da5cb5b146102cf57806395d89b41146102fe578063a9059cbb14610311578063d73dd62314610333578063dd62ed3e14610355578063f2fde38b1461037a575b600080fd5b341561010057600080fd5b610108610399565b604051901515815260200160405180910390f35b341561012757600080fd5b61012f6103a9565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016b578082015183820152602001610153565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b610108600160a060020a03600435166024356103e0565b34156101d357600080fd5b6101db61044c565b60405190815260200160405180910390f35b34156101f857600080fd5b610108600160a060020a0360043581169060243516604435610452565b341561022057600080fd5b6102286105d4565b60405163ffffffff909116815260200160405180910390f35b341561024c57600080fd5b610108600160a060020a03600435166024356105d9565b341561026e57600080fd5b6102796004356106e6565b005b341561028657600080fd5b610108600160a060020a03600435166024356107af565b34156102a857600080fd5b6101db600160a060020a03600435166108a9565b34156102c757600080fd5b6101086108c4565b34156102da57600080fd5b6102e261094f565b604051600160a060020a03909116815260200160405180910390f35b341561030957600080fd5b61012f61095e565b341561031c57600080fd5b610108600160a060020a0360043516602435610995565b341561033e57600080fd5b610108600160a060020a0360043516602435610a90565b341561036057600080fd5b6101db600160a060020a0360043581169060243516610b34565b341561038557600080fd5b610279600160a060020a0360043516610b5f565b60035460a060020a900460ff1681565b60408051908101604052600681527f48697265476f0000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000600160a060020a038316151561046957600080fd5b600160a060020a03841660009081526001602052604090205482111561048e57600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156104c157600080fd5b600160a060020a0384166000908152600160205260409020546104ea908363ffffffff610bfa16565b600160a060020a03808616600090815260016020526040808220939093559085168152205461051f908363ffffffff610c0c16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610567908363ffffffff610bfa16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b60035460009033600160a060020a039081169116146105f757600080fd5b60035460a060020a900460ff161561060e57600080fd5b600054610621908363ffffffff610c0c16565b6000908155600160a060020a03841681526001602052604090205461064c908363ffffffff610c0c16565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60008082116106f457600080fd5b600160a060020a03331660009081526001602052604090205482111561071957600080fd5b5033600160a060020a03811660009081526001602052604090205461073e9083610bfa565b600160a060020a0382166000908152600160205260408120919091555461076b908363ffffffff610bfa16565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561080c57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610843565b61081c818463ffffffff610bfa16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a039081169116146108e257600080fd5b60035460a060020a900460ff16156108f957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600381527f48474f0000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109ac57600080fd5b600160a060020a0333166000908152600160205260409020548211156109d157600080fd5b600160a060020a0333166000908152600160205260409020546109fa908363ffffffff610bfa16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a2f908363ffffffff610c0c16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610ac8908363ffffffff610c0c16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b7a57600080fd5b600160a060020a0381161515610b8f57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610c0657fe5b50900390565b600082820183811015610c1b57fe5b93925050505600a165627a7a723058202b9bc36848cd36f767bb0a0dd00e160e75a6ae0fd290ee266feb0d0e557d4dee0029
|
{"success": true, "error": null, "results": {}}
| 2,370 |
0x4eb07120772ad18785792663ef94970f4f006885
|
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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);
_;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
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)
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)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
// Coalichain (https://coalichain.io)
/**
* The Coalichain token (ZUZ) has a fixed supply and restricts the ability
* to transfer tokens until after ICO (owner calls the shots wrt to that)
*
* Owner may let a token sale contract transfer ZUZ to buyers during ICO by set the amount through setCrowdsale method
*/
contract CoalichainToken is StandardToken, BurnableToken, Ownable {
// Constants
string public constant name = "Coalichain Token";
string public constant symbol = "ZUZ";
uint8 public constant decimals = 6;
uint256 public constant INITIAL_SUPPLY = 770000000 * (10 ** uint256(decimals));
uint256 public constant CROWDSALE_ALLOWANCE = 462000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = 308000000 * (10 ** uint256(decimals));
// Properties
uint256 public crowdSaleAllowance; // the number of tokens available for crowdsales
uint256 public adminAllowance; // the number of tokens available for the administrator
address public crowdSaleAddr = 0xd742955953f5c510f21a65c90ab87823d0b12683; // the address of a crowdsale contract set to sale ZUZ
address public adminAddr = 0xDee6Bd05672110F44C90B98438089d77aD819F48; // the address of the token admin account
bool public transferEnabled = false; // indicates if transferring tokens is enabled or not
// Modifiers
modifier onlyWhenTransferEnabled() {
if (!transferEnabled) {
require(msg.sender == adminAddr || msg.sender == crowdSaleAddr);
}
_;
}
/**
* The listed addresses are not valid recipients of tokens.
*
* 0x0 - the zero address is not valid
* this - the contract itself should not receive tokens
* owner - the owner has all the initial tokens, but cannot receive any back
* adminAddr - the admin has an allowance of tokens to transfer, but does not receive any
* crowdSaleAddr - the crowdsale has an allowance of tokens to transfer, but does not receive any
*/
modifier validDestination(address _to) {
require(_to != address(0x0));
require(_to != address(this));
require(_to != owner);
require(_to != address(adminAddr));
require(_to != address(crowdSaleAddr));
_;
}
/**
* Constructor - instantiates token supply and allocates balanace of
* to the owner (msg.sender).
*/
function CoalichainToken() {
// the owner is a custodian of tokens that can
// give an allowance of tokens for crowdsales
// or to the admin, but cannot itself transfer
// tokens; hence, this requirement
//require(msg.sender != _admin);
totalSupply = INITIAL_SUPPLY;
crowdSaleAllowance = CROWDSALE_ALLOWANCE;
adminAllowance = ADMIN_ALLOWANCE;
// mint all tokens
balances[msg.sender] = totalSupply;
Transfer(address(0x0), msg.sender, totalSupply);
//adminAddr = owner;
approve(adminAddr, adminAllowance);
}
/**
* Associates this token with a current crowdsale, giving the crowdsale
* an allowance of tokens from the crowdsale supply. This gives the
* crowdsale the ability to call transferFrom to transfer tokens to
* whomever has purchased them.
*
* Note that if _amountForSale is 0, then it is assumed that the full
* remaining crowdsale supply is made available to the crowdsale.
*
* @param _crowdSaleAddr The address of a crowdsale contract that will sell this token
* @param _amountForSale The supply of tokens provided to the crowdsale
*/
function setCrowdsale(address _crowdSaleAddr, uint256 _amountForSale) external onlyOwner {
require(!transferEnabled);
require(_amountForSale <= crowdSaleAllowance);
// if 0, then full available crowdsale supply is assumed
uint amount = (_amountForSale == 0) ? crowdSaleAllowance : _amountForSale;
// Clear allowance of old, and set allowance of new
approve(crowdSaleAddr, 0);
approve(_crowdSaleAddr, amount);
crowdSaleAddr = _crowdSaleAddr;
}
/**
* Enables the ability of anyone to transfer their tokens. This can
* only be called by the token owner. Once enabled, it is not
* possible to disable transfers.
*/
function enableTransfer() external onlyOwner {
transferEnabled = true;
approve(crowdSaleAddr, 0);
approve(adminAddr, 0);
crowdSaleAllowance = 0;
adminAllowance = 0;
}
/**
* Overrides ERC20 transfer function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transfer(address _to, uint256 _value) public onlyWhenTransferEnabled validDestination(_to) returns (bool) {
return super.transfer(_to, _value);
}
/**
* Overrides ERC20 transferFrom function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyWhenTransferEnabled validDestination(_to) returns (bool) {
bool result = super.transferFrom(_from, _to, _value);
if (result) {
if (msg.sender == crowdSaleAddr)
crowdSaleAllowance = crowdSaleAllowance.sub(_value);
if (msg.sender == adminAddr)
adminAllowance = adminAllowance.sub(_value);
}
return result;
}
/**
* Overrides the burn function so that it cannot be called until after
* transfers have been enabled.
*
* @param _value The amount of tokens to burn in ZUZ
*/
function burn(uint256 _value) public {
require(transferEnabled || msg.sender == owner);
require(balances[msg.sender] >= _value);
super.burn(_value);
Transfer(msg.sender, address(0x0), _value);
}
}
|
0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c657806318160ddd1461022057806322ed63021461024957806323b872dd1461028b5780632ff2e9dc14610304578063313ce5671461032d57806342966c681461035c5780634cd412d51461037f5780635c9d0fb1146103ac57806366188463146103d557806370a082311461042f578063818305931461047c5780638da5cb5b146104d15780638eeb33ff1461052657806395d89b411461057b578063a9059cbb14610609578063d14ac7c414610663578063d56de6ed1461068c578063d73dd623146106b5578063dd62ed3e1461070f578063f1b50c1d1461077b578063fc53f95814610790575b600080fd5b341561014357600080fd5b61014b6107b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b610206600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107f2565b604051808215151515815260200191505060405180910390f35b341561022b57600080fd5b6102336108e4565b6040518082815260200191505060405180910390f35b341561025457600080fd5b610289600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ea565b005b341561029657600080fd5b6102ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a08565b604051808215151515815260200191505060405180910390f35b341561030f57600080fd5b610317610d69565b6040518082815260200191505060405180910390f35b341561033857600080fd5b610340610d7a565b604051808260ff1660ff16815260200191505060405180910390f35b341561036757600080fd5b61037d6004808035906020019091905050610d7f565b005b341561038a57600080fd5b610392610eb2565b604051808215151515815260200191505060405180910390f35b34156103b757600080fd5b6103bf610ec5565b6040518082815260200191505060405180910390f35b34156103e057600080fd5b610415600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ed6565b604051808215151515815260200191505060405180910390f35b341561043a57600080fd5b610466600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611167565b6040518082815260200191505060405180910390f35b341561048757600080fd5b61048f6111b0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104dc57600080fd5b6104e46111d6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053157600080fd5b6105396111fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058657600080fd5b61058e611222565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ce5780820151818401526020810190506105b3565b50505050905090810190601f1680156105fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061457600080fd5b610649600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061125b565b604051808215151515815260200191505060405180910390f35b341561066e57600080fd5b6106766114ca565b6040518082815260200191505060405180910390f35b341561069757600080fd5b61069f6114d0565b6040518082815260200191505060405180910390f35b34156106c057600080fd5b6106f5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114d6565b604051808215151515815260200191505060405180910390f35b341561071a57600080fd5b610765600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116d2565b6040518082815260200191505060405180910390f35b341561078657600080fd5b61078e611759565b005b341561079b57600080fd5b6107a361183e565b6040518082815260200191505060405180910390f35b6040805190810160405280601081526020017f436f616c69636861696e20546f6b656e0000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094857600080fd5b600760149054906101000a900460ff1615151561096457600080fd5b600454821115151561097557600080fd5b600082146109835781610987565b6004545b90506109b6600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006107f2565b506109c183826107f2565b5082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600080600760149054906101000a900460ff161515610ad657600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610aca5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610ad557600080fd5b5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b1357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b4e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610bab57600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c0857600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c6557600080fd5b610c7086868661184f565b91508115610d5d57600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610cea57610ce384600454611b3b90919063ffffffff16565b6004819055505b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d5c57610d5584600554611b3b90919063ffffffff16565b6005819055505b5b81925050509392505050565b600660ff16600a0a632de544800281565b600681565b600760149054906101000a900460ff1680610de75750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610df257600080fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e4057600080fd5b610e4981611b54565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600760149054906101000a900460ff1681565b600660ff16600a0a631b898f800281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fe7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061107b565b610ffa8382611b3b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f5a555a000000000000000000000000000000000000000000000000000000000081525081565b6000600760149054906101000a900460ff16151561132857600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061131c5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561132757600080fd5b5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561136557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113a057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113fd57600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561145a57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114b757600080fd5b6114c18484611c69565b91505092915050565b60045481565b60055481565b600061156782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117b557600080fd5b6001600760146101000a81548160ff0219169083151502179055506117fd600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006107f2565b5061182b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006107f2565b5060006004819055506000600581905550565b600660ff16600a0a63125bb5000281565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561188e57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061195f83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3b90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119f483600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a4a8382611b3b90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000828211151515611b4957fe5b818303905092915050565b60008082111515611b6457600080fd5b339050611bb982600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3b90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1182600054611b3b90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ca657600080fd5b611cf882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d8d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611e5357fe5b80915050929150505600a165627a7a72305820a16f0c6a7fc6ee355ff7566d9c14da9008e3174d7a476e49ac6e3ca6a5470aa70029
|
{"success": true, "error": null, "results": {}}
| 2,371 |
0x5a48866c0faa3947838bd945e85d550d94530ee7
|
pragma solidity ^0.5.16;
/**
Get profit every month with a contract Shareholder VOMER!
*
* - OBTAINING 20%, 15% or 10% PER 1 MONTH. (percentages are charged in equal parts every 1 sec)
* - lifetime payments
* - unprecedentedly reliable
* - bring luck
* - first minimum contribution from 2 eth, all next from 0.01 eth
* - Currency and Payment - ETH
* - Contribution allocation schemes:
* - 100% of payments - 5% percent for support and 25% percent for partner
*
* VOMER.net
*
* RECOMMENDED GAS LIMIT: 200,000
* RECOMMENDED GAS PRICE: https://ethgasstation.info/
* DO NOT TRANSFER DIRECTLY FROM AN EXCHANGE (only use your ETH wallet, from which you have a private key)
* You can check payments on the website etherscan.io, in the “Internal Txns” tab of your wallet.
*
* Partner 25%.
* Developers 5%
* Restart of the contract is also absent. If there is no money in the Fund, payments are stopped and resumed after the Fund is filled. Thus, the contract will work forever!
*
* How to use:
* 1. Send from your ETH wallet to the address of the smart contract
* 2. Confirm your transaction in the history of your application or etherscan.io, indicating the address of your wallet.
* Take profit by sending any amount of eth to contract (profit is calculated every second).
*
**/
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
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 use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
contract ERC20Token
{
mapping (address => uint256) public balanceOf;
function transfer(address _to, uint256 _value) public;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
}
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);
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);
uint256 c = a - b;
return c;
}
uint256 constant WAD = 10 ** 18;
function wdiv(uint x, uint y) internal pure returns (uint256 z) {
z = add(mul(x, WAD), y / 2) / y;
}
function wmul(uint x, uint y) internal pure returns (uint256 z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Ownable {
address payable public owner = msg.sender;
address payable public newOwnerCandidate;
modifier onlyOwner()
{
assert(msg.sender == owner);
_;
}
function changeOwnerCandidate(address payable newOwner) public onlyOwner {
newOwnerCandidate = newOwner;
}
function acceptOwner() public {
require(msg.sender == newOwnerCandidate);
owner = newOwnerCandidate;
}
}
contract ShareholderVomer is Initializable
{
using SafeMath for *;
address payable public owner;
address payable public newOwnerCandidate;
address payable public support1;
address payable public support2;
struct InvestorData {
uint128 fundsVMR;
uint128 totalProfit;
uint128 pendingReward;
uint64 lastDatetime;
uint8 percent;
}
uint256 public totalUsers;
mapping (address => InvestorData) investors;
uint256 public rateIn;
uint256 public rateOut;
mapping(address => address) public refList;
modifier onlyOwner()
{
assert(msg.sender == owner);
_;
}
function initialize() initializer public {
address payable _owner = 0xBF165e10878628768939f0415d7df2A9d52f0aB0;
owner = _owner;
support1 = _owner;
support2 = _owner;
rateIn = 10**18;
rateOut = 10**18;
}
function setSupport1(address payable _newAddress) public onlyOwner {
require(_newAddress != address(0));
support1 = _newAddress;
}
function setSupport2(address payable _newAddress) public onlyOwner {
require(_newAddress != address(0));
support2 = _newAddress;
}
function setRateIn_Wei(uint256 _newValue) public onlyOwner {
require(_newValue > 0);
rateIn = _newValue;
}
function setRateOut_Wei(uint256 _newValue) public onlyOwner {
require(_newValue > 0);
rateOut = _newValue;
}
function withdraw(uint256 amount) public onlyOwner {
owner.transfer(amount);
}
function changeOwnerCandidate(address payable newOwner) public onlyOwner {
newOwnerCandidate = newOwner;
}
function acceptOwner() public {
require(msg.sender == newOwnerCandidate);
owner = newOwnerCandidate;
}
// function for transfer any token from contract
function transferTokens (address token, address target, uint256 amount) onlyOwner public
{
ERC20Token(token).transfer(target, amount);
}
function safeEthTransfer(address target, uint256 amount) internal {
address payable payableTarget = address(uint160(target));
(bool ok, ) = payableTarget.call.value(amount)("");
require(ok);
}
function bytesToAddress(bytes memory bys) private pure returns (address payable addr) {
assembly {
addr := mload(add(bys,20))
}
}
function getPartner() internal returns (address partner) {
partner = refList[msg.sender];
if (partner == address(0))
{
if (msg.data.length == 20) {
partner = bytesToAddress(msg.data);
require(partner != msg.sender, "You can't ref yourself");
refList[msg.sender] = partner;
} else {
require(false, "Ref required");
}
}
}
function getInfo(address investor) view public returns (uint256 contractBalance, uint128 depositVMR, uint128 lastDatetime, uint128 totalProfit, uint128 percent, uint256 _totalUsers, uint256 pendingRewardVMR, uint256 pendingRewardETH)
{
contractBalance = address(this).balance;
InvestorData memory data = investors[investor];
depositVMR = data.fundsVMR;
lastDatetime = data.lastDatetime;
totalProfit = data.totalProfit;
percent = data.percent;
_totalUsers = totalUsers;
pendingRewardVMR = depositVMR.mul(data.percent).div(100).mul(block.timestamp - data.lastDatetime).div(30 days);
pendingRewardVMR = uint128(data.pendingReward.add(pendingRewardVMR));
pendingRewardETH = uint128(pendingRewardVMR.wmul(rateOut));
}
function () payable external
{
require(msg.sender == tx.origin); // prevent bots to interact with contract
if (msg.sender == owner) return;
InvestorData storage data = investors[msg.sender];
uint128 _lastDatetime = data.lastDatetime;
uint128 _fundsVMR = data.fundsVMR;
uint256 _rateIn = rateIn;
if (msg.value > 0)
{
safeEthTransfer(getPartner(), msg.value.mul(20).div(100)); // 20% to ref
support1.transfer(msg.value.mul(5).div(100)); // 5%
support2.transfer(msg.value.mul(5).div(100)); // 5%
}
if (_fundsVMR != 0) {
// N% per 30 days
uint256 rewardVMR = _fundsVMR.mul(data.percent).div(100).mul(block.timestamp - _lastDatetime).div(30 days);
uint128 _pendingReward = data.pendingReward;
if (_fundsVMR < 1 ether) {
data.pendingReward = uint128(_pendingReward.add(rewardVMR));
} else {
rewardVMR = rewardVMR.add(_pendingReward);
data.totalProfit = uint128(data.totalProfit.add(uint128(rewardVMR)));
uint256 rewardETH = rewardVMR.wmul(rateOut);
if (_pendingReward > 0) data.pendingReward = 0;
if (rewardETH > 0) safeEthTransfer(msg.sender, rewardETH);
}
}
if (_lastDatetime == 0 && _fundsVMR == 0) { // new user !
uint256 _totalUsers = totalUsers;
if (_totalUsers <= 1000) {
data.percent = 20;
_fundsVMR = uint128((0.3 ether).wmul(_rateIn)); // bonus
} else if (_totalUsers <= 10000) {
data.percent = 15;
_fundsVMR = uint128((0.2 ether).wmul(_rateIn)); // bonus
} else {
data.percent = 10;
_fundsVMR = uint128((0.1 ether).wmul(_rateIn)); // bonus
}
totalUsers = _totalUsers + 1;
}
data.lastDatetime = uint64(block.timestamp);
data.fundsVMR = uint128(_fundsVMR.add(msg.value.mul(70).div(100).wmul(_rateIn)));
}
}
|
0x6080604052600436106101095760003560e01c80638da5cb5b11610095578063bff1f9e111610064578063bff1f9e114610717578063d091b5501461072c578063ebbc496514610741578063f670750814610756578063ffdd5cf11461076b57610109565b80638da5cb5b1461065957806399d3b03c1461066e578063a64b6e5f146106a1578063b63e6b17146106e457610109565b8063561a01b8116100dc578063561a01b8146105ab57806365294e1c146105de5780636dcbc6e414610605578063775604521461062f5780638129fc1c1461064457610109565b806308b7efcb146104f35780632e1a7d4d1461052457806330924c061461054e5780634ac96e9414610578575b33321461011557600080fd5b6033546001600160a01b031633141561012d576104f1565b33600090815260386020526040902060018101548154603954600160801b90920467ffffffffffffffff16916001600160801b0390911690341561023a5761019d6101766107f1565b610198606461018c34601463ffffffff61091d16565b9063ffffffff61094d16565b61096f565b6035546001600160a01b03166108fc6101c2606461018c34600563ffffffff61091d16565b6040518115909202916000818181858888f193505050501580156101ea573d6000803e3d6000fd5b506036546001600160a01b03166108fc610210606461018c34600563ffffffff61091d16565b6040518115909202916000818181858888f19350505050158015610238573d6000803e3d6000fd5b505b6001600160801b038216156103b25760006102a262278d0061018c866001600160801b03164203610296606461018c8b60010160189054906101000a900460ff1660ff168a6001600160801b031661091d90919063ffffffff16565b9063ffffffff61091d16565b60018601549091506001600160801b0390811690670de0b6b3a76400009085161015610308576102e16001600160801b0382168363ffffffff6109d516565b6001870180546001600160801b0319166001600160801b03929092169190911790556103af565b610321826001600160801b03831663ffffffff6109d516565b865490925061034a90600160801b90046001600160801b0390811690841663ffffffff6109d516565b86546001600160801b03918216600160801b029116178655603a5460009061037990849063ffffffff6109e716565b90506001600160801b0382161561039d576001870180546001600160801b03191690555b80156103ad576103ad338261096f565b505b50505b6001600160801b0383161580156103d057506001600160801b038216155b15610470576037546103e8811161040f5760018501805460ff60c01b1916600560c21b179055610408670429d069189e0000836109e7565b9250610469565b612710811161043f5760018501805460ff60c01b1916600f60c01b1790556104086702c68af0bb140000836109e7565b60018501805460ff60c01b1916600560c11b17905561046667016345785d8a0000836109e7565b92505b6001016037555b60018401805467ffffffffffffffff60801b1916600160801b4267ffffffffffffffff16021790556104d16104bb826104af606461018c34604661091d565b9063ffffffff6109e716565b6001600160801b0384169063ffffffff6109d516565b84546001600160801b0319166001600160801b0391909116179093555050505b005b3480156104ff57600080fd5b50610508610a1c565b604080516001600160a01b039092168252519081900360200190f35b34801561053057600080fd5b506104f16004803603602081101561054757600080fd5b5035610a2b565b34801561055a57600080fd5b506104f16004803603602081101561057157600080fd5b5035610a7d565b34801561058457600080fd5b506104f16004803603602081101561059b57600080fd5b50356001600160a01b0316610aa3565b3480156105b757600080fd5b506104f1600480360360208110156105ce57600080fd5b50356001600160a01b0316610aec565b3480156105ea57600080fd5b506105f3610b22565b60408051918252519081900360200190f35b34801561061157600080fd5b506104f16004803603602081101561062857600080fd5b5035610b28565b34801561063b57600080fd5b506105f3610b4e565b34801561065057600080fd5b506104f1610b54565b34801561066557600080fd5b50610508610c47565b34801561067a57600080fd5b506105086004803603602081101561069157600080fd5b50356001600160a01b0316610c56565b3480156106ad57600080fd5b506104f1600480360360608110156106c457600080fd5b506001600160a01b03813581169160208101359091169060400135610c71565b3480156106f057600080fd5b506104f16004803603602081101561070757600080fd5b50356001600160a01b0316610d02565b34801561072357600080fd5b506105f3610d4b565b34801561073857600080fd5b50610508610d51565b34801561074d57600080fd5b506104f1610d60565b34801561076257600080fd5b50610508610d9b565b34801561077757600080fd5b5061079e6004803603602081101561078e57600080fd5b50356001600160a01b0316610daa565b604080519889526001600160801b0397881660208a015295871688870152938616606088015291909416608086015260a085019390935260c084019290925260e083019190915251908190036101000190f35b336000908152603b60205260409020546001600160a01b03168061091a5760143614156108de576108586000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ebb92505050565b90506001600160a01b0381163314156108b1576040805162461bcd60e51b81526020600482015260166024820152752cb7ba9031b0b713ba103932b3103cb7bab939b2b63360511b604482015290519081900360640190fd5b336000908152603b6020526040902080546001600160a01b0319166001600160a01b03831617905561091a565b6040805162461bcd60e51b815260206004820152600c60248201526b149959881c995c5d5a5c995960a21b604482015290519081900360640190fd5b90565b60008261092c57506000610947565b8282028284828161093957fe5b041461094457600080fd5b90505b92915050565b600080821161095b57600080fd5b600082848161096657fe5b04949350505050565b60405182906000906001600160a01b0383169084908381818185875af1925050503d80600081146109bc576040519150601f19603f3d011682016040523d82523d6000602084013e6109c1565b606091505b50509050806109cf57600080fd5b50505050565b60008282018381101561094457600080fd5b6000670de0b6b3a7640000610a0d6109ff858561091d565b6706f05b59d3b200006109d5565b81610a1457fe5b049392505050565b6036546001600160a01b031681565b6033546001600160a01b03163314610a3f57fe5b6033546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a79573d6000803e3d6000fd5b5050565b6033546001600160a01b03163314610a9157fe5b60008111610a9e57600080fd5b603955565b6033546001600160a01b03163314610ab757fe5b6001600160a01b038116610aca57600080fd5b603580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314610b0057fe5b603480546001600160a01b0319166001600160a01b0392909216919091179055565b60395481565b6033546001600160a01b03163314610b3c57fe5b60008111610b4957600080fd5b603a55565b603a5481565b600054610100900460ff1680610b6d5750610b6d610ec2565b80610b7b575060005460ff16155b610bb65760405162461bcd60e51b815260040180806020018281038252602e815260200180610ef7602e913960400191505060405180910390fd5b600054610100900460ff16158015610be1576000805460ff1961ff0019909116610100171660011790555b6033805473bf165e10878628768939f0415d7df2a9d52f0ab06001600160a01b0319918216811790925560358054821683179055603680549091169091179055670de0b6b3a76400006039819055603a558015610c44576000805461ff00191690555b50565b6033546001600160a01b031681565b603b602052600090815260409020546001600160a01b031681565b6033546001600160a01b03163314610c8557fe5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610ce557600080fd5b505af1158015610cf9573d6000803e3d6000fd5b50505050505050565b6033546001600160a01b03163314610d1657fe5b6001600160a01b038116610d2957600080fd5b603680546001600160a01b0319166001600160a01b0392909216919091179055565b60375481565b6034546001600160a01b031681565b6034546001600160a01b03163314610d7757600080fd5b603454603380546001600160a01b0319166001600160a01b03909216919091179055565b6035546001600160a01b031681565b476000808080808080610dbb610ec8565b506001600160a01b038916600090815260386020908152604091829020825160a08101845281546001600160801b03808216808452600160801b92839004821695840186905260019094015490811695830195909552840467ffffffffffffffff1660608201819052600160c01b90940460ff1660808201819052603754929b50939950919750919550909350610e6362278d0061018c428a90036102966064838e8c61091d565b6040820151909350610e84906001600160801b03168463ffffffff6109d516565b6001600160801b03169250610ea4603a54846109e790919063ffffffff16565b6001600160801b0316915050919395975091939597565b6014015190565b303b1590565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a265627a7a72315820614664937db99cba90b5907e84ee4fe5736bbc8d3c8b445370d95f432c2a3c0a64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 2,372 |
0x2d984c14b8802aeca13b58a55d6ee33847ef5bf6
|
/*
/DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/
DFITraining is a blockchain distribution network that facilitates
communication between university students and their professors and
academic partners without intermediaries.
Support the developing ambitious project now!
/DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/ /DFIT/
Website: https://dfitraining.com/
Twitter: https://twitter.com/DFlTraining
Telegram: https://t.me/DFITraining
Reddit: https://www.reddit.com/user/DFITraining
Medium: https://medium.com/@dfitraining
*/
pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
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) {
//require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing");
_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) {
//require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing");
_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(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing");
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
//require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing");
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
//require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing");
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 DFITraining is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
uint256 public tokenSalePrice = 0.0001 ether;
bool public _tokenSaleMode = true;
address public governance;
mapping (address => bool) public minters;
constructor () public ERC20Detailed("DFITraining.com", "DFIT", 18) {
governance = msg.sender;
minters[msg.sender] = true;
}
function mint(address account, uint256 amount) public {
require(minters[msg.sender], "!minter");
_mint(account, amount);
}
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function addMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = true;
}
function removeMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = false;
}
function buyToken() public payable {
require(_tokenSaleMode, "token sale is over");
uint256 newTokens = SafeMath.mul(SafeMath.div(msg.value, tokenSalePrice),1e18);
_mint(msg.sender, newTokens);
}
function() external payable {
buyToken();
}
function endTokenSale() public {
require(msg.sender == governance, "!governance");
_tokenSaleMode = false;
}
function withdraw() external {
require(msg.sender == governance, "!governance");
msg.sender.transfer(address(this).balance);
}
}
|
0x6080604052600436106101405760003560e01c80635aa6e675116100b6578063a9059cbb1161006f578063a9059cbb14610494578063ab033ea9146104cd578063dd62ed3e14610500578063e55bfd161461053b578063e86790eb14610550578063f46eccc41461056557610140565b80635aa6e675146103af57806370a08231146103e057806395d89b4114610413578063983b2d5614610428578063a457c2d71461045b578063a48217191461014057610140565b80633092afd5116101085780633092afd5146102a0578063313ce567146102d357806339509351146102fe5780633ccfd60b1461033757806340c10f191461034c57806342966c681461038557610140565b806306fdde031461014a578063095ea7b3146101d457806318160ddd1461022157806323b872dd14610248578063307edff81461028b575b610148610598565b005b34801561015657600080fd5b5061015f610612565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b5061020d600480360360408110156101f757600080fd5b506001600160a01b0381351690602001356106a8565b604080519115158252519081900360200190f35b34801561022d57600080fd5b506102366106c6565b60408051918252519081900360200190f35b34801561025457600080fd5b5061020d6004803603606081101561026b57600080fd5b506001600160a01b038135811691602081013590911690604001356106cc565b34801561029757600080fd5b50610148610759565b3480156102ac57600080fd5b50610148600480360360208110156102c357600080fd5b50356001600160a01b03166107b7565b3480156102df57600080fd5b506102e861082a565b6040805160ff9092168252519081900360200190f35b34801561030a57600080fd5b5061020d6004803603604081101561032157600080fd5b506001600160a01b038135169060200135610833565b34801561034357600080fd5b50610148610887565b34801561035857600080fd5b506101486004803603604081101561036f57600080fd5b506001600160a01b038135169060200135610905565b34801561039157600080fd5b50610148600480360360208110156103a857600080fd5b5035610961565b3480156103bb57600080fd5b506103c461096b565b604080516001600160a01b039092168252519081900360200190f35b3480156103ec57600080fd5b506102366004803603602081101561040357600080fd5b50356001600160a01b031661097f565b34801561041f57600080fd5b5061015f61099a565b34801561043457600080fd5b506101486004803603602081101561044b57600080fd5b50356001600160a01b03166109fb565b34801561046757600080fd5b5061020d6004803603604081101561047e57600080fd5b506001600160a01b038135169060200135610a71565b3480156104a057600080fd5b5061020d600480360360408110156104b757600080fd5b506001600160a01b038135169060200135610adf565b3480156104d957600080fd5b50610148600480360360208110156104f057600080fd5b50356001600160a01b0316610af3565b34801561050c57600080fd5b506102366004803603604081101561052357600080fd5b506001600160a01b0381358116916020013516610b6d565b34801561054757600080fd5b5061020d610b98565b34801561055c57600080fd5b50610236610ba1565b34801561057157600080fd5b5061020d6004803603602081101561058857600080fd5b50356001600160a01b0316610ba7565b60075460ff166105e4576040805162461bcd60e51b81526020600482015260126024820152713a37b5b2b71039b0b6329034b99037bb32b960711b604482015290519081900360640190fd5b60006106036105f534600654610bbc565b670de0b6b3a7640000610c05565b905061060f3382610c5e565b50565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b820191906000526020600020905b81548152906001019060200180831161068157829003601f168201915b5050505050905090565b60006106bc6106b5610d4e565b8484610d52565b5060015b92915050565b60025490565b60006106d9848484610e3e565b61074f846106e5610d4e565b61074a856040518060600160405280602881526020016112dd602891396001600160a01b038a16600090815260016020526040812090610723610d4e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610f9a16565b610d52565b5060019392505050565b60075461010090046001600160a01b031633146107ab576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6007805460ff19169055565b60075461010090046001600160a01b03163314610809576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b60055460ff1690565b60006106bc610840610d4e565b8461074a8560016000610851610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61103116565b60075461010090046001600160a01b031633146108d9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f1935050505015801561060f573d6000803e3d6000fd5b3360009081526008602052604090205460ff16610953576040805162461bcd60e51b815260206004820152600760248201526610b6b4b73a32b960c91b604482015290519081900360640190fd5b61095d8282610c5e565b5050565b61060f338261108b565b60075461010090046001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b60075461010090046001600160a01b03163314610a4d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b60006106bc610a7e610d4e565b8461074a8560405180606001604052806025815260200161136f6025913960016000610aa8610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610f9a16565b60006106bc610aec610d4e565b8484610e3e565b60075461010090046001600160a01b03163314610b45576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60075460ff1681565b60065481565b60086020526000908152604090205460ff1681565b6000610bfe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611187565b9392505050565b600082610c14575060006106c0565b82820282848281610c2157fe5b0414610bfe5760405162461bcd60e51b81526004018080602001828103825260218152602001806112bc6021913960400191505060405180910390fd5b6001600160a01b038216610cb9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254610ccc908263ffffffff61103116565b6002556001600160a01b038216600090815260208190526040902054610cf8908263ffffffff61103116565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b038316610d975760405162461bcd60e51b815260040180806020018281038252602481526020018061134b6024913960400191505060405180910390fd5b6001600160a01b038216610ddc5760405162461bcd60e51b81526004018080602001828103825260228152602001806112746022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610e835760405162461bcd60e51b81526004018080602001828103825260258152602001806113266025913960400191505060405180910390fd5b6001600160a01b038216610ec85760405162461bcd60e51b815260040180806020018281038252602381526020018061122f6023913960400191505060405180910390fd5b610f0b81604051806060016040528060268152602001611296602691396001600160a01b038616600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610f40908263ffffffff61103116565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fee578181015183820152602001610fd6565b50505050905090810190601f16801561101b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166110d05760405162461bcd60e51b81526004018080602001828103825260218152602001806113056021913960400191505060405180910390fd5b61111381604051806060016040528060228152602001611252602291396001600160a01b038516600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b03831660009081526020819052604090205560025461113f908263ffffffff6111ec16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600081836111d65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610fee578181015183820152602001610fd6565b5060008385816111e257fe5b0495945050505050565b6000610bfe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158205e33f24e515f45e938a63047ab1203533af86e70856dfcd88a758c2148fbf7c464736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,373 |
0x1c88e35684aae2aa20209fba8b03c5a8b905ec8e
|
/**
*Submitted for verification at Etherscan.io on 2021-04-06
*/
// File: contracts/Utils/SafeMath.sol
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
/**
* @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;
}
}
// File: contracts/Gov/GovCoordinator.sol
contract GovCoordinator {
using SafeMath for uint256;
/// @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 The name of this contract
string public constant name = "Governance Coordinator";
/// @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
uint256 public quorumVotes;
/// @notice The number of votes required in order for a voter to become a proposer
uint256 public proposalThreshold;
/// @notice The duration of voting on a proposal, in blocks
uint256 public votingPeriod;
/// @notice The address of the Voice token
IVoiceContract public voice;
/// @notice The total number of proposals
uint256 public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint256 id;
/// @notice Creator of the proposal
address proposer;
/// @notice The target to execute the proposal data
address target;
/// @notice The ordered list of calldata to be passed to each call
bytes data;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint256 startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint256 endBlock;
/// @notice Current number of votes in favor of this proposal
uint256 forVotes;
/// @notice Current number of votes in opposition to this proposal
uint256 againstVotes;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Defeated,
Succeeded,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint256 => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint256 id, address proposer, address target, bytes data, uint256 startBlock, uint256 endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint256 proposalId, bool support, uint256 votes);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint256 id);
event ChangeQuorumVotes(uint256 _quorumVotes);
event ChangeProposalThreshold(uint256 _proposalThreshold);
event ChangeVotingPeriod(uint256 _votingPeriod);
constructor(address _voice, uint256 _votingPeriod) public {
quorumVotes = 4000e18; // (~10% of circ)
proposalThreshold = 500e18; // 500 voice
votingPeriod = _votingPeriod; //17280; // ~3 days in blocks (assuming 15s blocks)
voice = IVoiceContract(_voice);
}
// should only be called by itself through a proposal
function changeQuorumVotes(uint256 _quorumVotes) public {
require(msg.sender == address(this), "GovCoordinator::changeQuorumVotes: caller is not this contract");
quorumVotes = _quorumVotes;
emit ChangeQuorumVotes(_quorumVotes);
}
// should only be called by itself through a proposal
function changeProposalThreshold(uint256 _proposalThreshold) public {
require(msg.sender == address(this), "GovCoordinator::changeProposalThreshold: caller is not this contract");
proposalThreshold = _proposalThreshold;
emit ChangeProposalThreshold(_proposalThreshold);
}
// should only be called by itself through a proposal
function changeVotingPeriod(uint256 _votingPeriod) public {
require(msg.sender == address(this), "GovCoordinator::changeVotingPeriod: caller is not this contract");
votingPeriod = _votingPeriod;
emit ChangeVotingPeriod(_votingPeriod);
}
function propose(address target, bytes memory data, string memory description) public returns (uint) {
require(voice.getPriorVotes(msg.sender, block.number.sub(1)) > proposalThreshold, "GovCoordinator::propose: proposer votes below proposal threshold");
uint256 latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovCoordinator::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovCoordinator::propose: one live proposal per proposer, found an already pending proposal");
}
uint256 startBlock = block.number.add(1);
uint256 endBlock = startBlock.add(votingPeriod);
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
target: target,
data: data,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, target, data, startBlock, endBlock, description);
return newProposal.id;
}
function execute(uint256 proposalId) public payable {
require(state(proposalId) == ProposalState.Succeeded, "GovCoordinator::execute: proposal can only be succeeded to execute");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
(bool result, ) = address(proposal.target).call(proposal.data);
require(result, "GovCoordinator::execute: transaction Failed");
// return any eth in this contract
if(address(this).balance > 0){
address payable _sender = msg.sender;
_sender.transfer(address(this).balance);
}
emit ProposalExecuted(proposalId);
}
function getAction(uint256 proposalId) public view returns (bytes memory data) {
Proposal storage p = proposals[proposalId];
return p.data;
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint256 proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovCoordinator::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
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.add(proposal.againstVotes) < quorumVotes) {
return ProposalState.Defeated;
} else if (!proposal.executed) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else {
return ProposalState.Expired;
}
}
function castVote(uint256 proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint256 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), "GovCoordinator::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint256 proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovCoordinator::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(!receipt.hasVoted, "GovCoordinator::_castVote: voter already voted");
uint96 votes = voice.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = proposal.forVotes.add(votes);
} else {
proposal.againstVotes = proposal.againstVotes.add(votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface IVoiceContract {
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96);
}
|
0x60806040526004361061011f5760003560e01c80635832cf59116100a0578063da35c66411610064578063da35c66414610403578063deaaa7cc1461042e578063e23a9a5214610459578063f9dabc5514610496578063fe0d94c1146104bf5761011f565b80635832cf591461031e5780638b02d31714610347578063a8f0a82e14610372578063b58131b01461039b578063b6e76873146103c65761011f565b806320606b70116100e757806320606b701461022557806324bc1a64146102505780633153fedb1461027b5780633e4f49e6146102b85780634634c61f146102f55761011f565b8063013cf08b1461012457806302a251a31461016957806306fdde031461019457806315373e3d146101bf57806317977c61146101e8575b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190611b41565b6104db565b604051610160999897969594939291906128ee565b60405180910390f35b34801561017557600080fd5b5061017e61060e565b60405161018b9190612856565b60405180910390f35b3480156101a057600080fd5b506101a9610614565b6040516101b69190612679565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190611ba6565b61064d565b005b3480156101f457600080fd5b5061020f600480360381019061020a9190611a99565b61065c565b60405161021c9190612856565b60405180910390f35b34801561023157600080fd5b5061023a610674565b6040516102479190612545565b60405180910390f35b34801561025c57600080fd5b50610265610698565b6040516102729190612856565b60405180910390f35b34801561028757600080fd5b506102a2600480360381019061029d9190611ac2565b61069e565b6040516102af9190612856565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190611b41565b610b3e565b6040516102ec919061265e565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190611be2565b610c5f565b005b34801561032a57600080fd5b5061034560048036038101906103409190611b41565b610e48565b005b34801561035357600080fd5b5061035c610ef7565b6040516103699190612643565b60405180910390f35b34801561037e57600080fd5b5061039960048036038101906103949190611b41565b610f1d565b005b3480156103a757600080fd5b506103b0610fcc565b6040516103bd9190612856565b60405180910390f35b3480156103d257600080fd5b506103ed60048036038101906103e89190611b41565b610fd2565b6040516103fa9190612621565b60405180910390f35b34801561040f57600080fd5b50610418611090565b6040516104259190612856565b60405180910390f35b34801561043a57600080fd5b50610443611096565b6040516104509190612545565b60405180910390f35b34801561046557600080fd5b50610480600480360381019061047b9190611b6a565b6110ba565b60405161048d919061283b565b60405180910390f35b3480156104a257600080fd5b506104bd60048036038101906104b89190611b41565b61119c565b005b6104d960048036038101906104d49190611b41565b61124b565b005b60056020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105d95780601f106105ae576101008083540402835291602001916105d9565b820191906000526020600020905b8154815290600101906020018083116105bc57829003601f168201915b5050505050908060040154908060050154908060060154908060070154908060080160009054906101000a900460ff16905089565b60025481565b6040518060400160405280601681526020017f476f7665726e616e636520436f6f7264696e61746f720000000000000000000081525081565b610658338383611447565b5050565b60066020528060005260406000206000915090505481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60005481565b6000600154600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe1336106f660014361172290919063ffffffff16565b6040518363ffffffff1660e01b81526004016107139291906124ae565b60206040518083038186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190611c59565b6bffffffffffffffffffffffff16116107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a8906126fb565b60405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081146108c057600061080882610b3e565b90506001600581111561081757fe5b81600581111561082357fe5b1415610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085b906126bb565b60405180910390fd5b6000600581111561087157fe5b81600581111561087d57fe5b14156108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b5906127bb565b60405180910390fd5b505b60006108d660014361176c90919063ffffffff16565b905060006108ef6002548361176c90919063ffffffff16565b905060046000815480929190600101919050555061090b611829565b60405180610120016040528060045481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff16815260200188815260200184815260200183815260200160008152602001600081526020016000151581525090508060056000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816003019080519060200190610a4c9291906118a3565b506080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550905050806000015160066000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fe1a17f4770769f9d77ef56dd3b92500df161f3a1704ab99aec8ccf8653cae4008160000151338a8a87878c604051610b249796959493929190612871565b60405180910390a180600001519450505050509392505050565b60008160045410158015610b525750600082115b610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b889061277b565b60405180910390fd5b600060056000848152602001908152602001600020905080600401544311610bbd576000915050610c5a565b80600501544311610bd2576001915050610c5a565b80600701548160060154111580610c045750600054610c028260070154836006015461176c90919063ffffffff16565b105b15610c13576002915050610c5a565b8060080160009054906101000a900460ff16610c33576003915050610c5a565b8060080160009054906101000a900460ff1615610c54576005915050610c5a565b60049150505b919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280601681526020017f476f7665726e616e636520436f6f7264696e61746f720000000000000000000081525080519060200120610cc76117c1565b30604051602001610cdb9493929190612560565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610d2a939291906125a5565b60405160208183030381529060405280519060200120905060008282604051602001610d57929190612477565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610d9494939291906125dc565b6020604051602081039080840390855afa158015610db6573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e299061279b565b60405180910390fd5b610e3d818a8a611447565b505050505050505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ead9061269b565b60405180910390fd5b806002819055507fac382f0cb061b7b31634d0b5629b2c615bbc79d07fe96d9ffa0621b9dc98cfa581604051610eec9190612856565b60405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f829061273b565b60405180910390fd5b806000819055507fd8e293d4069683b7c33e549e8ff8d7a0c764ae5b786174418ed8d9fe91d3dc9781604051610fc19190612856565b60405180910390a150565b60015481565b60606000600560008481526020019081526020016000209050806003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110835780601f1061105857610100808354040283529160200191611083565b820191906000526020600020905b81548152906001019060200180831161106657829003601f168201915b5050505050915050919050565b60045481565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b6110c2611923565b6005600084815260200190815260200160002060090160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112019061275b565b60405180910390fd5b806001819055507f46970f525825f5ca45f347b696f196bfb5ec5dd9db93fc04ade865268fa12052816040516112409190612856565b60405180910390a150565b6003600581111561125857fe5b61126182610b3e565b600581111561126c57fe5b146112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a39061281b565b60405180910390fd5b600060056000838152602001908152602001600020905060018160080160006101000a81548160ff02191690831515021790555060008160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260030160405161132e9190612460565b6000604051808303816000865af19150503d806000811461136b576040519150601f19603f3d011682016040523d82523d6000602084013e611370565b606091505b50509050806113b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ab906127db565b60405180910390fd5b600047111561140b5760003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611408573d6000803e3d6000fd5b50505b7f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8360405161143a9190612856565b60405180910390a1505050565b6001600581111561145457fe5b61145d83610b3e565b600581111561146857fe5b146114a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149f9061271b565b60405180910390fd5b600060056000848152602001908152602001600020905060008160090160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000160009054906101000a900460ff1615611556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154d906127fb565b60405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18785600401546040518363ffffffff1660e01b81526004016115b99291906124d7565b60206040518083038186803b1580156115d157600080fd5b505afa1580156115e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116099190611c59565b9050831561164357611636816bffffffffffffffffffffffff16846006015461176c90919063ffffffff16565b8360060181905550611671565b611668816bffffffffffffffffffffffff16846007015461176c90919063ffffffff16565b83600701819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c46868686846040516117129493929190612500565b60405180910390a1505050505050565b600061176483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117ce565b905092915050565b6000808284019050838110156117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ae906126db565b60405180910390fd5b8091505092915050565b6000804690508091505090565b6000838311158290611816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180d9190612679565b60405180910390fd5b5060008385039050809150509392505050565b60405180610120016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118e457805160ff1916838001178555611912565b82800160010185558215611912579182015b828111156119115782518255916020019190600101906118f6565b5b50905061191f9190611956565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b5b8082111561196f576000816000905550600101611957565b5090565b60008135905061198281612bdc565b92915050565b60008135905061199781612bf3565b92915050565b6000813590506119ac81612c0a565b92915050565b600082601f8301126119c357600080fd5b81356119d66119d1826129af565b612982565b915080825260208301602083018583830111156119f257600080fd5b6119fd838284612b72565b50505092915050565b600082601f830112611a1757600080fd5b8135611a2a611a25826129db565b612982565b91508082526020830160208301858383011115611a4657600080fd5b611a51838284612b72565b50505092915050565b600081359050611a6981612c21565b92915050565b600081359050611a7e81612c38565b92915050565b600081519050611a9381612c4f565b92915050565b600060208284031215611aab57600080fd5b6000611ab984828501611973565b91505092915050565b600080600060608486031215611ad757600080fd5b6000611ae586828701611973565b935050602084013567ffffffffffffffff811115611b0257600080fd5b611b0e868287016119b2565b925050604084013567ffffffffffffffff811115611b2b57600080fd5b611b3786828701611a06565b9150509250925092565b600060208284031215611b5357600080fd5b6000611b6184828501611a5a565b91505092915050565b60008060408385031215611b7d57600080fd5b6000611b8b85828601611a5a565b9250506020611b9c85828601611973565b9150509250929050565b60008060408385031215611bb957600080fd5b6000611bc785828601611a5a565b9250506020611bd885828601611988565b9150509250929050565b600080600080600060a08688031215611bfa57600080fd5b6000611c0888828901611a5a565b9550506020611c1988828901611988565b9450506040611c2a88828901611a6f565b9350506060611c3b8882890161199d565b9250506080611c4c8882890161199d565b9150509295509295909350565b600060208284031215611c6b57600080fd5b6000611c7984828501611a84565b91505092915050565b611c8b81612af4565b82525050565b611c9a81612a6a565b82525050565b611ca981612a7c565b82525050565b611cb881612a7c565b82525050565b611cc781612a88565b82525050565b611cde611cd982612a88565b612bb4565b82525050565b6000611cef82612a1c565b611cf98185612a32565b9350611d09818560208601612b81565b611d1281612bbe565b840191505092915050565b600081546001811660008114611d3a5760018114611d5f57611da3565b607f6002830416611d4b8187612a43565b955060ff1983168652808601935050611da3565b60028204611d6d8187612a43565b9550611d7885612a07565b60005b82811015611d9a57815481890152600182019150602081019050611d7b565b82880195505050505b505092915050565b611db481612b06565b82525050565b611dc381612b2a565b82525050565b6000611dd482612a27565b611dde8185612a4e565b9350611dee818560208601612b81565b611df781612bbe565b840191505092915050565b6000611e0f603f83612a4e565b91507f476f76436f6f7264696e61746f723a3a6368616e6765566f74696e675065726960008301527f6f643a2063616c6c6572206973206e6f74207468697320636f6e7472616374006020830152604082019050919050565b6000611e75605983612a4e565b91507f476f76436f6f7264696e61746f723a3a70726f706f73653a206f6e65206c697660008301527f652070726f706f73616c207065722070726f706f7365722c20666f756e64206160208301527f6e20616c7265616479206163746976652070726f706f73616c000000000000006040830152606082019050919050565b6000611f01600283612a5f565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000611f41601b83612a4e565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000611f81604083612a4e565b91507f476f76436f6f7264696e61746f723a3a70726f706f73653a2070726f706f736560008301527f7220766f7465732062656c6f772070726f706f73616c207468726573686f6c646020830152604082019050919050565b6000611fe7602b83612a4e565b91507f476f76436f6f7264696e61746f723a3a5f63617374566f74653a20766f74696e60008301527f6720697320636c6f7365640000000000000000000000000000000000000000006020830152604082019050919050565b600061204d603e83612a4e565b91507f476f76436f6f7264696e61746f723a3a6368616e676551756f72756d566f746560008301527f733a2063616c6c6572206973206e6f74207468697320636f6e747261637400006020830152604082019050919050565b60006120b3604483612a4e565b91507f476f76436f6f7264696e61746f723a3a6368616e676550726f706f73616c546860008301527f726573686f6c643a2063616c6c6572206973206e6f74207468697320636f6e7460208301527f72616374000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b600061213f602a83612a4e565b91507f476f76436f6f7264696e61746f723a3a73746174653a20696e76616c6964207060008301527f726f706f73616c206964000000000000000000000000000000000000000000006020830152604082019050919050565b60006121a5603083612a4e565b91507f476f76436f6f7264696e61746f723a3a63617374566f746542795369673a206960008301527f6e76616c6964207369676e6174757265000000000000000000000000000000006020830152604082019050919050565b600061220b605a83612a4e565b91507f476f76436f6f7264696e61746f723a3a70726f706f73653a206f6e65206c697660008301527f652070726f706f73616c207065722070726f706f7365722c20666f756e64206160208301527f6e20616c72656164792070656e64696e672070726f706f73616c0000000000006040830152606082019050919050565b6000612297602b83612a4e565b91507f476f76436f6f7264696e61746f723a3a657865637574653a207472616e73616360008301527f74696f6e204661696c65640000000000000000000000000000000000000000006020830152604082019050919050565b60006122fd602e83612a4e565b91507f476f76436f6f7264696e61746f723a3a5f63617374566f74653a20766f74657260008301527f20616c726561647920766f7465640000000000000000000000000000000000006020830152604082019050919050565b6000612363604283612a4e565b91507f476f76436f6f7264696e61746f723a3a657865637574653a2070726f706f736160008301527f6c2063616e206f6e6c792062652073756363656564656420746f20657865637560208301527f74650000000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6060820160008201516123f86000850182611ca0565b50602082015161240b6020850182611ca0565b50604082015161241e6040850182612451565b50505050565b61242d81612ac5565b82525050565b61243c81612acf565b82525050565b61244b81612b60565b82525050565b61245a81612adc565b82525050565b600061246c8284611d1d565b915081905092915050565b600061248282611ef4565b915061248e8285611ccd565b60208201915061249e8284611ccd565b6020820191508190509392505050565b60006040820190506124c36000830185611c82565b6124d06020830184612424565b9392505050565b60006040820190506124ec6000830185611c91565b6124f96020830184612424565b9392505050565b60006080820190506125156000830187611c91565b6125226020830186612424565b61252f6040830185611caf565b61253c6060830184612442565b95945050505050565b600060208201905061255a6000830184611cbe565b92915050565b60006080820190506125756000830187611cbe565b6125826020830186611cbe565b61258f6040830185612424565b61259c6060830184611c91565b95945050505050565b60006060820190506125ba6000830186611cbe565b6125c76020830185612424565b6125d46040830184611caf565b949350505050565b60006080820190506125f16000830187611cbe565b6125fe6020830186612433565b61260b6040830185611cbe565b6126186060830184611cbe565b95945050505050565b6000602082019050818103600083015261263b8184611ce4565b905092915050565b60006020820190506126586000830184611dab565b92915050565b60006020820190506126736000830184611dba565b92915050565b600060208201905081810360008301526126938184611dc9565b905092915050565b600060208201905081810360008301526126b481611e02565b9050919050565b600060208201905081810360008301526126d481611e68565b9050919050565b600060208201905081810360008301526126f481611f34565b9050919050565b6000602082019050818103600083015261271481611f74565b9050919050565b6000602082019050818103600083015261273481611fda565b9050919050565b6000602082019050818103600083015261275481612040565b9050919050565b60006020820190508181036000830152612774816120a6565b9050919050565b6000602082019050818103600083015261279481612132565b9050919050565b600060208201905081810360008301526127b481612198565b9050919050565b600060208201905081810360008301526127d4816121fe565b9050919050565b600060208201905081810360008301526127f48161228a565b9050919050565b60006020820190508181036000830152612814816122f0565b9050919050565b6000602082019050818103600083015261283481612356565b9050919050565b600060608201905061285060008301846123e2565b92915050565b600060208201905061286b6000830184612424565b92915050565b600060e082019050612886600083018a612424565b6128936020830189611c82565b6128a06040830188611c91565b81810360608301526128b28187611ce4565b90506128c16080830186612424565b6128ce60a0830185612424565b81810360c08301526128e08184611dc9565b905098975050505050505050565b600061012082019050612904600083018c612424565b612911602083018b611c91565b61291e604083018a611c91565b81810360608301526129308189611ce4565b905061293f6080830188612424565b61294c60a0830187612424565b61295960c0830186612424565b61296660e0830185612424565b612974610100830184611caf565b9a9950505050505050505050565b6000604051905081810181811067ffffffffffffffff821117156129a557600080fd5b8060405250919050565b600067ffffffffffffffff8211156129c657600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff8211156129f257600080fd5b601f19601f8301169050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000612a7582612aa5565b9050919050565b60008115159050919050565b6000819050919050565b6000819050612aa082612bcf565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612aff82612b3c565b9050919050565b6000612b1182612b18565b9050919050565b6000612b2382612aa5565b9050919050565b6000612b3582612a92565b9050919050565b6000612b4782612b4e565b9050919050565b6000612b5982612aa5565b9050919050565b6000612b6b82612adc565b9050919050565b82818337600083830152505050565b60005b83811015612b9f578082015181840152602081019050612b84565b83811115612bae576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b60068110612bd957fe5b50565b612be581612a6a565b8114612bf057600080fd5b50565b612bfc81612a7c565b8114612c0757600080fd5b50565b612c1381612a88565b8114612c1e57600080fd5b50565b612c2a81612ac5565b8114612c3557600080fd5b50565b612c4181612acf565b8114612c4c57600080fd5b50565b612c5881612adc565b8114612c6357600080fd5b5056fea264697066735822122066176f83d90413175c752510d7edaa3abd6e6060d731f2943b09502dbeb5cc9d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 2,374 |
0xa8346b6253e17faac3139f79d533cd3cfc272952
|
// SPDX-License-Identifier: MIT License
pragma solidity ^0.5.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) public view returns (uint256 balance);
function ownerOf(uint256 tokenId) public view returns (address owner);
function approve(address to, uint256 tokenId) public;
function getApproved(uint256 tokenId) public view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public;
function isApprovedForAll(address owner, address operator) public view returns (bool);
function transferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
contract IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
}
contract ERC165 is IERC165 {
bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7;
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
_registerInterface(_InterfaceId_ERC165);
}
function supportsInterface(bytes4 interfaceId) external view returns (bool) {
return _supportedInterfaces[interfaceId];
}
function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff);
_supportedInterfaces[interfaceId] = true;
}
}
contract ERC721 is ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to number of owned token
mapping (address => uint256) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
bytes4 private constant _InterfaceId_ERC721 = 0x80ac58cd;
constructor () public {
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_InterfaceId_ERC721);
}
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0));
return _ownedTokensCount[owner];
}
function ownerOf(uint256 tokenId) public view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0));
return owner;
}
function approve(address to, uint256 tokenId) public {
address owner = ownerOf(tokenId);
require(to != owner);
require(msg.sender == owner || isApprovedForAll(owner, msg.sender));
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId));
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address to, bool approved) public {
require(to != msg.sender);
_operatorApprovals[msg.sender][to] = approved;
emit ApprovalForAll(msg.sender, to, approved);
}
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId) public {
require(_isApprovedOrOwner(msg.sender, tokenId));
require(to != address(0));
_clearApproval(from, tokenId);
_removeTokenFrom(from, tokenId);
_addTokenTo(to, tokenId);
emit Transfer(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public {
// solium-disable-next-line arg-overflow
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
transferFrom(from, to, tokenId);
// solium-disable-next-line arg-overflow
require(_checkOnERC721Received(from, to, tokenId, _data));
}
function _exists(uint256 tokenId) internal view returns (bool) {
address owner = _tokenOwner[tokenId];
return owner != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _mint(address to, uint256 tokenId) internal {
require(to != address(0));
_addTokenTo(to, tokenId);
emit Transfer(address(0), to, tokenId);
}
function _burn(address owner, uint256 tokenId) internal {
_clearApproval(owner, tokenId);
_removeTokenFrom(owner, tokenId);
emit Transfer(owner, address(0), tokenId);
}
function _addTokenTo(address to, uint256 tokenId) internal {
require(_tokenOwner[tokenId] == address(0));
_tokenOwner[tokenId] = to;
_ownedTokensCount[to] = _ownedTokensCount[to].add(1);
}
function _removeTokenFrom(address from, uint256 tokenId) internal {
require(ownerOf(tokenId) == from);
_ownedTokensCount[from] = _ownedTokensCount[from].sub(1);
_tokenOwner[tokenId] = address(0);
}
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) {
if (!to.isContract()) {
return true;
}
bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data);
return (retval == _ERC721_RECEIVED);
}
function _clearApproval(address owner, uint256 tokenId) private {
require(ownerOf(tokenId) == owner);
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
contract IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f;
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(InterfaceId_ERC721Metadata);
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory ) {
return _symbol;
}
function tokenURI(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId));
return _tokenURIs[tokenId];
}
function _setTokenURI(uint256 tokenId, string memory uri) internal {
require(_exists(tokenId));
_tokenURIs[tokenId] = uri;
}
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
}
contract IERC721Enumerable is IERC721 {
function totalSupply() public view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);
function tokenByIndex(uint256 index) public view returns (uint256);
}
contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => uint256[]) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
bytes4 private constant _InterfaceId_ERC721Enumerable = 0x780e9d63;
constructor () public {
// register the supported interface to conform to ERC721 via ERC165
_registerInterface(_InterfaceId_ERC721Enumerable);
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(index < balanceOf(owner));
return _ownedTokens[owner][index];
}
function totalSupply() public view returns (uint256) {
return _allTokens.length;
}
function tokenByIndex(uint256 index) public view returns (uint256) {
require(index < totalSupply());
return _allTokens[index];
}
function _addTokenTo(address to, uint256 tokenId) internal {
super._addTokenTo(to, tokenId);
uint256 length = _ownedTokens[to].length;
_ownedTokens[to].push(tokenId);
_ownedTokensIndex[tokenId] = length;
}
function _removeTokenFrom(address from, uint256 tokenId) internal {
super._removeTokenFrom(from, tokenId);
uint256 tokenIndex = _ownedTokensIndex[tokenId];
uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
uint256 lastToken = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastToken;
// This also deletes the contents at the last position of the array
_ownedTokens[from].length--;
_ownedTokensIndex[tokenId] = 0;
_ownedTokensIndex[lastToken] = tokenIndex;
}
function _mint(address to, uint256 tokenId) internal {
super._mint(to, tokenId);
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
// Reorg all tokens array
uint256 tokenIndex = _allTokensIndex[tokenId];
uint256 lastTokenIndex = _allTokens.length.sub(1);
uint256 lastToken = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastToken;
_allTokens[lastTokenIndex] = 0;
_allTokens.length--;
_allTokensIndex[tokenId] = 0;
_allTokensIndex[lastToken] = tokenIndex;
}
}
contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
constructor (string memory name, string memory symbol) ERC721Metadata(name, symbol) public {}
}
library Strings {
// via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory) {
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
bytes memory _bc = bytes(_c);
bytes memory _bd = bytes(_d);
bytes memory _be = bytes(_e);
string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
bytes memory babcde = bytes(abcde);
uint k = 0;
for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
for (uint i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
for (uint i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
for (uint i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
for (uint i = 0; i < _be.length; i++) babcde[k++] = _be[i];
return string(babcde);
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory) {
return strConcat(_a, _b, _c, _d, "");
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory) {
return strConcat(_a, _b, _c, "", "");
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory) {
return strConcat(_a, _b, "", "", "");
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
if (_i == 0) {
return "0";
}
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len - 1;
while (_i != 0) {
bstr[k--] = byte(uint8(48 + _i % 10));
_i /= 10;
}
return string(bstr);
}
}
contract OwnableDelegateProxy { }
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner());
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract TradeableERC721Token is ERC721Full, Ownable {
using Strings for string;
address proxyRegistryAddress;
uint256 private _currentTokenId = 0;
constructor(string memory _name, string memory _symbol, address _proxyRegistryAddress) ERC721Full(_name, _symbol) public {
proxyRegistryAddress = _proxyRegistryAddress;
}
function mintTo(address _to, uint256 _numOfTokens) public onlyOwner {
for (uint256 i = 0; i < _numOfTokens; i++) {
uint256 newTokenId = _getNextTokenId();
_mint(_to, newTokenId);
_incrementTokenId();
}
}
function _getNextTokenId() private view returns (uint256) {
return _currentTokenId.add(1);
}
function _incrementTokenId() private {
_currentTokenId++;
}
function baseTokenURI() public view returns (string memory) {
return "https://market.k-base.art/api/";
}
function tokenURI(uint256 _tokenId) external view returns (string memory) {
return Strings.strConcat(
baseTokenURI(),
Strings.uint2str(_tokenId)
);
}
function isApprovedForAll(
address owner,
address operator
)
public
view
returns (bool)
{
// Whitelist OpenSea proxy contract for easy trading.
ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
if (address(proxyRegistry.proxies(owner)) == operator) {
return true;
}
return super.isApprovedForAll(owner, operator);
}
}
contract KB is TradeableERC721Token {
constructor(address _proxyRegistryAddress) TradeableERC721Token("K Base", "KB", _proxyRegistryAddress) public { }
function baseTokenURI() public view returns (string memory) {
return "#";
}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a22cb4651161007c578063a22cb46514610696578063b88d4fde146106e6578063c87b56dd146107eb578063d547cfb714610892578063e985e9c514610915578063f2fde38b1461099157610142565b806370a0823114610545578063715018a61461059d5780638da5cb5b146105a75780638f32d59b146105f157806395d89b411461061357610142565b806323b872dd1161010a57806323b872dd146103095780632f745c591461037757806342842e0e146103d9578063449a52f8146104475780634f6ccce7146104955780636352211e146104d757610142565b806301ffc9a71461014757806306fdde03146101ac578063081812fc1461022f578063095ea7b31461029d57806318160ddd146102eb575b600080fd5b6101926004803603602081101561015d57600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690602001909291905050506109d5565b604051808215151515815260200191505060405180910390f35b6101b4610a3c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f45780820151818401526020810190506101d9565b50505050905090810190601f1680156102215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61025b6004803603602081101561024557600080fd5b8101908080359060200190929190505050610ade565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102e9600480360360408110156102b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b2d565b005b6102f3610c6e565b6040518082815260200191505060405180910390f35b6103756004803603606081101561031f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7b565b005b6103c36004803603604081101561038d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d46565b6040518082815260200191505060405180910390f35b610445600480360360608110156103ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b005b6104936004803603604081101561045d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd9565b005b6104c1600480360360208110156104ab57600080fd5b8101908080359060200190929190505050610e29565b6040518082815260200191505060405180910390f35b610503600480360360208110156104ed57600080fd5b8101908080359060200190929190505050610e5d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105876004803603602081101561055b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed9565b6040518082815260200191505060405180910390f35b6105a5610f5b565b005b6105af61102d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105f9611057565b604051808215151515815260200191505060405180910390f35b61061b6110af565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065b578082015181840152602081019050610640565b50505050905090810190601f1680156106885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106e4600480360360408110156106ac57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611151565b005b6107e9600480360360808110156106fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561076357600080fd5b82018360208201111561077557600080fd5b8035906020019184600183028401116401000000008311171561079757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061128b565b005b6108176004803603602081101561080157600080fd5b81019080803590602001909291905050506112b1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561085757808201518184015260208101905061083c565b50505050905090810190601f1680156108845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61089a6112d3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108da5780820151818401526020810190506108bf565b50505050905090810190601f1680156109075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109776004803603604081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611310565b604051808215151515815260200191505060405180910390f35b6109d3600480360360208110156109a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611441565b005b6000806000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad45780601f10610aa957610100808354040283529160200191610ad4565b820191906000526020600020905b815481529060010190602001808311610ab757829003601f168201915b5050505050905090565b6000610ae98261145e565b610af257600080fd5b6002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610b3882610e5d565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b7357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bb35750610bb28133611310565b5b610bbc57600080fd5b826002600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b6000600780549050905090565b610c8533826114d0565b610c8e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc857600080fd5b610cd28382611565565b610cdc8382611664565b610ce6828261181d565b808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610d5183610ed9565b8210610d5c57600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610da657fe5b9060005260206000200154905092915050565b610dd48383836040518060200160405280600081525061128b565b505050565b610de1611057565b610dea57600080fd5b60008090505b81811015610e24576000610e026118f4565b9050610e0e8482611911565b610e16611968565b508080600101915050610df0565b505050565b6000610e33610c6e565b8210610e3e57600080fd5b60078281548110610e4b57fe5b90600052602060002001549050919050565b6000806001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ed057600080fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f1457600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f63611057565b610f6c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6060600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111475780601f1061111c57610100808354040283529160200191611147565b820191906000526020600020905b81548152906001019060200180831161112a57829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561118a57600080fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051808215151515815260200191505060405180910390a35050565b611296848484610c7b565b6112a28484848461197c565b6112ab57600080fd5b50505050565b60606112cc6112be6112d3565b6112c784611b65565b611c92565b9050919050565b60606040518060400160405280600181526020017f2300000000000000000000000000000000000000000000000000000000000000815250905090565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663c4552791866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156113cc57600080fd5b505afa1580156113e0573d6000803e3d6000fd5b505050506040513d60208110156113f657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141561142d57600191505061143b565b6114378484611cd6565b9150505b92915050565b611449611057565b61145257600080fd5b61145b81611d6a565b50565b6000806001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415915050919050565b6000806114dc83610e5d565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061154b57508373ffffffffffffffffffffffffffffffffffffffff1661153384610ade565b73ffffffffffffffffffffffffffffffffffffffff16145b8061155c575061155b8185611310565b5b91505092915050565b8173ffffffffffffffffffffffffffffffffffffffff1661158582610e5d565b73ffffffffffffffffffffffffffffffffffffffff16146115a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116605760006002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5050565b61166e8282611e64565b60006006600083815260200190815260200160002054905060006116de6001600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050611f9190919063ffffffff16565b90506000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061172c57fe5b9060005260206000200154905080600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061178457fe5b9060005260206000200181905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054809190600190036117e491906124a5565b50600060066000868152602001908152602001600020819055508260066000838152602001908152602001600020819055505050505050565b6118278282611fb1565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050906001820390600052602060002001600090919290919091505550806006600084815260200190815260200160002081905550505050565b600061190c6001600e5461210990919063ffffffff16565b905090565b61191b8282612128565b600780549050600860008381526020019081526020016000208190555060078190806001815401808255809150509060018203906000526020600020016000909192909190915055505050565b600e60008154809291906001019190505550565b600061199d8473ffffffffffffffffffffffffffffffffffffffff166121cc565b6119aa5760019050611b5d565b60008473ffffffffffffffffffffffffffffffffffffffff1663150b7a02338887876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a85578082015181840152602081019050611a6a565b50505050905090810190601f168015611ab25780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015611ad457600080fd5b505af1158015611ae8573d6000803e3d6000fd5b505050506040513d6020811015611afe57600080fd5b8101908080519060200190929190505050905063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150505b949350505050565b60606000821415611bad576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611c8d565b600082905060005b60008214611bd7578080600101915050600a8281611bcf57fe5b049150611bb5565b6060816040519080825280601f01601f191660200182016040528015611c0c5781602001600182028038833980820191505090505b50905060006001830390505b60008614611c8557600a8681611c2a57fe5b0660300160f81b82828060019003935081518110611c4457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8681611c7d57fe5b049550611c18565b819450505050505b919050565b6060611cce83836040518060200160405280600081525060405180602001604052806000815250604051806020016040528060008152506121df565b905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611da457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b8173ffffffffffffffffffffffffffffffffffffffff16611e8482610e5d565b73ffffffffffffffffffffffffffffffffffffffff1614611ea457600080fd5b611ef76001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9190919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600082821115611fa057600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461201d57600080fd5b816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506120c26001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461210990919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840190508381101561211e57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561216257600080fd5b61216c828261181d565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b6060808690506060869050606086905060608690506060869050606081518351855187518951010101016040519080825280601f01601f19166020018201604052801561223b5781602001600182028038833980820191505090505b5090506060819050600080905060008090505b88518110156122bc5788818151811061226357fe5b602001015160f81c60f81b83838060010194508151811061228057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808060010191505061224e565b5060008090505b8751811015612331578781815181106122d857fe5b602001015160f81c60f81b8383806001019450815181106122f557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506122c3565b5060008090505b86518110156123a65786818151811061234d57fe5b602001015160f81c60f81b83838060010194508151811061236a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612338565b5060008090505b855181101561241b578581815181106123c257fe5b602001015160f81c60f81b8383806001019450815181106123df57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506123ad565b5060008090505b84518110156124905784818151811061243757fe5b602001015160f81c60f81b83838060010194508151811061245457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612422565b50819850505050505050505095945050505050565b8154818355818111156124cc578183600052602060002091820191016124cb91906124d1565b5b505050565b6124f391905b808211156124ef5760008160009055506001016124d7565b5090565b9056fea265627a7a7231582011de34e3b37b1bf1687e04e26ad2bc892cd47f9778d8ced7ad42a33852c0360564736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 2,375 |
0x37003169d9b5f4639d94570f0cf37c77c00349c8
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
**/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
**/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
**/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
**/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
**/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
**/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
**/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
**/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
**/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
**/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 1000000*10**18;
uint256 public constant basePrice = 100*10**18; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 1000000*10**18;
uint256 public remainingTokens = 0;
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
}
/**
* @title HUDDcoinProjectToken
* @dev Contract to create the HUDDcoinProject Token
**/
contract HUDDcoinProjectToken is CrowdsaleToken {
string public constant name = "HUDDcoinProjectToken";
string public constant symbol = "HCPt";
uint32 public constant decimals = 18;
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104c1578063095ea7b31461055157806318160ddd146105b657806323b872dd146105e1578063313ce56714610666578063355274ea1461069d578063518ab2a8146106c857806366188463146106f357806370a082311461075857806389311e6f146107af5780638da5cb5b146107c6578063903a3ef61461081d57806395d89b4114610834578063a9059cbb146108c4578063bf58390314610929578063c7876ea414610954578063cbcb31711461097f578063d73dd623146109aa578063dd62ed3e14610a0f578063f2fde38b14610a86575b60008060008060006001600281111561012757fe5b600560149054906101000a900460ff16600281111561014257fe5b14151561014e57600080fd5b60003411151561015d57600080fd5b600060045411151561016e57600080fd5b3494506101a7670de0b6b3a764000061019968056bc75e2d6310000088610ac990919063ffffffff16565b610b0190919063ffffffff16565b93506000925069d3c21bcecceda10000006101cd85600354610b1790919063ffffffff16565b1115610248576101f260035469d3c21bcecceda1000000610b3390919063ffffffff16565b915061022a670de0b6b3a764000061021c68056bc75e2d6310000085610b0190919063ffffffff16565b610ac990919063ffffffff16565b905061023f8186610b3390919063ffffffff16565b92508094508193505b61025d84600354610b1790919063ffffffff16565b60038190555061028260035469d3c21bcecceda1000000610b3390919063ffffffff16565b600481905550600083111561033e573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156102d7573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b61038f846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361044b84600154610b1790919063ffffffff16565b600181905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f193505050501580156104b9573d6000803e3d6000fd5b505050505050005b3480156104cd57600080fd5b506104d6610b4c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105165780820151818401526020810190506104fb565b50505050905090810190601f1680156105435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055d57600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b85565b604051808215151515815260200191505060405180910390f35b3480156105c257600080fd5b506105cb610c77565b6040518082815260200191505060405180910390f35b3480156105ed57600080fd5b5061064c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c81565b604051808215151515815260200191505060405180910390f35b34801561067257600080fd5b5061067b61103b565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156106a957600080fd5b506106b2611040565b6040518082815260200191505060405180910390f35b3480156106d457600080fd5b506106dd61104e565b6040518082815260200191505060405180910390f35b3480156106ff57600080fd5b5061073e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611054565b604051808215151515815260200191505060405180910390f35b34801561076457600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e5565b6040518082815260200191505060405180910390f35b3480156107bb57600080fd5b506107c461132d565b005b3480156107d257600080fd5b506107db6113e3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561082957600080fd5b50610832611409565b005b34801561084057600080fd5b506108496114a3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561088957808201518184015260208101905061086e565b50505050905090810190601f1680156108b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d057600080fd5b5061090f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114dc565b604051808215151515815260200191505060405180910390f35b34801561093557600080fd5b5061093e6116fb565b6040518082815260200191505060405180910390f35b34801561096057600080fd5b50610969611701565b6040518082815260200191505060405180910390f35b34801561098b57600080fd5b5061099461170e565b6040518082815260200191505060405180910390f35b3480156109b657600080fd5b506109f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061171c565b604051808215151515815260200191505060405180910390f35b348015610a1b57600080fd5b50610a70600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611918565b6040518082815260200191505060405180910390f35b348015610a9257600080fd5b50610ac7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061199f565b005b600080831415610adc5760009050610afb565b8183029050818382811515610aed57fe5b04141515610af757fe5b8090505b92915050565b60008183811515610b0e57fe5b04905092915050565b60008183019050828110151515610b2a57fe5b80905092915050565b6000828211151515610b4157fe5b818303905092915050565b6040805190810160405280601481526020017f48554444636f696e50726f6a656374546f6b656e00000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cbe57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d0b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9657600080fd5b610de7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f4b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b69d3c21bcecceda100000081565b60035481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611165576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9565b6111788382610b3390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138957600080fd5b60028081111561139557fe5b600560149054906101000a900460ff1660028111156113b057fe5b141515156113bd57600080fd5b6001600560146101000a81548160ff021916908360028111156113dc57fe5b0217905550565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146557600080fd5b60028081111561147157fe5b600560149054906101000a900460ff16600281111561148c57fe5b1415151561149957600080fd5b6114a1611af7565b565b6040805190810160405280600481526020017f484350740000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561151957600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561156657600080fd5b6115b7826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061164a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b68056bc75e2d6310000081565b69d3c21bcecceda100000081565b60006117ad82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119fb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a3757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002600560146101000a81548160ff02191690836002811115611b1657fe5b021790555060006004541115611c0057611b9b600454600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1790919063ffffffff16565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611c7f573d6000803e3d6000fd5b505600a165627a7a72305820a937f8aa4ebab10b9e39bd8853652b762b1521a6ad84b57f7795f0200a4f55f70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,376 |
0x1748149ea200a9d1db395bf744f5266c97988637
|
/**
*Submitted for verification at Etherscan.io on 2019-07-08
*/
pragma solidity ^0.5.0;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address 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;
}
}
contract BNDESRegistry is Ownable() {
/**
The account of clients and suppliers are assigned to states.
Reserved accounts (e.g. from BNDES and ANCINE) do not have state.
AVAILABLE - The account is not yet assigned any role (any of them - client, supplier or any reserved addresses).
WAITING_VALIDATION - The account was linked to a legal entity but it still needs to be validated
VALIDATED - The account was validated
INVALIDATED_BY_VALIDATOR - The account was invalidated
INVALIDATED_BY_CHANGE - The client or supplier changed the ethereum account so the original one must be invalidated.
*/
enum BlockchainAccountState {AVAILABLE,WAITING_VALIDATION,VALIDATED,INVALIDATED_BY_VALIDATOR,INVALIDATED_BY_CHANGE}
BlockchainAccountState blockchainState; //Not used. Defined to create the enum type.
address responsibleForSettlement;
address responsibleForRegistryValidation;
address responsibleForDisbursement;
address redemptionAddress;
address tokenAddress;
/**
Describes the Legal Entity - clients or suppliers
*/
struct LegalEntityInfo {
uint64 cnpj; //Brazilian identification of legal entity
uint64 idFinancialSupportAgreement; //SCC contract
uint32 salic; //ANCINE identifier
string idProofHash; //hash of declaration
BlockchainAccountState state;
}
/**
Links Ethereum addresses to LegalEntityInfo
*/
mapping(address => LegalEntityInfo) public legalEntitiesInfo;
/**
Links Legal Entity to Ethereum address.
cnpj => (idFinancialSupportAgreement => address)
*/
mapping(uint64 => mapping(uint64 => address)) cnpjFSAddr;
/**
Links Ethereum addresses to the possibility to change the account
Since the Ethereum account can be changed once, it is not necessary to put the bool to false.
TODO: Discuss later what is the best data structure
*/
mapping(address => bool) public legalEntitiesChangeAccount;
event AccountRegistration(address addr, uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic, string idProofHash);
event AccountChange(address oldAddr, address newAddr, uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic, string idProofHash);
event AccountValidation(address addr, uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic);
event AccountInvalidation(address addr, uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic);
/**
* @dev Throws if called by any account other than the token address.
*/
modifier onlyTokenAddress() {
require(isTokenAddress());
_;
}
constructor () public {
responsibleForSettlement = msg.sender;
responsibleForRegistryValidation = msg.sender;
responsibleForDisbursement = msg.sender;
redemptionAddress = msg.sender;
}
/**
* Link blockchain address with CNPJ - It can be a cliente or a supplier
* The link still needs to be validated by BNDES
* This method can only be called by BNDESToken contract because BNDESToken can pause.
* @param cnpj Brazilian identifier to legal entities
* @param idFinancialSupportAgreement contract number of financial contract with BNDES. It assumes 0 if it is a supplier.
* @param salic contract number of financial contract with ANCINE. It assumes 0 if it is a supplier.
* @param addr the address to be associated with the legal entity.
* @param idProofHash The legal entities have to send BNDES a PDF where it assumes as responsible for an Ethereum account.
* This PDF is signed with eCNPJ and send to BNDES.
*/
function registryLegalEntity(uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic,
address addr, string memory idProofHash) onlyTokenAddress public {
// Endereço não pode ter sido cadastrado anteriormente
require (isAvailableAccount(addr), "Endereço não pode ter sido cadastrado anteriormente");
require (isValidHash(idProofHash), "O hash da declaração é inválido");
legalEntitiesInfo[addr] = LegalEntityInfo(cnpj, idFinancialSupportAgreement, salic, idProofHash, BlockchainAccountState.WAITING_VALIDATION);
// Não pode haver outro endereço cadastrado para esse mesmo subcrédito
if (idFinancialSupportAgreement > 0) {
address account = getBlockchainAccount(cnpj,idFinancialSupportAgreement);
require (isAvailableAccount(account), "Cliente já está associado a outro endereço. Use a função Troca.");
}
else {
address account = getBlockchainAccount(cnpj,0);
require (isAvailableAccount(account), "Fornecedor já está associado a outro endereço. Use a função Troca.");
}
cnpjFSAddr[cnpj][idFinancialSupportAgreement] = addr;
emit AccountRegistration(addr, cnpj, idFinancialSupportAgreement, salic, idProofHash);
}
/**
* Changes the original link between CNPJ and Ethereum account.
* The new link still needs to be validated by BNDES.
* This method can only be called by BNDESToken contract because BNDESToken can pause and because there are
* additional instructions there.
* @param cnpj Brazilian identifier to legal entities
* @param idFinancialSupportAgreement contract number of financial contract with BNDES. It assumes 0 if it is a supplier.
* @param salic contract number of financial contract with ANCINE. It assumes 0 if it is a supplier.
* @param newAddr the new address to be associated with the legal entity
* @param idProofHash The legal entities have to send BNDES a PDF where it assumes as responsible for an Ethereum account.
* This PDF is signed with eCNPJ and send to BNDES.
*/
function changeAccountLegalEntity(uint64 cnpj, uint64 idFinancialSupportAgreement, uint32 salic,
address newAddr, string memory idProofHash) onlyTokenAddress public {
address oldAddr = getBlockchainAccount(cnpj, idFinancialSupportAgreement);
// Tem que haver um endereço associado a esse cnpj/subcrédito
require(!isReservedAccount(oldAddr), "Não pode trocar endereço de conta reservada");
require(!isAvailableAccount(oldAddr), "Tem que haver um endereço associado a esse cnpj/subcrédito");
require(isAvailableAccount(newAddr), "Novo endereço não está disponível");
require (isChangeAccountEnabled(oldAddr), "A conta atual não está habilitada para troca");
require (isValidHash(idProofHash), "O hash da declaração é inválido");
require(legalEntitiesInfo[oldAddr].cnpj==cnpj
&& legalEntitiesInfo[oldAddr].idFinancialSupportAgreement ==idFinancialSupportAgreement,
"Dados inconsistentes de cnpj ou subcrédito");
// Aponta o novo endereço para o novo LegalEntityInfo
legalEntitiesInfo[newAddr] = LegalEntityInfo(cnpj, idFinancialSupportAgreement, salic, idProofHash, BlockchainAccountState.WAITING_VALIDATION);
// Apaga o mapping do endereço antigo
legalEntitiesInfo[oldAddr].state = BlockchainAccountState.INVALIDATED_BY_CHANGE;
// Aponta mapping CNPJ e Subcredito para newAddr
cnpjFSAddr[cnpj][idFinancialSupportAgreement] = newAddr;
emit AccountChange(oldAddr, newAddr, cnpj, idFinancialSupportAgreement, salic, idProofHash);
}
/**
* Validates the initial registry of a legal entity or the change of its registry
* @param addr Ethereum address that needs to be validated
* @param idProofHash The legal entities have to send BNDES a PDF where it assumes as responsible for an Ethereum account.
* This PDF is signed with eCNPJ and send to BNDES.
*/
function validateRegistryLegalEntity(address addr, string memory idProofHash) public {
require(isResponsibleForRegistryValidation(msg.sender), "Somente o responsável pela validação pode validar contas");
require(legalEntitiesInfo[addr].state == BlockchainAccountState.WAITING_VALIDATION, "A conta precisa estar no estado Aguardando Validação");
require(keccak256(abi.encodePacked(legalEntitiesInfo[addr].idProofHash)) == keccak256(abi.encodePacked(idProofHash)), "O hash recebido é diferente do esperado");
legalEntitiesInfo[addr].state = BlockchainAccountState.VALIDATED;
emit AccountValidation(addr, legalEntitiesInfo[addr].cnpj,
legalEntitiesInfo[addr].idFinancialSupportAgreement,
legalEntitiesInfo[addr].salic);
}
/**
* Invalidates the initial registry of a legal entity or the change of its registry
* The invalidation can be called at any time in the lifecycle of the address (not only when it is WAITING_VALIDATION)
* @param addr Ethereum address that needs to be validated
*/
function invalidateRegistryLegalEntity(address addr) public {
require(isResponsibleForRegistryValidation(msg.sender), "Somente o responsável pela validação pode invalidar contas");
require(!isReservedAccount(addr), "Não é possível invalidar conta reservada");
legalEntitiesInfo[addr].state = BlockchainAccountState.INVALIDATED_BY_VALIDATOR;
emit AccountInvalidation(addr, legalEntitiesInfo[addr].cnpj,
legalEntitiesInfo[addr].idFinancialSupportAgreement,
legalEntitiesInfo[addr].salic);
}
/**
* By default, the owner is also the Responsible for Settlement.
* The owner can assign other address to be the Responsible for Settlement.
* @param rs Ethereum address to be assigned as Responsible for Settlement.
*/
function setResponsibleForSettlement(address rs) onlyOwner public {
responsibleForSettlement = rs;
}
/**
* By default, the owner is also the Responsible for Validation.
* The owner can assign other address to be the Responsible for Validation.
* @param rs Ethereum address to be assigned as Responsible for Validation.
*/
function setResponsibleForRegistryValidation(address rs) onlyOwner public {
responsibleForRegistryValidation = rs;
}
/**
* By default, the owner is also the Responsible for Disbursment.
* The owner can assign other address to be the Responsible for Disbursment.
* @param rs Ethereum address to be assigned as Responsible for Disbursment.
*/
function setResponsibleForDisbursement(address rs) onlyOwner public {
responsibleForDisbursement = rs;
}
/**
* The supplier reedems the BNDESToken by transfering the tokens to a specific address,
* called Redemption address.
* By default, the redemption address is the address of the owner.
* The owner can change the redemption address using this function.
* @param rs new Redemption address
*/
function setRedemptionAddress(address rs) onlyOwner public {
redemptionAddress = rs;
}
/**
* @param rs Ethereum address to be assigned to the token address.
*/
function setTokenAddress(address rs) onlyOwner public {
tokenAddress = rs;
}
/**
* Enable the legal entity to change the account
* @param rs account that can be changed.
*/
function enableChangeAccount (address rs) public {
require(isResponsibleForRegistryValidation(msg.sender), "Somente o responsável pela validação pode habilitar a troca de conta");
legalEntitiesChangeAccount[rs] = true;
}
function isChangeAccountEnabled (address rs) view public returns (bool) {
return legalEntitiesChangeAccount[rs] == true;
}
function isTokenAddress() public view returns (bool) {
return tokenAddress == msg.sender;
}
function isResponsibleForSettlement(address addr) view public returns (bool) {
return (addr == responsibleForSettlement);
}
function isResponsibleForRegistryValidation(address addr) view public returns (bool) {
return (addr == responsibleForRegistryValidation);
}
function isResponsibleForDisbursement(address addr) view public returns (bool) {
return (addr == responsibleForDisbursement);
}
function isRedemptionAddress(address addr) view public returns (bool) {
return (addr == redemptionAddress);
}
function isReservedAccount(address addr) view public returns (bool) {
if (isOwner(addr) || isResponsibleForSettlement(addr)
|| isResponsibleForRegistryValidation(addr)
|| isResponsibleForDisbursement(addr)
|| isRedemptionAddress(addr) ) {
return true;
}
return false;
}
function isOwner(address addr) view public returns (bool) {
return owner()==addr;
}
function isSupplier(address addr) view public returns (bool) {
if (isReservedAccount(addr))
return false;
if (isAvailableAccount(addr))
return false;
return legalEntitiesInfo[addr].idFinancialSupportAgreement == 0;
}
function isValidatedSupplier (address addr) view public returns (bool) {
return isSupplier(addr) && (legalEntitiesInfo[addr].state == BlockchainAccountState.VALIDATED);
}
function isClient (address addr) view public returns (bool) {
if (isReservedAccount(addr)) {
return false;
}
return legalEntitiesInfo[addr].idFinancialSupportAgreement != 0;
}
function isValidatedClient (address addr) view public returns (bool) {
return isClient(addr) && (legalEntitiesInfo[addr].state == BlockchainAccountState.VALIDATED);
}
function isAvailableAccount(address addr) view public returns (bool) {
if ( isReservedAccount(addr) ) {
return false;
}
return legalEntitiesInfo[addr].state == BlockchainAccountState.AVAILABLE;
}
function isWaitingValidationAccount(address addr) view public returns (bool) {
return legalEntitiesInfo[addr].state == BlockchainAccountState.WAITING_VALIDATION;
}
function isValidatedAccount(address addr) view public returns (bool) {
return legalEntitiesInfo[addr].state == BlockchainAccountState.VALIDATED;
}
function isInvalidatedByValidatorAccount(address addr) view public returns (bool) {
return legalEntitiesInfo[addr].state == BlockchainAccountState.INVALIDATED_BY_VALIDATOR;
}
function isInvalidatedByChangeAccount(address addr) view public returns (bool) {
return legalEntitiesInfo[addr].state == BlockchainAccountState.INVALIDATED_BY_CHANGE;
}
function getResponsibleForSettlement() view public returns (address) {
return responsibleForSettlement;
}
function getResponsibleForRegistryValidation() view public returns (address) {
return responsibleForRegistryValidation;
}
function getResponsibleForDisbursement() view public returns (address) {
return responsibleForDisbursement;
}
function getRedemptionAddress() view public returns (address) {
return redemptionAddress;
}
function getCNPJ(address addr) view public returns (uint64) {
return legalEntitiesInfo[addr].cnpj;
}
function getIdLegalFinancialAgreement(address addr) view public returns (uint64) {
return legalEntitiesInfo[addr].idFinancialSupportAgreement;
}
function getLegalEntityInfo (address addr) view public returns (uint64, uint64, uint32, string memory, uint, address) {
return (legalEntitiesInfo[addr].cnpj, legalEntitiesInfo[addr].idFinancialSupportAgreement,
legalEntitiesInfo[addr].salic, legalEntitiesInfo[addr].idProofHash, (uint) (legalEntitiesInfo[addr].state),
addr);
}
function getBlockchainAccount(uint64 cnpj, uint64 idFinancialSupportAgreement) view public returns (address) {
return cnpjFSAddr[cnpj][idFinancialSupportAgreement];
}
function getLegalEntityInfoByCNPJ (uint64 cnpj, uint64 idFinancialSupportAgreement)
view public returns (uint64, uint64, uint32, string memory, uint, address) {
address addr = getBlockchainAccount(cnpj,idFinancialSupportAgreement);
return getLegalEntityInfo (addr);
}
function getAccountState(address addr) view public returns (int) {
if ( isReservedAccount(addr) ) {
return 100;
}
else {
return ((int) (legalEntitiesInfo[addr].state));
}
}
function isValidHash(string memory str) pure public returns (bool) {
bytes memory b = bytes(str);
if(b.length != 64) return false;
for (uint i=0; i<64; i++) {
if (b[i] < "0") return false;
if (b[i] > "9" && b[i] <"a") return false;
if (b[i] > "f") return false;
}
return true;
}
}
|
0x60806040526004361061021a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630c4471bd1461021f578063184c89311461028857806326a4e8d2146102f157806326ff4794146103425780632f54bf6e1461046a578063348da3f2146104d3578063393338491461053c5780633abba2ef146105d55780633d44e5c61461063e578063434baaf21461068f57806346336542146106f85780634add311014610761578063576590cb146107ca57806357cdcb3e146108335780636426a1161461088a5780636edcb12f146108f3578063715018a6146109d35780637943653d146109ea57806379b8369e14610a535780637aeb787714610aaa578063803b8a4214610bca578063845283de14610cb257806384b7964f14610d1b57806385fecf9b14610d84578063876c6e9b14610ded5780638cbd258f14610e665780638da5cb5b14610eb75780638f32d59b14610f0e57806390e42c7e14610f3d5780639ee2735b14610f8e5780639f5e1ddd14610ff3578063a3d8845314611140578063a530634c146111a9578063b41842b9146112fe578063b7196f371461134f578063b7404ff5146113a6578063b8e7c21d146113f7578063be49b78d14611460578063bed25c0e146114d9578063c01ed21014611508578063cc7e1b9a14611571578063d61da4ff146115c2578063f2fde38b146116e2578063f4ec736714611733575b600080fd5b34801561022b57600080fd5b5061026e6004803603602081101561024257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061178a565b604051808215151515815260200191505060405180910390f35b34801561029457600080fd5b506102d7600480360360208110156102ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117fc565b604051808215151515815260200191505060405180910390f35b3480156102fd57600080fd5b506103406004803603602081101561031457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061185f565b005b34801561034e57600080fd5b506103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118b6565b604051808667ffffffffffffffff1667ffffffffffffffff1681526020018567ffffffffffffffff1667ffffffffffffffff1681526020018463ffffffff1663ffffffff168152602001806020018360048111156103eb57fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b8381101561042b578082015181840152602081019050610410565b50505050905090810190601f1680156104585780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561047657600080fd5b506104b96004803603602081101561048d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c9565b604051808215151515815260200191505060405180910390f35b3480156104df57600080fd5b50610522600480360360208110156104f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a08565b604051808215151515815260200191505060405180910390f35b34801561054857600080fd5b506105936004803603604081101561055f57600080fd5b81019080803567ffffffffffffffff169060200190929190803567ffffffffffffffff169060200190929190505050611a8b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e157600080fd5b50610624600480360360208110156105f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b02565b604051808215151515815260200191505060405180910390f35b34801561064a57600080fd5b5061068d6004803603602081101561066157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b5c565b005b34801561069b57600080fd5b506106de600480360360208110156106b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c80565b604051808215151515815260200191505060405180910390f35b34801561070457600080fd5b506107476004803603602081101561071b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cdd565b604051808215151515815260200191505060405180910390f35b34801561076d57600080fd5b506107b06004803603602081101561078457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d79565b604051808215151515815260200191505060405180910390f35b3480156107d657600080fd5b50610819600480360360208110156107ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dd3565b604051808215151515815260200191505060405180910390f35b34801561083f57600080fd5b50610848611df3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561089657600080fd5b506108d9600480360360208110156108ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e1d565b604051808215151515815260200191505060405180910390f35b3480156108ff57600080fd5b506109b96004803603602081101561091657600080fd5b810190808035906020019064010000000081111561093357600080fd5b82018360208201111561094557600080fd5b8035906020019184600183028401116401000000008311171561096757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611e8f565b604051808215151515815260200191505060405180910390f35b3480156109df57600080fd5b506109e861217f565b005b3480156109f657600080fd5b50610a3960048036036020811015610a0d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612251565b604051808215151515815260200191505060405180910390f35b348015610a5f57600080fd5b50610a686122ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ab657600080fd5b50610bc8600480360360a0811015610acd57600080fd5b81019080803567ffffffffffffffff169060200190929190803567ffffffffffffffff169060200190929190803563ffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610b4257600080fd5b820183602082011115610b5457600080fd5b80359060200191846001830284011164010000000083111715610b7657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506122d5565b005b348015610bd657600080fd5b50610cb060048036036040811015610bed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610c2a57600080fd5b820183602082011115610c3c57600080fd5b80359060200191846001830284011164010000000083111715610c5e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612b45565b005b348015610cbe57600080fd5b50610d0160048036036020811015610cd557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130ca565b604051808215151515815260200191505060405180910390f35b348015610d2757600080fd5b50610d6a60048036036020811015610d3e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061313c565b604051808215151515815260200191505060405180910390f35b348015610d9057600080fd5b50610dd360048036036020811015610da757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131c2565b604051808215151515815260200191505060405180910390f35b348015610df957600080fd5b50610e3c60048036036020811015610e1057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061321c565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b348015610e7257600080fd5b50610eb560048036036020811015610e8957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061327c565b005b348015610ec357600080fd5b50610ecc6132d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f1a57600080fd5b50610f236132fc565b604051808215151515815260200191505060405180910390f35b348015610f4957600080fd5b50610f8c60048036036020811015610f6057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613353565b005b348015610f9a57600080fd5b50610fdd60048036036020811015610fb157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133aa565b6040518082815260200191505060405180910390f35b348015610fff57600080fd5b506110426004803603602081101561101657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613426565b604051808767ffffffffffffffff1667ffffffffffffffff1681526020018667ffffffffffffffff1667ffffffffffffffff1681526020018563ffffffff1663ffffffff168152602001806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818151815260200191508051906020019080838360005b838110156111005780820151818401526020810190506110e5565b50505050905090810190601f16801561112d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561114c57600080fd5b5061118f6004803603602081101561116357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613680565b604051808215151515815260200191505060405180910390f35b3480156111b557600080fd5b50611200600480360360408110156111cc57600080fd5b81019080803567ffffffffffffffff169060200190929190803567ffffffffffffffff16906020019092919050505061370a565b604051808767ffffffffffffffff1667ffffffffffffffff1681526020018667ffffffffffffffff1667ffffffffffffffff1681526020018563ffffffff1663ffffffff168152602001806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818151815260200191508051906020019080838360005b838110156112be5780820151818401526020810190506112a3565b50505050905090810190601f1680156112eb5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561130a57600080fd5b5061134d6004803603602081101561132157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613742565b005b34801561135b57600080fd5b50611364613a9d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156113b257600080fd5b506113f5600480360360208110156113c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ac7565b005b34801561140357600080fd5b506114466004803603602081101561141a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b1e565b604051808215151515815260200191505060405180910390f35b34801561146c57600080fd5b506114af6004803603602081101561148357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b8f565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b3480156114e557600080fd5b506114ee613bef565b604051808215151515815260200191505060405180910390f35b34801561151457600080fd5b506115576004803603602081101561152b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c47565b604051808215151515815260200191505060405180910390f35b34801561157d57600080fd5b506115c06004803603602081101561159457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613cca565b005b3480156115ce57600080fd5b506116e0600480360360a08110156115e557600080fd5b81019080803567ffffffffffffffff169060200190929190803567ffffffffffffffff169060200190929190803563ffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561165a57600080fd5b82018360208201111561166c57600080fd5b8035906020019184600183028401116401000000008311171561168e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050613d21565b005b3480156116ee57600080fd5b506117316004803603602081101561170557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061434d565b005b34801561173f57600080fd5b5061174861436c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006001600481111561179957fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660048111156117f457fe5b149050919050565b6000611807826119c9565b806118175750611816826131c2565b5b80611827575061182682611b02565b5b80611837575061183682611d79565b5b80611847575061184682612251565b5b15611855576001905061185a565b600090505b919050565b6118676132fc565b151561187257600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090508060000160009054906101000a900467ffffffffffffffff16908060000160089054906101000a900467ffffffffffffffff16908060000160109054906101000a900463ffffffff1690806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119ac5780601f10611981576101008083540402835291602001916119ac565b820191906000526020600020905b81548152906001019060200180831161198f57829003601f168201915b5050505050908060020160009054906101000a900460ff16905085565b60008173ffffffffffffffffffffffffffffffffffffffff166119ea6132d3565b73ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000611a1382611cdd565b8015611a84575060026004811115611a2757fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166004811115611a8257fe5b145b9050919050565b6000600760008467ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008367ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b611b6533611b02565b1515611c25576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f536f6d656e7465206f20726573706f6e73c3a176656c2070656c612076616c6981526020017f6461c3a7c3a36f20706f646520686162696c6974617220612074726f6361206481526020017f6520636f6e74610000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515149050919050565b6000611ce8826117fc565b15611cf65760009050611d74565b611cff82613680565b15611d0d5760009050611d74565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff161490505b919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060026004811115611e2c57fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166004811115611e8757fe5b149050919050565b6000606082905060408151141515611eab57600091505061217a565b60008090505b6040811015612173577f30000000000000000000000000000000000000000000000000000000000000008282815181101515611ee957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161015611f675760009250505061217a565b7f39000000000000000000000000000000000000000000000000000000000000008282815181101515611f9657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161180156120a957507f6100000000000000000000000000000000000000000000000000000000000000828281518110151561203a57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916105b156120b95760009250505061217a565b7f660000000000000000000000000000000000000000000000000000000000000082828151811015156120e857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611156121665760009250505061217a565b8080600101915050611eb1565b5060019150505b919050565b6121876132fc565b151561219257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6122dd613bef565b15156122e857600080fd5b60006122f48686611a8b565b90506122ff816117fc565b15151561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4ec3a36f20706f64652074726f63617220656e64657265c3a76f20646520636f81526020017f6e7461207265736572766164610000000000000000000000000000000000000081525060400191505060405180910390fd5b6123a381613680565b15151561243e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c8152602001807f54656d2071756520686176657220756d20656e64657265c3a76f206173736f6381526020017f6961646f2061206573736520636e706a2f7375626372c3a96469746f0000000081525060400191505060405180910390fd5b61244783613680565b15156124e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4e6f766f20656e64657265c3a76f206ec3a36f20657374c3a120646973706f6e81526020017fc3ad76656c00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6124ea81611c80565b1515612584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4120636f6e746120617475616c206ec3a36f20657374c3a120686162696c697481526020017f61646120706172612074726f636100000000000000000000000000000000000081525060400191505060405180910390fd5b61258d82611e8f565b1515612627576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f4f2068617368206461206465636c617261c3a7c3a36f20c3a920696e76c3a16c81526020017f69646f000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8567ffffffffffffffff16600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614801561270957508467ffffffffffffffff16600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16145b15156127a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f4461646f7320696e636f6e73697374656e74657320646520636e706a206f752081526020017f7375626372c3a96469746f00000000000000000000000000000000000000000081525060400191505060405180910390fd5b60a0604051908101604052808767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018563ffffffff168152602001838152602001600160048111156127ee57fe5b815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010190805190602001906128d1929190614490565b5060808201518160020160006101000a81548160ff021916908360048111156128f657fe5b02179055509050506004600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff0219169083600481111561295d57fe5b021790555082600760008867ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008767ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd82d5fb8d459ced400a06631b9ab5eeffafb65a8c0bf5d8346035374ceeeafc5818488888887604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018567ffffffffffffffff1667ffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018363ffffffff1663ffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612afe578082015181840152602081019050612ae3565b50505050905090810190601f168015612b2b5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a1505050505050565b612b4e33611b02565b1515612be8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f536f6d656e7465206f20726573706f6e73c3a176656c2070656c612076616c6981526020017f6461c3a7c3a36f20706f64652076616c6964617220636f6e746173000000000081525060400191505060405180910390fd5b60016004811115612bf557fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166004811115612c5057fe5b141515612ceb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f4120636f6e74612070726563697361206573746172206e6f2065737461646f2081526020017f416775617264616e646f2056616c696461c3a7c3a36f0000000000000000000081525060400191505060405180910390fd5b806040516020018082805190602001908083835b602083101515612d245780518252602082019150602081019050602083039250612cff565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016040516020018082805460018160011615610100020316600290048015612dff5780601f10612ddd576101008083540402835291820191612dff565b820191906000526020600020905b815481529060010190602001808311612deb575b505091505060405160208183030381529060405280519060200120141515612eb5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f4f206861736820726563656269646f20c3a9206469666572656e746520646f2081526020017f657370657261646f00000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff02191690836004811115612f1457fe5b02179055507fd562fa69cd7f9f29b17f15cc04b6c895f0222835755d3617a61455b92da554db82600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff16600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff16600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff16604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15050565b6000600360048111156130d957fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16600481111561313457fe5b149050919050565b6000613147826117fc565b1561315557600090506131bd565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16141590505b919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff169050919050565b6132846132fc565b151561328f57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b61335b6132fc565b151561336657600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006133b5826117fc565b156133c35760649050613421565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16600481111561341e57fe5b90505b919050565b60008060006060600080600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff16600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff16600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff16600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660048111156135ce57fe5b8b828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136645780601f1061363957610100808354040283529160200191613664565b820191906000526020600020905b81548152906001019060200180831161364757829003601f168201915b5050505050925095509550955095509550955091939550919395565b600061368b826117fc565b156136995760009050613705565b600060048111156136a657fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16600481111561370157fe5b1490505b919050565b6000806000606060008060006137208989611a8b565b905061372b81613426565b965096509650965096509650509295509295509295565b61374b33611b02565b15156137e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d8152602001807f536f6d656e7465206f20726573706f6e73c3a176656c2070656c612076616c6981526020017f6461c3a7c3a36f20706f646520696e76616c6964617220636f6e74617300000081525060400191505060405180910390fd5b6137ee816117fc565b151515613889576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f4ec3a36f20c3a920706f7373c3ad76656c20696e76616c6964617220636f6e7481526020017f612072657365727661646100000000000000000000000000000000000000000081525060400191505060405180910390fd5b6003600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908360048111156138e857fe5b02179055507fefbe34d940db094a2bd0cf0857f4ef56ae5d3a6ece355e2efbb75b3f7147cd0d81600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff16600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff16600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff16604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a150565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b613acf6132fc565b1515613ada57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600480811115613b2c57fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166004811115613b8757fe5b149050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905090565b6000613c528261313c565b8015613cc3575060026004811115613c6657fe5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166004811115613cc157fe5b145b9050919050565b613cd26132fc565b1515613cdd57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b613d29613bef565b1515613d3457600080fd5b613d3d82613680565b1515613dd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f456e64657265c3a76f206ec3a36f20706f646520746572207369646f2063616481526020017f6173747261646f20616e746572696f726d656e7465000000000000000000000081525060400191505060405180910390fd5b613de081611e8f565b1515613e7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f4f2068617368206461206465636c617261c3a7c3a36f20c3a920696e76c3a16c81526020017f69646f000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60a0604051908101604052808667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018463ffffffff16815260200182815260200160016004811115613ec557fe5b815250600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548163ffffffff021916908363ffffffff1602179055506060820151816001019080519060200190613fa8929190614490565b5060808201518160020160006101000a81548160ff02191690836004811115613fcd57fe5b021790555090505060008467ffffffffffffffff1611156140c5576000613ff48686611a8b565b9050613fff81613680565b15156140bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001807f436c69656e7465206ac3a120657374c3a1206173736f636961646f2061206f7581526020017f74726f20656e64657265c3a76f2e2055736520612066756ec3a7c3a36f20547281526020017f6f63612e0000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b5061419f565b60006140d2866000611a8b565b90506140dd81613680565b151561419d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f466f726e656365646f72206ac3a120657374c3a1206173736f636961646f206181526020017f206f7574726f20656e64657265c3a76f2e2055736520612066756ec3a7c3a36f81526020017f2054726f63612e0000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b505b81600760008767ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdd642935494d30eab1c42790f71b6483dfc5962a284ec034372d9d49e0cb13bb8286868685604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018567ffffffffffffffff1667ffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018363ffffffff1663ffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156143085780820151818401526020810190506142ed565b50505050905090810190601f1680156143355780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a15050505050565b6143556132fc565b151561436057600080fd5b61436981614396565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156143d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106144d157805160ff19168380011785556144ff565b828001600101855582156144ff579182015b828111156144fe5782518255916020019190600101906144e3565b5b50905061450c9190614510565b5090565b61453291905b8082111561452e576000816000905550600101614516565b5090565b9056fea165627a7a72305820ef673bd8a4d489479950e8c1d0f4cb4f9b19005b52b86fb4ef3a1cac67c7bac80029
|
{"success": true, "error": null, "results": {}}
| 2,377 |
0x15754a1c2c139359ae347407958337bf7ebd93ab
|
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/*
- Developer provides LP, no presale
- No Team Tokens, Locked LP
- 100% Fair Launch
https://t.me/PandaRamen
https://twitter.com/PandaRamenEth
*/
// 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 PandaRamen is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "PandaRamen";
string private constant _symbol = "PRAMEN";
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600a81526020017f50616e646152616d656e00000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b600068056bc75e2d63100000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f5052414d454e0000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c98368056bc75e2d631000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b60008060006006549050600068056bc75e2d6310000090506124bd68056bc75e2d6310000060065461217490919063ffffffff16565b8210156124dc5760065468056bc75e2d631000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a3dab2b5374e1b26c7b3deb1330f928685c94d60d1da4f57fb7cf4e5bcc30a5264736f6c63430008040033
|
{"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"}]}}
| 2,378 |
0x8c6670ef178faa24e53cc96c1aab9521a248e978
|
/*
Telegram: https://t.me/MikuInu_ETH
// SPDX-License-Identifier: GPL-3.0-or-later
/**
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MIKU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MIKU INU";//
string private constant _symbol = "MINU";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 3;//
uint256 private _taxFeeOnBuy = 3;//
//Sell Fee
uint256 private _redisFeeOnSell = 4;//
uint256 private _taxFeeOnSell = 4;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x247D1E8Dd31a6178bAeEB177B9296Ba703742a20);//
address payable private _marketingAddress = payable(0x247D1E8Dd31a6178bAeEB177B9296Ba703742a20);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000 * 10**9; //
uint256 public _maxWalletSize = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061303d565b610702565b005b34801561021157600080fd5b5061021a61082c565b604051610227919061349a565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f9d565b610869565b6040516102649190613464565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061347f565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba919061367c565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f4a565b6108be565b6040516102f79190613464565b60405180910390f35b34801561030c57600080fd5b50610315610997565b604051610322919061367c565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136f1565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613449565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb0565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613086565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb0565b610c3e565b60405161041e919061367c565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130b3565b610de2565b005b34801561047357600080fd5b5061047c610e81565b604051610489919061367c565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613449565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613086565b610eb0565b005b3480156104f257600080fd5b506104fb610f6a565b604051610508919061367c565b60405180910390f35b34801561051d57600080fd5b50610526610f70565b604051610533919061349a565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130b3565b610fad565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e0565b61104c565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612f9d565b611103565b6040516105c29190613464565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb0565b611121565b6040516105ff9190613464565b60405180910390f35b34801561061457600080fd5b5061061d611141565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fdd565b61121a565b005b34801561065457600080fd5b5061065d611354565b60405161066a919061367c565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f0a565b61135a565b6040516106a7919061367c565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130b3565b6113e1565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb0565b611480565b005b61070a611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135dc565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a6f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139c8565b91505061079a565b5050565b60606040518060400160405280600881526020017f4d494b5520494e55000000000000000000000000000000000000000000000000815250905090565b600061087d610876611642565b848461164a565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611815565b61098c846108d7611642565b61098785604051806060016040528060288152602001613f1d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611642565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121e99092919063ffffffff16565b61164a565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135dc565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135dc565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611642565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611642565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b8161224d565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612348565b9050919050565b610c97611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135dc565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135dc565b60405180910390fd5b80601660146101000a81548160ff021916908315150217905550600360088190555050565b60185481565b60606040518060400160405280600481526020017f4d494e5500000000000000000000000000000000000000000000000000000000815250905090565b610fb5611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611042576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611039906135dc565b60405180910390fd5b8060198190555050565b611054611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d8906135dc565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b6000611117611110611642565b8484611815565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611182611642565b73ffffffffffffffffffffffffffffffffffffffff1614806111f85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111e0611642565b73ffffffffffffffffffffffffffffffffffffffff16145b61120157600080fd5b600061120c30610c3e565b9050611217816123b6565b50565b611222611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a6906135dc565b60405180910390fd5b60005b8383905081101561134e5781600560008686858181106112d5576112d4613a6f565b5b90506020020160208101906112ea9190612eb0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611346906139c8565b9150506112b2565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e9611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d906135dc565b60405180910390fd5b8060188190555050565b611488611642565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150c906135dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157c9061353c565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b19061365c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561172a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117219061355c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611808919061367c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611885576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187c9061361c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ec906134bc565b60405180910390fd5b60008111611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f906135fc565b60405180910390fd5b611940610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ae575061197e610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ee857601660149054906101000a900460ff16611a3d576119cf610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a33906134dc565b60405180910390fd5b5b601754811115611a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a799061351c565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b265750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5c9061357c565b60405180910390fd5b6008544311158015611bc45750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c1e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cb4576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d615760185481611d1684610c3e565b611d2091906137b2565b10611d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d579061363c565b60405180910390fd5b5b6000611d6c30610c3e565b9050600060195482101590506017548210611d875760175491505b808015611da15750601660159054906101000a900460ff16155b8015611dfb5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e11575060168054906101000a900460ff165b8015611e675750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ebd5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ee557611ecb826123b6565b60004790506000811115611ee357611ee24761224d565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f8f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120425750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120415750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205057600090506121d7565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120fb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211357600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121be5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121d657600b54600d81905550600c54600e819055505b5b6121e38484848461263e565b50505050565b6000838311158290612231576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612228919061349a565b60405180910390fd5b50600083856122409190613893565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61229d60028461266b90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122c8573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61231960028461266b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612344573d6000803e3d6000fd5b5050565b600060065482111561238f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612386906134fc565b60405180910390fd5b60006123996126b5565b90506123ae818461266b90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123ee576123ed613a9e565b5b60405190808252806020026020018201604052801561241c5781602001602082028036833780820191505090505b509050308160008151811061243457612433613a6f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124d657600080fd5b505afa1580156124ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250e9190612edd565b8160018151811061252257612521613a6f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061258930601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461164a565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125ed959493929190613697565b600060405180830381600087803b15801561260757600080fd5b505af115801561261b573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061264c5761264b6126e0565b5b612657848484612723565b80612665576126646128ee565b5b50505050565b60006126ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612902565b905092915050565b60008060006126c2612965565b915091506126d9818361266b90919063ffffffff16565b9250505090565b6000600d541480156126f457506000600e54145b156126fe57612721565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612735876129c7565b95509550955095509550955061279386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061282885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287481612ad7565b61287e8483612b94565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128db919061367c565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612949576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612940919061349a565b60405180910390fd5b50600083856129589190613808565b9050809150509392505050565b600080600060065490506000683635c9adc5dea00000905061299b683635c9adc5dea0000060065461266b90919063ffffffff16565b8210156129ba57600654683635c9adc5dea000009350935050506129c3565b81819350935050505b9091565b60008060008060008060008060006129e48a600d54600e54612bce565b92509250925060006129f46126b5565b90506000806000612a078e878787612c64565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121e9565b905092915050565b6000808284612a8891906137b2565b905083811015612acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ac49061359c565b60405180910390fd5b8091505092915050565b6000612ae16126b5565b90506000612af88284612ced90919063ffffffff16565b9050612b4c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ba982600654612a2f90919063ffffffff16565b600681905550612bc481600754612a7990919063ffffffff16565b6007819055505050565b600080600080612bfa6064612bec888a612ced90919063ffffffff16565b61266b90919063ffffffff16565b90506000612c246064612c16888b612ced90919063ffffffff16565b61266b90919063ffffffff16565b90506000612c4d82612c3f858c612a2f90919063ffffffff16565b612a2f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c7d8589612ced90919063ffffffff16565b90506000612c948689612ced90919063ffffffff16565b90506000612cab8789612ced90919063ffffffff16565b90506000612cd482612cc68587612a2f90919063ffffffff16565b612a2f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d005760009050612d62565b60008284612d0e9190613839565b9050828482612d1d9190613808565b14612d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d54906135bc565b60405180910390fd5b809150505b92915050565b6000612d7b612d7684613731565b61370c565b90508083825260208201905082856020860282011115612d9e57612d9d613ad7565b5b60005b85811015612dce5781612db48882612dd8565b845260208401935060208301925050600181019050612da1565b5050509392505050565b600081359050612de781613ed7565b92915050565b600081519050612dfc81613ed7565b92915050565b60008083601f840112612e1857612e17613ad2565b5b8235905067ffffffffffffffff811115612e3557612e34613acd565b5b602083019150836020820283011115612e5157612e50613ad7565b5b9250929050565b600082601f830112612e6d57612e6c613ad2565b5b8135612e7d848260208601612d68565b91505092915050565b600081359050612e9581613eee565b92915050565b600081359050612eaa81613f05565b92915050565b600060208284031215612ec657612ec5613ae1565b5b6000612ed484828501612dd8565b91505092915050565b600060208284031215612ef357612ef2613ae1565b5b6000612f0184828501612ded565b91505092915050565b60008060408385031215612f2157612f20613ae1565b5b6000612f2f85828601612dd8565b9250506020612f4085828601612dd8565b9150509250929050565b600080600060608486031215612f6357612f62613ae1565b5b6000612f7186828701612dd8565b9350506020612f8286828701612dd8565b9250506040612f9386828701612e9b565b9150509250925092565b60008060408385031215612fb457612fb3613ae1565b5b6000612fc285828601612dd8565b9250506020612fd385828601612e9b565b9150509250929050565b600080600060408486031215612ff657612ff5613ae1565b5b600084013567ffffffffffffffff81111561301457613013613adc565b5b61302086828701612e02565b9350935050602061303386828701612e86565b9150509250925092565b60006020828403121561305357613052613ae1565b5b600082013567ffffffffffffffff81111561307157613070613adc565b5b61307d84828501612e58565b91505092915050565b60006020828403121561309c5761309b613ae1565b5b60006130aa84828501612e86565b91505092915050565b6000602082840312156130c9576130c8613ae1565b5b60006130d784828501612e9b565b91505092915050565b600080600080608085870312156130fa576130f9613ae1565b5b600061310887828801612e9b565b945050602061311987828801612e9b565b935050604061312a87828801612e9b565b925050606061313b87828801612e9b565b91505092959194509250565b6000613153838361315f565b60208301905092915050565b613168816138c7565b82525050565b613177816138c7565b82525050565b60006131888261376d565b6131928185613790565b935061319d8361375d565b8060005b838110156131ce5781516131b58882613147565b97506131c083613783565b9250506001810190506131a1565b5085935050505092915050565b6131e4816138d9565b82525050565b6131f38161391c565b82525050565b6132028161392e565b82525050565b600061321382613778565b61321d81856137a1565b935061322d818560208601613964565b61323681613ae6565b840191505092915050565b600061324e6023836137a1565b915061325982613af7565b604082019050919050565b6000613271603f836137a1565b915061327c82613b46565b604082019050919050565b6000613294602a836137a1565b915061329f82613b95565b604082019050919050565b60006132b7601c836137a1565b91506132c282613be4565b602082019050919050565b60006132da6026836137a1565b91506132e582613c0d565b604082019050919050565b60006132fd6022836137a1565b915061330882613c5c565b604082019050919050565b60006133206023836137a1565b915061332b82613cab565b604082019050919050565b6000613343601b836137a1565b915061334e82613cfa565b602082019050919050565b60006133666021836137a1565b915061337182613d23565b604082019050919050565b60006133896020836137a1565b915061339482613d72565b602082019050919050565b60006133ac6029836137a1565b91506133b782613d9b565b604082019050919050565b60006133cf6025836137a1565b91506133da82613dea565b604082019050919050565b60006133f26023836137a1565b91506133fd82613e39565b604082019050919050565b60006134156024836137a1565b915061342082613e88565b604082019050919050565b61343481613905565b82525050565b6134438161390f565b82525050565b600060208201905061345e600083018461316e565b92915050565b600060208201905061347960008301846131db565b92915050565b600060208201905061349460008301846131ea565b92915050565b600060208201905081810360008301526134b48184613208565b905092915050565b600060208201905081810360008301526134d581613241565b9050919050565b600060208201905081810360008301526134f581613264565b9050919050565b6000602082019050818103600083015261351581613287565b9050919050565b60006020820190508181036000830152613535816132aa565b9050919050565b60006020820190508181036000830152613555816132cd565b9050919050565b60006020820190508181036000830152613575816132f0565b9050919050565b6000602082019050818103600083015261359581613313565b9050919050565b600060208201905081810360008301526135b581613336565b9050919050565b600060208201905081810360008301526135d581613359565b9050919050565b600060208201905081810360008301526135f58161337c565b9050919050565b600060208201905081810360008301526136158161339f565b9050919050565b60006020820190508181036000830152613635816133c2565b9050919050565b60006020820190508181036000830152613655816133e5565b9050919050565b6000602082019050818103600083015261367581613408565b9050919050565b6000602082019050613691600083018461342b565b92915050565b600060a0820190506136ac600083018861342b565b6136b960208301876131f9565b81810360408301526136cb818661317d565b90506136da606083018561316e565b6136e7608083018461342b565b9695505050505050565b6000602082019050613706600083018461343a565b92915050565b6000613716613727565b90506137228282613997565b919050565b6000604051905090565b600067ffffffffffffffff82111561374c5761374b613a9e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137bd82613905565b91506137c883613905565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137fd576137fc613a11565b5b828201905092915050565b600061381382613905565b915061381e83613905565b92508261382e5761382d613a40565b5b828204905092915050565b600061384482613905565b915061384f83613905565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388857613887613a11565b5b828202905092915050565b600061389e82613905565b91506138a983613905565b9250828210156138bc576138bb613a11565b5b828203905092915050565b60006138d2826138e5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392782613940565b9050919050565b600061393982613905565b9050919050565b600061394b82613952565b9050919050565b600061395d826138e5565b9050919050565b60005b83811015613982578082015181840152602081019050613967565b83811115613991576000848401525b50505050565b6139a082613ae6565b810181811067ffffffffffffffff821117156139bf576139be613a9e565b5b80604052505050565b60006139d382613905565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0657613a05613a11565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee0816138c7565b8114613eeb57600080fd5b50565b613ef7816138d9565b8114613f0257600080fd5b50565b613f0e81613905565b8114613f1957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220393c2ae3c335e4814872732c427c4656faa9745f3ff8229faf53ab7503595ddc64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 2,379 |
0x39a4bd9fabf10ac9f57fa6f23b39660dea1c29a0
|
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/*
LAUNCHING at 1930 UTC TODAY!!!
O)) O) O)) O)) O)) O)) O)) O) O)) O)) O)) O)) O)))))))
O)) O)) O)) O)) O)) O) O)) O) )) O)) O)) O)) O)) O)) O)) O))
O)) O)) O)) O)) O) O)) O) O)) O)) O)) O)) O)) O)) O))
O)) O)))))) O)) O)) O))) O) O)) O)) O)) O)))))) O)) O)) O)))))))
O)) O)) O)) O)) O) O)) O)))))) O)) O)) O)) O)) O)) O))
O)) O)) O)) O)) O)) O) O) O)) O)) O)) O)) O)) O)) O)) O))
O)) O) O)) O)) O)) O)))) O)) O)) O)) O)))) O)) O)) O)) O))
Fair & Stealth Launch
SHIB CHIP'S COMMUNITY 💎
https://twitter.com/SHIBCHIP
https://t.me/shibchiptoken
https://shibchip.com/
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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 SHIBCHIP 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"Shiba Chip";
string public constant symbol = unicode"SHIBCHIP";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 13;
uint public _sellFee = 13;
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 + (10 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/6;
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 = 50000000 * 10**9;
_maxHeldTokens = 100000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 50000000 * 10**9);
require(maxheld >= 100000000 * 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);
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 13 && sell < 13 );
_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];
}
}
|
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105ad578063db92dbb6146105c2578063dcb0e0ad146105d7578063dd62ed3e146105f7578063e8078d941461063d57600080fd5b8063a3f4782f14610538578063a9059cbb14610558578063b515566a14610578578063c3c8cd801461059857600080fd5b806373f54a11116100dc57806373f54a11146104a65780638da5cb5b146104c657806394b8d8f2146104e457806395d89b411461050457600080fd5b8063590f897e146104465780636fc3eaec1461045c57806370a0823114610471578063715018a61461049157600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103b757806340b9a54b146103f057806345596e2e1461040657806349bd5a5e1461042657600080fd5b806327f3a72a14610345578063313ce5671461035a57806331c2d8471461038157806332d873d8146103a157600080fd5b8063104ce66d116101c1578063104ce66d146102bc57806318160ddd146102f45780631940d0201461030f57806323b872dd1461032557600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026a5780630b78f9c01461029a57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025d6040518060400160405280600a8152602001690536869626120436869760b41b81525081565b60405161021e91906119e9565b34801561027657600080fd5b5061028a610285366004611a63565b610652565b604051901515815260200161021e565b3480156102a657600080fd5b506102ba6102b5366004611a8f565b610668565b005b3480156102c857600080fd5b506008546102dc906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030057600080fd5b50678ac7230489e80000610214565b34801561031b57600080fd5b50610214600e5481565b34801561033157600080fd5b5061028a610340366004611ab1565b6106e8565b34801561035157600080fd5b5061021461073c565b34801561036657600080fd5b5061036f600981565b60405160ff909116815260200161021e565b34801561038d57600080fd5b506102ba61039c366004611b08565b61074c565b3480156103ad57600080fd5b50610214600f5481565b3480156103c357600080fd5b5061028a6103d2366004611bcd565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fc57600080fd5b50610214600a5481565b34801561041257600080fd5b506102ba610421366004611bea565b6107d8565b34801561043257600080fd5b506009546102dc906001600160a01b031681565b34801561045257600080fd5b50610214600b5481565b34801561046857600080fd5b506102ba610841565b34801561047d57600080fd5b5061021461048c366004611bcd565b61086e565b34801561049d57600080fd5b506102ba610889565b3480156104b257600080fd5b506102ba6104c1366004611bcd565b610906565b3480156104d257600080fd5b506000546001600160a01b03166102dc565b3480156104f057600080fd5b5060105461028a9062010000900460ff1681565b34801561051057600080fd5b5061025d60405180604001604052806008815260200167053484942434849560c41b81525081565b34801561054457600080fd5b506102ba610553366004611a8f565b610974565b34801561056457600080fd5b5061028a610573366004611a63565b6109c8565b34801561058457600080fd5b506102ba610593366004611b08565b6109d5565b3480156105a457600080fd5b506102ba610aee565b3480156105b957600080fd5b506102ba610b24565b3480156105ce57600080fd5b50610214610bc5565b3480156105e357600080fd5b506102ba6105f2366004611c11565b610bdd565b34801561060357600080fd5b50610214610612366004611c2e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064957600080fd5b506102ba610c50565b600061065f338484610f96565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068857600080fd5b600d821080156106985750600d81105b6106a157600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106f58484846110ba565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610724908490611c7d565b9050610731853383610f96565b506001949350505050565b60006107473061086e565b905090565b6008546001600160a01b0316336001600160a01b03161461076c57600080fd5b60005b81518110156107d45760006005600084848151811061079057610790611c94565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107cc81611caa565b91505061076f565b5050565b6008546001600160a01b0316336001600160a01b0316146107f857600080fd5b6000811161080557600080fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b03161461086157600080fd5b4761086b81611686565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108bc5760405162461bcd60e51b81526004016108b390611cc5565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461092657600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610836565b6008546001600160a01b0316336001600160a01b03161461099457600080fd5b66b1a2bc2ec500008210156109a857600080fd5b67016345785d8a00008110156109bd57600080fd5b600d91909155600e55565b600061065f3384846110ba565b6000546001600160a01b031633146109ff5760405162461bcd60e51b81526004016108b390611cc5565b60005b81518110156107d45760095482516001600160a01b0390911690839083908110610a2e57610a2e611c94565b60200260200101516001600160a01b031614158015610a7f575060075482516001600160a01b0390911690839083908110610a6b57610a6b611c94565b60200260200101516001600160a01b031614155b15610adc57600160056000848481518110610a9c57610a9c611c94565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ae681611caa565b915050610a02565b6008546001600160a01b0316336001600160a01b031614610b0e57600080fd5b6000610b193061086e565b905061086b816116c0565b6000546001600160a01b03163314610b4e5760405162461bcd60e51b81526004016108b390611cc5565b60105460ff1615610b9b5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016108b3565b6010805460ff1916600117905542600f5566b1a2bc2ec50000600d5567016345785d8a0000600e55565b600954600090610747906001600160a01b031661086e565b6008546001600160a01b0316336001600160a01b031614610bfd57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610836565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b81526004016108b390611cc5565b60105460ff1615610cc75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016108b3565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d033082678ac7230489e80000610f96565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d659190611cfa565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd69190611cfa565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e479190611cfa565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e778161086e565b600080610e8c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ef4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f199190611d17565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d49190611d45565b6001600160a01b038316610ff85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108b3565b6001600160a01b0382166110595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108b3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161580156110fc57506001600160a01b03821660009081526005602052604090205460ff16155b801561111857503360009081526005602052604090205460ff16155b61112157600080fd5b6001600160a01b0383166111855760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108b3565b6001600160a01b0382166111e75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108b3565b600081116112495760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016108b3565b600080546001600160a01b0385811691161480159061127657506000546001600160a01b03848116911614155b15611627576009546001600160a01b0385811691161480156112a657506007546001600160a01b03848116911614155b80156112cb57506001600160a01b03831660009081526004602052604090205460ff16155b1561149d5760105460ff166113225760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016108b3565b600f54421415611350576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113a25760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016108b3565b600e546113ae8461086e565b6113b89084611d62565b11156114165760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016108b3565b6001600160a01b03831660009081526006602052604090206001015460ff1661147e576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff161580156114b7575060105460ff165b80156114d157506009546001600160a01b03858116911614155b15611627576114e142600a611d62565b6001600160a01b038516600090815260066020526040902054106115535760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016108b3565b600061155e3061086e565b905080156116105760105462010000900460ff16156115e157600c5460095460649190611593906001600160a01b031661086e565b61159d9190611d7a565b6115a79190611d99565b8111156115e157600c54600954606491906115ca906001600160a01b031661086e565b6115d49190611d7a565b6115de9190611d99565b90505b60006115ee600683611d99565b90506115fa8183611c7d565b915061160581611834565b61160e826116c0565b505b4780156116205761162047611686565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061166957506001600160a01b03841660009081526004602052604090205460ff165b15611672575060005b61167f8585858486611864565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107d4573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061170457611704611c94565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190611cfa565b8160018151811061179457611794611c94565b6001600160a01b0392831660209182029290920101526007546117ba9130911684610f96565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906117f3908590600090869030904290600401611dbb565b600060405180830381600087803b15801561180d57600080fd5b505af1158015611821573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff0019166101001790558015611856576118563061dead836110ba565b506010805461ff0019169055565b60006118708383611886565b905061187e868686846118aa565b505050505050565b60008083156118a357821561189e5750600a546118a3565b50600b545b9392505050565b6000806118b78484611987565b6001600160a01b03881660009081526002602052604090205491935091506118e0908590611c7d565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611910908390611d62565b6001600160a01b038616600090815260026020526040902055611932816119bb565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161197791815260200190565b60405180910390a3505050505050565b6000808060646119978587611d7a565b6119a19190611d99565b905060006119af8287611c7d565b96919550909350505050565b306000908152600260205260409020546119d6908290611d62565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a16578581018301518582016040015282016119fa565b81811115611a28576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086b57600080fd5b8035611a5e81611a3e565b919050565b60008060408385031215611a7657600080fd5b8235611a8181611a3e565b946020939093013593505050565b60008060408385031215611aa257600080fd5b50508035926020909101359150565b600080600060608486031215611ac657600080fd5b8335611ad181611a3e565b92506020840135611ae181611a3e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b1b57600080fd5b823567ffffffffffffffff80821115611b3357600080fd5b818501915085601f830112611b4757600080fd5b813581811115611b5957611b59611af2565b8060051b604051601f19603f83011681018181108582111715611b7e57611b7e611af2565b604052918252848201925083810185019188831115611b9c57600080fd5b938501935b82851015611bc157611bb285611a53565b84529385019392850192611ba1565b98975050505050505050565b600060208284031215611bdf57600080fd5b81356118a381611a3e565b600060208284031215611bfc57600080fd5b5035919050565b801515811461086b57600080fd5b600060208284031215611c2357600080fd5b81356118a381611c03565b60008060408385031215611c4157600080fd5b8235611c4c81611a3e565b91506020830135611c5c81611a3e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c8f57611c8f611c67565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611cbe57611cbe611c67565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d0c57600080fd5b81516118a381611a3e565b600080600060608486031215611d2c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d5757600080fd5b81516118a381611c03565b60008219821115611d7557611d75611c67565b500190565b6000816000190483118215151615611d9457611d94611c67565b500290565b600082611db657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e0b5784516001600160a01b031683529383019391830191600101611de6565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220375b265d3f15665a361720a2e560504147e5c3f7afda8c34c5056da34d0a609f64736f6c634300080c0033
|
{"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"}]}}
| 2,380 |
0x047123122015491df4064ec443602daeffa8cac6
|
pragma solidity 0.4.4;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="cbb8bfaeadaaa5e5acaea4b9acae8ba8a4a5b8aea5b8b2b8e5a5aebf">[email protected]</span>>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param owner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="0f7c7b6a696e6121686a607d686a4f6c60617c6a617c767c21616a7b">[email protected]</span>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
event DailyLimitChange(uint dailyLimit);
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
Transaction tx = transactions[transactionId];
bool confirmed = isConfirmed(transactionId);
if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) {
tx.executed = true;
if (!confirmed)
spentToday += tx.value;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
if (!confirmed)
spentToday -= tx.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
}
|
0x606060405236156101325760e060020a6000350463025e7c278114610180578063173825d9146101b257806320ea8d86146101df5780632f54bf6e146102135780633411c81c146102335780634bc9fdc214610260578063547415251461028357806367eeba0c146102f75780636b0c932d146103055780637065cb4814610313578063784547a71461033e5780638b51d13f1461034e5780639ace38c2146103c2578063a0e67e2b146103fd578063a8abe69a1461046e578063b5dc40c31461054d578063b77bf60014610659578063ba51a6df14610667578063c01a8c8414610693578063c6427474146106a3578063cea0862114610714578063d74f8edd1461073f578063dc8452cd1461074c578063e20056e61461075a578063ee22610b1461078a578063f059cf2b1461079a575b6107a8600034111561017e57604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b565b34610002576107aa60043560038054829081101561000257600091825260209091200154600160a060020a0316905081565b34610002576107a8600435600030600160a060020a031633600160a060020a0316141515610a1a57610002565b34610002576107a8600435600160a060020a033390811660009081526002602052604090205460ff161515610c5f57610002565b34610002576107c660043560026020526000908152604090205460ff1681565b34610002576001602090815260043560009081526040808220909252602435815220546107c69060ff1681565b34610002576107da6007546000906201518001421115610d1b5750600654610d18565b34610002576107da6004356024356000805b600554811015610d2f578380156102be575060008181526020819052604090206003015460ff16155b806102e257508280156102e2575060008181526020819052604090206003015460ff165b156102ef57600191909101905b600101610295565b34610002576107da60065481565b34610002576107da60075481565b34610002576107a860043530600160a060020a031633600160a060020a0316141515610d3657610002565b34610002576107c6600435610801565b34610002576107da6004356000805b600354811015610e66576000838152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156103ba57600191909101905b60010161035d565b34610002576000602081905260043581526040902080546001820154600383015461087993600160a060020a03909316926002019060ff1684565b346100025760408051602080820183526000825260038054845181840281018401909552808552610923949283018282801561046257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610444575b50505050509050610d18565b34610002576109236004356024356044356064356040805160208181018352600080835283519182018452808252600554935192939192909182918059106104b35750595b9080825280602002602001820160405280156104ca575b509250600091508190505b600554811015610e6c578580156104fe575060008181526020819052604090206003015460ff16155b806105225750848015610522575060008181526020819052604090206003015460ff165b156105455780838381518110156100025760209081029091010152600191909101905b6001016104d5565b34610002576109236004356040805160208181018352600080835283519182018452808252600354935192939192909182918059106105895750595b9080825280602002602001820160405280156105a0575b509250600091508190505b600354811015610ee1576000858152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561065157600380548290811015610002576000918252602090912001548351600160a060020a03909116908490849081101561000257600160a060020a03909216602092830290910190910152600191909101905b6001016105ab565b34610002576107da60055481565b34610002576107a86004355b30600160a060020a031633600160a060020a0316141515610f5d57610002565b34610002576107a8600435610974565b3461000257604080516020600460443581810135601f81018490048402850184019095528484526107da948235946024803595606494929391909201918190840183828082843750949650505050505050600061096d848484600083600160a060020a0381161515610b6157610002565b34610002576107a860043530600160a060020a031633600160a060020a031614151561102857610002565b34610002576107da603281565b34610002576107da60045481565b34610002576107a8600435602435600030600160a060020a031633600160a060020a031614151561106357610002565b34610002576107a86004356109f7565b34610002576107da60085481565b005b60408051600160a060020a039092168252519081900360200190f35b604080519115158252519081900360200190f35b60408051918252519081900360200190f35b600084815260208190526040902092506111d6845b600080805b600354811015610872576000848152600160205260408120600380549192918490811015610002576000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561086357600191909101905b600454821415610e5e57600192505b5050919050565b60408051600160a060020a03861681526020810185905282151560608201526080918101828152845460026000196101006001841615020190911604928201839052909160a0830190859080156109115780601f106108e657610100808354040283529160200191610911565b820191906000526020600020905b8154815290600101906020018083116108f457829003601f168201915b50509550505050505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600302600f01f1509050019250505060405180910390f35b9050611021815b33600160a060020a03811660009081526002602052604090205460ff161515610fc857610002565b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610ce6855b6000818152602081905260408120600301548190839060ff16156107ec57610002565b600160a060020a038216600090815260026020526040902054829060ff161515610a4357610002565b600160a060020a0383166000908152600260205260408120805460ff1916905591505b60035460001901821015610b085782600160a060020a0316600360005083815481101561000257600091825260209091200154600160a060020a03161415610b3857600380546000198101908110156100025760009182526020909120015460038054600160a060020a039092169184908110156100025760009182526020909120018054600160a060020a031916606060020a928302929092049190911790555b600380546000198101808355919082908015829011610b4357600083815260209020610b43918101908301610c0e565b600190910190610a66565b505060035460045411159150610c26905057600354610c2690610673565b60055460408051608081018252878152602080820188815282840188815260006060850181905286815280845294852084518154606060020a91820291909104600160a060020a031990911617815591516001808401919091559051805160028085018054818a5298879020999b5096989497601f9481161561010002600019011604830185900484019490939291019083901061139257805160ff19168380011785555b506113c29291505b80821115610c225760008155600101610c0e565b5090565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff161515610cee57610002565b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35b505b50505050565b600084815260208190526040902060030154849060ff1615610c9457610002565b50600854600654035b90565b6008546006541015610d0f57506000610d18565b5092915050565b600160a060020a038116600090815260026020526040902054819060ff1615610d5e57610002565b81600160a060020a0381161515610d7457610002565b6003546004546001909101906032821180610d8e57508181115b80610d97575080155b80610da0575081155b15610daa57610002565b600160a060020a0385166000908152600260205260409020805460ff19166001908117909155600380549182018082559091908281838015829011610e0057600083815260209020610e00918101908301610c0e565b50505060009283525060208220018054600160a060020a031916606060020a88810204179055604051600160a060020a038716917ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d91a25050505050565b600101610806565b50919050565b878703604051805910610e7c5750595b908082528060200260200182016040528015610e93575b5093508790505b86811015610ed6578281815181101561000257906020019060200201518489830381518110156100025760209081029091010152600101610e9a565b505050949350505050565b81604051805910610eef5750595b908082528060200260200182016040528015610f06575b509350600090505b81811015610f55578281815181101561000257906020019060200201518482815181101561000257600160a060020a03909216602092830290910190910152600101610f0e565b505050919050565b600354816032821180610f6f57508181115b80610f78575080155b80610f81575081155b15610f8b57610002565b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b6000828152602081905260409020548290600160a060020a03161515610fed57610002565b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561099c57610002565b9392505050565b60068190556040805182815290517fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca29181900360200190a150565b600160a060020a038316600090815260026020526040902054839060ff16151561108c57610002565b600160a060020a038316600090815260026020526040902054839060ff16156110b457610002565b600092505b6003548310156111315784600160a060020a0316600360005084815481101561000257600091825260209091200154600160a060020a031614156111cb578360036000508481548110156100025760009182526020909120018054600160a060020a031916606060020a928302929092049190911790555b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b6001909201916110b9565b91508180611245575060028084015460001961010060018316150201160415801561124557506001830154611245906007546000906201518001421115611221574260075560006008555b600654600854830111806112385750600854828101105b1561142457506000611428565b15610ce85760038301805460ff1916600117905581151561126f5760018301546008805490910190555b825460018085015460405160028088018054600160a060020a039096169593949093839285926000199083161561010002019091160480156112f25780601f106112c7576101008083540402835291602001916112f2565b820191906000526020600020905b8154815290600101906020018083116112d557829003601f168201915b505091505060006040518083038185876185025a03f192505050156113415760405184907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2610ce8565b60405184907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038301805460ff19169055811515610ce8575050600101546008805491909103905550565b82800160010185558215610c06579182015b82811115610c065782518260005055916020019190600101906113a4565b5050606091909101516003909101805460ff191660f860020a9283029290920491909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b5060015b91905056
|
{"success": true, "error": null, "results": {}}
| 2,381 |
0x9959edefdf89356c4a4f3e58baa3ed3ce418b004
|
// SPDX-License-Identifier: MIT
/*
____ _ _ __ __ _
/ ___| |__ __ _ __| | \/ | __ _ ___| |_ ___ _ __
| | | '_ \ / _` |/ _` | |\/| |/ _` / __| __/ _ \ '__|
| |___| | | | (_| | (_| | | | | (_| \__ \ || __/ |
\____|_| |_|\__,_|\__,_|_| |_|\__,_|___/\__\___|_|
Token Name: ChadMaster
Token Symbol: CMAS
Total Supply: 10000000000
Decimals: 18
*/
pragma solidity ^0.8.0;
/**
* @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 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 Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Lite is IERC20, IERC20Metadata {
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 internal _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(msg.sender, 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(msg.sender, 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][msg.sender];
require(currentAllowance >= amount);
unchecked {
_approve(sender, msg.sender, currentAllowance - amount);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount);
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, 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 {
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ChadMasterToken is ERC20Lite {
uint16 FavouriteNumber = 36705;
constructor(uint256 totalSupply_, string memory name_, string memory symbol_) ERC20Lite(name_, symbol_) payable {
_totalSupply = totalSupply_;
_balances[msg.sender] = totalSupply_;
_approve(msg.sender, 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, totalSupply_);
emit Transfer(address(0), msg.sender, totalSupply_);
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146100fe57806370a082311461010d57806395d89b4114610136578063a9059cbb1461013e578063dd62ed3e1461015157600080fd5b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100eb575b600080fd5b6100a061018a565b6040516100ad91906103bc565b60405180910390f35b6100c96100c436600461042d565b61021c565b60405190151581526020016100ad565b6002545b6040519081526020016100ad565b6100c96100f9366004610457565b610232565b604051601281526020016100ad565b6100dd61011b366004610493565b6001600160a01b031660009081526020819052604090205490565b6100a0610288565b6100c961014c36600461042d565b610297565b6100dd61015f3660046104b5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610199906104e8565b80601f01602080910402602001604051908101604052809291908181526020018280546101c5906104e8565b80156102125780601f106101e757610100808354040283529160200191610212565b820191906000526020600020905b8154815290600101906020018083116101f557829003601f168201915b5050505050905090565b60006102293384846102a4565b50600192915050565b600061023f848484610305565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561027057600080fd5b61027d85338584036102a4565b506001949350505050565b606060048054610199906104e8565b6000610229338484610305565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166000908152602081905260409020548181101561032b57600080fd5b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610362908490610522565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516103ae91815260200190565b60405180910390a350505050565b600060208083528351808285015260005b818110156103e9578581018301518582016040015282016103cd565b818111156103fb576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461042857600080fd5b919050565b6000806040838503121561044057600080fd5b61044983610411565b946020939093013593505050565b60008060006060848603121561046c57600080fd5b61047584610411565b925061048360208501610411565b9150604084013590509250925092565b6000602082840312156104a557600080fd5b6104ae82610411565b9392505050565b600080604083850312156104c857600080fd5b6104d183610411565b91506104df60208401610411565b90509250929050565b600181811c908216806104fc57607f821691505b60208210810361051c57634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561054357634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212208df08ccca0611b20f58c38d719e06f21f5f5e936156c62e391e6e04d7a822aac64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 2,382 |
0x3f932005a333d1aa903f861686c0e55b28a6ef7b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// SPDX-License-Identifier: Unlicensed
// Twitter
// https://twitter.com/WalletXOfficial
// Website
// https://walletx.tech/
// Telegram
// https://t.me/walletxportal
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 WALLETX is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Wallet X";
string private constant _symbol = "WALLETX";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 12;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 33;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x87Bd5acfcbD87dA9c61A118334c15c15230d1045);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1e10 * 10**9;
uint256 public _maxWalletSize = 3e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e9 * 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 {
_burnFee = amount;
}
}
|
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610596578063c5528490146105b6578063dd62ed3e146105d6578063ea1644d51461061c578063f2fde38b1461063c57600080fd5b80638da5cb5b1461051d5780638f9a55c01461053b57806395d89b41146105515780639e78fb4f1461058157600080fd5b8063790ca413116100dc578063790ca413146104bc5780637c519ffb146104d25780637d1db4a5146104e7578063881dce60146104fd57600080fd5b80636fc3eaec1461045257806370a0823114610467578063715018a61461048757806374010ece1461049c57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d25780634bf2c7c9146103f25780635d098b38146104125780636d8aa8f81461043257600080fd5b80632fd689e314610360578063313ce5671461037657806333251a0b1461039257806338eea22d146103b257600080fd5b806318160ddd116101c157806318160ddd146102e257806323b872dd1461030857806327c8f8351461032857806328bb665a1461033e57600080fd5b806306fdde03146101fe578063095ea7b3146102415780630f3a325f146102715780631694505e146102aa57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b506040805180820190915260088152670aec2d8d8cae840b60c31b60208201525b6040516102389190611f97565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611e42565b61065c565b6040519015158152602001610238565b34801561027d57600080fd5b5061026161028c366004611d8e565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b657600080fd5b506016546102ca906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102ee57600080fd5b50683635c9adc5dea000005b604051908152602001610238565b34801561031457600080fd5b50610261610323366004611e01565b610673565b34801561033457600080fd5b506102ca61dead81565b34801561034a57600080fd5b5061035e610359366004611e6e565b6106dc565b005b34801561036c57600080fd5b506102fa601a5481565b34801561038257600080fd5b5060405160098152602001610238565b34801561039e57600080fd5b5061035e6103ad366004611d8e565b61077b565b3480156103be57600080fd5b5061035e6103cd366004611f75565b6107ea565b3480156103de57600080fd5b506017546102ca906001600160a01b031681565b3480156103fe57600080fd5b5061035e61040d366004611f5c565b61083b565b34801561041e57600080fd5b5061035e61042d366004611d8e565b61086a565b34801561043e57600080fd5b5061035e61044d366004611f3a565b6108c4565b34801561045e57600080fd5b5061035e61090c565b34801561047357600080fd5b506102fa610482366004611d8e565b610936565b34801561049357600080fd5b5061035e610958565b3480156104a857600080fd5b5061035e6104b7366004611f5c565b6109cc565b3480156104c857600080fd5b506102fa600a5481565b3480156104de57600080fd5b5061035e610a10565b3480156104f357600080fd5b506102fa60185481565b34801561050957600080fd5b5061035e610518366004611f5c565b610a6a565b34801561052957600080fd5b506000546001600160a01b03166102ca565b34801561054757600080fd5b506102fa60195481565b34801561055d57600080fd5b506040805180820190915260078152660ae8298988aa8b60cb1b602082015261022b565b34801561058d57600080fd5b5061035e610ae6565b3480156105a257600080fd5b506102616105b1366004611e42565b610ccb565b3480156105c257600080fd5b5061035e6105d1366004611f75565b610cd8565b3480156105e257600080fd5b506102fa6105f1366004611dc8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062857600080fd5b5061035e610637366004611f5c565b610d29565b34801561064857600080fd5b5061035e610657366004611d8e565b610d67565b6000610669338484610e51565b5060015b92915050565b6000610680848484610f75565b6106d284336106cd8560405180606001604052806028815260200161219c602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611621565b610e51565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b815260040161070690611fec565b60405180910390fd5b60005b8151811015610777576001600960008484815181106107335761073361215a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076f81612129565b915050610712565b5050565b6000546001600160a01b031633146107a55760405162461bcd60e51b815260040161070690611fec565b6001600160a01b03811660009081526009602052604090205460ff16156107e7576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108145760405162461bcd60e51b815260040161070690611fec565b600182111561082257600080fd5b600181111561083057600080fd5b600b91909155600d55565b6000546001600160a01b031633146108655760405162461bcd60e51b815260040161070690611fec565b601155565b6015546001600160a01b0316336001600160a01b03161461088a57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161070690611fec565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461092c57600080fd5b476107e78161165b565b6001600160a01b03811660009081526002602052604081205461066d90611695565b6000546001600160a01b031633146109825760405162461bcd60e51b815260040161070690611fec565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109f65760405162461bcd60e51b815260040161070690611fec565b674563918244f40000811015610a0b57600080fd5b601855565b6000546001600160a01b03163314610a3a5760405162461bcd60e51b815260040161070690611fec565b601754600160a01b900460ff1615610a5157600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a8a57600080fd5b610a9330610936565b8111158015610aa25750600081115b610add5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610706565b6107e781611719565b6000546001600160a01b03163314610b105760405162461bcd60e51b815260040161070690611fec565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba89190611dab565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf057600080fd5b505afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190611dab565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c7057600080fd5b505af1158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca89190611dab565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610669338484610f75565b6000546001600160a01b03163314610d025760405162461bcd60e51b815260040161070690611fec565b600d821115610d1057600080fd5b600d811115610d1e57600080fd5b600c91909155600e55565b6000546001600160a01b03163314610d535760405162461bcd60e51b815260040161070690611fec565b601954811015610d6257600080fd5b601955565b6000546001600160a01b03163314610d915760405162461bcd60e51b815260040161070690611fec565b6001600160a01b038116610df65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610706565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610eb35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610706565b6001600160a01b038216610f145760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610706565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610706565b6001600160a01b03821661103b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610706565b6000811161109d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610706565b6001600160a01b03821660009081526009602052604090205460ff16156110d65760405162461bcd60e51b815260040161070690612021565b6001600160a01b03831660009081526009602052604090205460ff161561110f5760405162461bcd60e51b815260040161070690612021565b3360009081526009602052604090205460ff161561113f5760405162461bcd60e51b815260040161070690612021565b6000546001600160a01b0384811691161480159061116b57506000546001600160a01b03838116911614155b156114cb57601754600160a01b900460ff166111c95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610706565b6017546001600160a01b0383811691161480156111f457506016546001600160a01b03848116911614155b156112a6576001600160a01b038216301480159061121b57506001600160a01b0383163014155b801561123557506015546001600160a01b03838116911614155b801561124f57506015546001600160a01b03848116911614155b156112a6576018548111156112a65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610706565b6017546001600160a01b038381169116148015906112d257506015546001600160a01b03838116911614155b80156112e757506001600160a01b0382163014155b80156112fe57506001600160a01b03821661dead14155b156113c5576018548111156113555760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610706565b6019548161136284610936565b61136c91906120b9565b106113c55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610706565b60006113d030610936565b601a5490915081118080156113ef5750601754600160a81b900460ff16155b801561140957506017546001600160a01b03868116911614155b801561141e5750601754600160b01b900460ff165b801561144357506001600160a01b03851660009081526006602052604090205460ff16155b801561146857506001600160a01b03841660009081526006602052604090205460ff16155b156114c857601154600090156114a3576114986064611492601154866118a290919063ffffffff16565b90611921565b90506114a381611963565b6114b56114b08285612112565b611719565b4780156114c5576114c54761165b565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150d57506001600160a01b03831660009081526006602052604090205460ff165b8061153f57506017546001600160a01b0385811691161480159061153f57506017546001600160a01b03848116911614155b1561154c5750600061160f565b6017546001600160a01b03858116911614801561157757506016546001600160a01b03848116911614155b156115d2576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156115d2576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156115fd57506016546001600160a01b03858116911614155b1561160f57600d54600f55600e546010555b61161b84848484611970565b50505050565b600081848411156116455760405162461bcd60e51b81526004016107069190611f97565b5060006116528486612112565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610777573d6000803e3d6000fd5b60006007548211156116fc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610706565b60006117066119a4565b90506117128382611921565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117615761176161215a565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117b557600080fd5b505afa1580156117c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ed9190611dab565b816001815181106118005761180061215a565b6001600160a01b0392831660209182029290920101526016546118269130911684610e51565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061185f908590600090869030904290600401612048565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118b15750600061066d565b60006118bd83856120f3565b9050826118ca85836120d1565b146117125760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610706565b600061171283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c7565b6107e73061dead83610f75565b8061197d5761197d6119f5565b611988848484611a3a565b8061161b5761161b601254600f55601354601055601454601155565b60008060006119b1611b31565b90925090506119c08282611921565b9250505090565b600081836119e85760405162461bcd60e51b81526004016107069190611f97565b50600061165284866120d1565b600f54158015611a055750601054155b8015611a115750601154155b15611a1857565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611a4c87611b73565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a7e9087611bd0565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aad9086611c12565b6001600160a01b038916600090815260026020526040902055611acf81611c71565b611ad98483611cbb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b1e91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611b4d8282611921565b821015611b6a57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611b908a600f54601054611cdf565b9250925092506000611ba06119a4565b90506000806000611bb38e878787611d2e565b919e509c509a509598509396509194505050505091939550919395565b600061171283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611621565b600080611c1f83856120b9565b9050838110156117125760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610706565b6000611c7b6119a4565b90506000611c8983836118a2565b30600090815260026020526040902054909150611ca69082611c12565b30600090815260026020526040902055505050565b600754611cc89083611bd0565b600755600854611cd89082611c12565b6008555050565b6000808080611cf3606461149289896118a2565b90506000611d0660646114928a896118a2565b90506000611d1e82611d188b86611bd0565b90611bd0565b9992985090965090945050505050565b6000808080611d3d88866118a2565b90506000611d4b88876118a2565b90506000611d5988886118a2565b90506000611d6b82611d188686611bd0565b939b939a50919850919650505050505050565b8035611d8981612186565b919050565b600060208284031215611da057600080fd5b813561171281612186565b600060208284031215611dbd57600080fd5b815161171281612186565b60008060408385031215611ddb57600080fd5b8235611de681612186565b91506020830135611df681612186565b809150509250929050565b600080600060608486031215611e1657600080fd5b8335611e2181612186565b92506020840135611e3181612186565b929592945050506040919091013590565b60008060408385031215611e5557600080fd5b8235611e6081612186565b946020939093013593505050565b60006020808385031215611e8157600080fd5b823567ffffffffffffffff80821115611e9957600080fd5b818501915085601f830112611ead57600080fd5b813581811115611ebf57611ebf612170565b8060051b604051601f19603f83011681018181108582111715611ee457611ee4612170565b604052828152858101935084860182860187018a1015611f0357600080fd5b600095505b83861015611f2d57611f1981611d7e565b855260019590950194938601938601611f08565b5098975050505050505050565b600060208284031215611f4c57600080fd5b8135801515811461171257600080fd5b600060208284031215611f6e57600080fd5b5035919050565b60008060408385031215611f8857600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611fc457858101830151858201604001528201611fa8565b81811115611fd6576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120985784516001600160a01b031683529383019391830191600101612073565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120cc576120cc612144565b500190565b6000826120ee57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561210d5761210d612144565b500290565b60008282101561212457612124612144565b500390565b600060001982141561213d5761213d612144565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220465a4b53717da4f3befe9a875b4dd953be82a5b4820078f62f291e158317339e64736f6c63430008070033
|
{"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"}]}}
| 2,383 |
0xb2278a7691a7e53e1fa5d38e9cd463e00151c9aa
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/mahitoinu
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet
uint256 constant TOTAL_SUPPLY=100000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Mahito Inu";
string constant TOKEN_SYMBOL="MINU";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Minu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600a81526020017f4d616869746f20496e7500000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d494e5500000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202855cf42278f13152c46d9a7707ff95cee385d26fa41dbc1854944ed6879d9fa64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 2,384 |
0x66735649dd3d172ef3dedc16d81f191004031193
|
/**
*Submitted for verification at Etherscan.io on 2022-03-09
*/
/*
A casino is a place that some people find similar to a hotel, where you can enjoy various types staying up all night but enjoying gambling activities at the same time.
However, Casino is actually a Colosseum. It is a place for gladiators to fight, to seize, to conqueror.
You either double your bet or you earn nothing if you are not a fighter material.
Living in a cryptocurrency world is exactly like gambling in a Casino; you need to play to earn your profit.
Shibagen is designed to tell those jeets. You either die like a gladiators or live long to see yourself becomes a stupid loser. Be bold, not jeets !
Telegram: https://t.me/shibagen
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Shibagen is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shibagen";
string private constant _symbol = unicode"Shibagen";
uint private constant _decimals = 9;
uint256 private _teamFee = 10;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(10).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(10).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (4 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 10, "not larger than 10%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bf578063cf0848f7146103d4578063cf9d4afa146103f4578063dd62ed3e14610414578063e6ec64ec1461045a578063f2fde38b1461047a57600080fd5b8063715018a6146103225780638da5cb5b1461033757806390d49b9d1461035f57806395d89b4114610172578063a9059cbb1461037f578063b515566a1461039f57600080fd5b806331c2d8471161010857806331c2d8471461023b5780633bbac5791461025b578063437823ec14610294578063476343ee146102b45780635342acb4146102c957806370a082311461030257600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b257806318160ddd146101e257806323b872dd14610207578063313ce5671461022757600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049a565b005b34801561017e57600080fd5b50604080518082018252600881526729b434b130b3b2b760c11b602082015290516101a991906117e0565b60405180910390f35b3480156101be57600080fd5b506101d26101cd36600461185a565b6104e6565b60405190151581526020016101a9565b3480156101ee57600080fd5b50670de0b6b3a76400005b6040519081526020016101a9565b34801561021357600080fd5b506101d2610222366004611886565b6104fd565b34801561023357600080fd5b5060096101f9565b34801561024757600080fd5b506101706102563660046118dd565b610566565b34801561026757600080fd5b506101d26102763660046119a2565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a057600080fd5b506101706102af3660046119a2565b6105fc565b3480156102c057600080fd5b5061017061064a565b3480156102d557600080fd5b506101d26102e43660046119a2565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030e57600080fd5b506101f961031d3660046119a2565b610684565b34801561032e57600080fd5b506101706106a6565b34801561034357600080fd5b506000546040516001600160a01b0390911681526020016101a9565b34801561036b57600080fd5b5061017061037a3660046119a2565b6106dc565b34801561038b57600080fd5b506101d261039a36600461185a565b610756565b3480156103ab57600080fd5b506101706103ba3660046118dd565b610763565b3480156103cb57600080fd5b5061017061087c565b3480156103e057600080fd5b506101706103ef3660046119a2565b610933565b34801561040057600080fd5b5061017061040f3660046119a2565b61097e565b34801561042057600080fd5b506101f961042f3660046119bf565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046657600080fd5b506101706104753660046119f8565b610bd9565b34801561048657600080fd5b506101706104953660046119a2565b610c4f565b6000546001600160a01b031633146104cd5760405162461bcd60e51b81526004016104c490611a11565b60405180910390fd5b60006104d830610684565b90506104e381610ce7565b50565b60006104f3338484610e61565b5060015b92915050565b600061050a848484610f85565b61055c843361055785604051806060016040528060288152602001611b8c602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112c9565b610e61565b5060019392505050565b6000546001600160a01b031633146105905760405162461bcd60e51b81526004016104c490611a11565b60005b81518110156105f8576000600560008484815181106105b4576105b4611a46565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f081611a72565b915050610593565b5050565b6000546001600160a01b031633146106265760405162461bcd60e51b81526004016104c490611a11565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f8573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f790611303565b6000546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c490611a11565b6106da6000611387565b565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104c490611a11565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f3338484610f85565b6000546001600160a01b0316331461078d5760405162461bcd60e51b81526004016104c490611a11565b60005b81518110156105f857600c5482516001600160a01b03909116908390839081106107bc576107bc611a46565b60200260200101516001600160a01b03161415801561080d5750600b5482516001600160a01b03909116908390839081106107f9576107f9611a46565b60200260200101516001600160a01b031614155b1561086a5760016005600084848151811061082a5761082a611a46565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087481611a72565b915050610790565b6000546001600160a01b031633146108a65760405162461bcd60e51b81526004016104c490611a11565b600c54600160a01b900460ff1661090a5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c4565b600c805460ff60b81b1916600160b81b17905542600d81905561092e9060f0611a8d565b600e55565b6000546001600160a01b0316331461095d5760405162461bcd60e51b81526004016104c490611a11565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a85760405162461bcd60e51b81526004016104c490611a11565b600c54600160a01b900460ff1615610a105760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c4565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8b9190611aa5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190611aa5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6d9190611aa5565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c035760405162461bcd60e51b81526004016104c490611a11565b600a811115610c4a5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031302560681b60448201526064016104c4565b600855565b6000546001600160a01b03163314610c795760405162461bcd60e51b81526004016104c490611a11565b6001600160a01b038116610cde5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c4565b6104e381611387565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2f57610d2f611a46565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dac9190611aa5565b81600181518110610dbf57610dbf611a46565b6001600160a01b039283166020918202929092010152600b54610de59130911684610e61565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1e908590600090869030904290600401611ac2565b600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c4565b6001600160a01b038216610f245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c4565b6001600160a01b03821661104b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c4565b6000811161105857600080fd5b6001600160a01b03831660009081526005602052604090205460ff161561107e57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110c057506001600160a01b03831660009081526004602052604090205460ff16155b80156110d65750600c54600160a81b900460ff16155b80156111065750600c546001600160a01b03858116911614806111065750600c546001600160a01b038481169116145b156112b757600c54600160b81b900460ff166111645760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c4565b50600c546001906001600160a01b0385811691161480156111935750600b546001600160a01b03848116911614155b80156111a0575042600e54115b156111e75760006111b084610684565b90506111d060646111ca670de0b6b3a764000060026113d7565b90611456565b6111da8483611498565b11156111e557600080fd5b505b600d54421415611215576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061122030610684565b600c54909150600160b01b900460ff1615801561124b5750600c546001600160a01b03868116911614155b156112b55780156112b557600c5461127f906064906111ca90600a90611279906001600160a01b0316610684565b906113d7565b8111156112ac57600c546112a9906064906111ca90600a90611279906001600160a01b0316610684565b90505b6112b581610ce7565b505b6112c3848484846114f7565b50505050565b600081848411156112ed5760405162461bcd60e51b81526004016104c491906117e0565b5060006112fa8486611b33565b95945050505050565b600060065482111561136a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c4565b60006113746115fa565b90506113808382611456565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826113e6575060006104f7565b60006113f28385611b4a565b9050826113ff8583611b69565b146113805760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c4565b600061138083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061161d565b6000806114a58385611a8d565b9050838110156113805760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c4565b80806115055761150561164b565b60008060008061151487611667565b6001600160a01b038d166000908152600160205260409020549397509195509350915061154190856116ae565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115709084611498565b6001600160a01b038916600090815260016020526040902055611592816116f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115d791815260200190565b60405180910390a350505050806115f3576115f3600954600855565b5050505050565b600080600061160761173a565b90925090506116168282611456565b9250505090565b6000818361163e5760405162461bcd60e51b81526004016104c491906117e0565b5060006112fa8486611b69565b60006008541161165a57600080fd5b6008805460095560009055565b60008060008060008061167c8760085461177a565b91509150600061168a6115fa565b905060008061169a8a85856117a7565b909b909a5094985092965092945050505050565b600061138083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c9565b60006116fa6115fa565b9050600061170883836113d7565b306000908152600160205260409020549091506117259082611498565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006117558282611456565b82101561177157505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061178d60646111ca87876113d7565b9050600061179b86836116ae565b96919550909350505050565b600080806117b586856113d7565b905060006117c386866113d7565b905060006117d183836116ae565b92989297509195505050505050565b600060208083528351808285015260005b8181101561180d578581018301518582016040015282016117f1565b8181111561181f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e357600080fd5b803561185581611835565b919050565b6000806040838503121561186d57600080fd5b823561187881611835565b946020939093013593505050565b60008060006060848603121561189b57600080fd5b83356118a681611835565b925060208401356118b681611835565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118f057600080fd5b823567ffffffffffffffff8082111561190857600080fd5b818501915085601f83011261191c57600080fd5b81358181111561192e5761192e6118c7565b8060051b604051601f19603f83011681018181108582111715611953576119536118c7565b60405291825284820192508381018501918883111561197157600080fd5b938501935b82851015611996576119878561184a565b84529385019392850192611976565b98975050505050505050565b6000602082840312156119b457600080fd5b813561138081611835565b600080604083850312156119d257600080fd5b82356119dd81611835565b915060208301356119ed81611835565b809150509250929050565b600060208284031215611a0a57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a8657611a86611a5c565b5060010190565b60008219821115611aa057611aa0611a5c565b500190565b600060208284031215611ab757600080fd5b815161138081611835565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b125784516001600160a01b031683529383019391830191600101611aed565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b4557611b45611a5c565b500390565b6000816000190483118215151615611b6457611b64611a5c565b500290565b600082611b8657634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207e28188b9b81a131e212126a4338f3d5efd77b25072fcbbd0efcbf3a3428228864736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 2,385 |
0xa2f987a546d4cd1c607ee8141276876c26b72bdf
|
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: OpenZeppelin/openzeppelin-contracts@4.0.0/contracts/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) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: OpenZeppelin/openzeppelin-contracts@4.0.0/contracts/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 {
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: OpenZeppelin/openzeppelin-contracts@4.0.0/contracts/proxy/ERC1967/ERC1967Proxy.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 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)
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: AnchorVaultProxy.sol /////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @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
}
}
}
/**
* @dev An ossifiable proxy for AnchorVault contract.
*/
contract AnchorVaultProxy 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 implementation and admin.
*/
constructor(address implementation, address admin)
ERC1967Proxy(implementation, new bytes(0))
{
_setAdmin(admin);
}
/**
* @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(admin != address(0), "proxy: ossified");
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);
}
}
|
0x60806040526004361061004e5760003560e01c8063019fa4f1146100655780632e1997b6146100855780635c60da1b146100af578063621f6309146100dc578063abe5e587146100fc5761005d565b3661005d5761005b610111565b005b61005b610111565b34801561007157600080fd5b5061005b61008036600461062a565b610143565b34801561009157600080fd5b5061009a61026b565b60405190151581526020015b60405180910390f35b3480156100bb57600080fd5b506100c4610285565b6040516001600160a01b0390911681526020016100a6565b3480156100e857600080fd5b5061005b6100f7366004610644565b6102b4565b34801561010857600080fd5b506100c46103a3565b61014161013c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6103e2565b565b600061014d610406565b90506001600160a01b03811661019c5760405162461bcd60e51b815260206004820152600f60248201526e1c1c9bde1e4e881bdcdcda599a5959608a1b60448201526064015b60405180910390fd5b336001600160a01b038216146101ea5760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b6044820152606401610193565b604080516001600160a01b038084168252841660208201527f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a17fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610380546001600160a01b0319166001600160a01b0384161790555050565b600080610276610406565b6001600160a01b031614905090565b60006102af7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905090565b60006102be610406565b90506001600160a01b0381166103085760405162461bcd60e51b815260206004820152600f60248201526e1c1c9bde1e4e881bdcdcda599a5959608a1b6044820152606401610193565b336001600160a01b038216146103565760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b6044820152606401610193565b61035f83610434565b81511561039e5761039c8383604051806040016040528060138152602001721c1c9bde1e4e881cd95d1d5c0819985a5b1959606a1b815250610474565b505b505050565b60006102af610406565b60606103d2838360405180606001604052806027815260200161079360279139610474565b9392505050565b3b151590565b90565b3660008037600080366000845af43d6000803e808015610401573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b61043d81610548565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6104d35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610193565b600080856001600160a01b0316856040516104ee9190610701565b600060405180830381855af49150503d8060008114610529576040519150601f19603f3d011682016040523d82523d6000602084013e61052e565b606091505b509150915061053e8282866105d5565b9695505050505050565b803b6105b15760405162461bcd60e51b815260206004820152603260248201527f4552433139363750726f78793a206e657720696d706c656d656e746174696f6e604482015271081a5cc81b9bdd08184818dbdb9d1c9858dd60721b6064820152608401610193565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156105e45750816103d2565b8251156105f45782518084602001fd5b8160405162461bcd60e51b8152600401610193919061071d565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063b578081fd5b6103d28261060e565b60008060408385031215610656578081fd5b61065f8361060e565b9150602083013567ffffffffffffffff8082111561067b578283fd5b818501915085601f83011261068e578283fd5b8135818111156106a0576106a061077c565b604051601f8201601f19908116603f011681019083821181831017156106c8576106c861077c565b816040528281528860208487010111156106e0578586fd5b82602086016020830137856020848301015280955050505050509250929050565b60008251610713818460208701610750565b9190910192915050565b602081526000825180602084015261073c816040850160208701610750565b601f01601f19169190910160400192915050565b60005b8381101561076b578181015183820152602001610753565b8381111561039c5750506000910152565b634e487b7160e01b600052604160045260246000fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206c4edfb604a02d7611b9c9bb502c3a647b8d8ec1d1552b829dccfc1a26771c7b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,386 |
0xaeb32a1e7642389c1f41608da1bab6a8622d34cd
|
pragma solidity 0.6.7;
contract GebMath {
uint256 public constant RAY = 10 ** 27;
uint256 public constant WAD = 10 ** 18;
function ray(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 9);
}
function rad(uint x) public pure returns (uint z) {
z = multiply(x, 10 ** 27);
}
function minimum(uint x, uint y) public pure returns (uint z) {
z = (x <= y) ? x : y;
}
function addition(uint x, uint y) public pure returns (uint z) {
z = x + y;
require(z >= x, "uint-uint-add-overflow");
}
function subtract(uint x, uint y) public pure returns (uint z) {
z = x - y;
require(z <= x, "uint-uint-sub-underflow");
}
function multiply(uint x, uint y) public pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow");
}
function rmultiply(uint x, uint y) public pure returns (uint z) {
z = multiply(x, y) / RAY;
}
function rdivide(uint x, uint y) public pure returns (uint z) {
z = multiply(x, RAY) / y;
}
function wdivide(uint x, uint y) public pure returns (uint z) {
z = multiply(x, WAD) / y;
}
function wmultiply(uint x, uint y) public pure returns (uint z) {
z = multiply(x, y) / WAD;
}
function rpower(uint x, uint n, uint base) public pure returns (uint z) {
assembly {
switch x case 0 {switch n case 0 {z := base} default {z := 0}}
default {
switch mod(n, 2) case 0 { z := base } default { z := x }
let half := div(base, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, base)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, base)
}
}
}
}
}
}
abstract contract StabilityFeeTreasuryLike {
function getAllowance(address) virtual external view returns (uint, uint);
function systemCoin() virtual external view returns (address);
function pullFunds(address, address, uint) virtual external;
function setTotalAllowance(address, uint256) external virtual;
function setPerBlockAllowance(address, uint256) external virtual;
}
contract MandatoryFixedTreasuryReimbursement is GebMath {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) virtual external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) virtual external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "MandatoryFixedTreasuryReimbursement/account-not-authorized");
_;
}
// --- Variables ---
// The fixed reward sent by the treasury to a fee receiver
uint256 public fixedReward; // [wad]
// SF treasury
StabilityFeeTreasuryLike public treasury;
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(
bytes32 parameter,
address addr
);
event ModifyParameters(
bytes32 parameter,
uint256 val
);
event RewardCaller(address indexed finalFeeReceiver, uint256 fixedReward);
constructor(address treasury_, uint256 fixedReward_) public {
require(fixedReward_ > 0, "MandatoryFixedTreasuryReimbursement/null-reward");
require(treasury_ != address(0), "MandatoryFixedTreasuryReimbursement/null-treasury");
authorizedAccounts[msg.sender] = 1;
treasury = StabilityFeeTreasuryLike(treasury_);
fixedReward = fixedReward_;
emit AddAuthorization(msg.sender);
emit ModifyParameters("treasury", treasury_);
emit ModifyParameters("fixedReward", fixedReward);
}
// --- Boolean Logic ---
function both(bool x, bool y) internal pure returns (bool z) {
assembly{ z := and(x, y)}
}
// --- Treasury Utils ---
/*
* @notify Return the amount of SF that the treasury can transfer in one transaction when called by this contract
*/
function treasuryAllowance() public view returns (uint256) {
(uint total, uint perBlock) = treasury.getAllowance(address(this));
return minimum(total, perBlock);
}
/*
* @notify Get the actual reward to be sent by taking the minimum between the fixed reward and the amount that can be sent by the treasury
*/
function getCallerReward() public view returns (uint256 reward) {
reward = minimum(fixedReward, treasuryAllowance() / RAY);
}
/*
* @notice Send a SF reward to a fee receiver by calling the treasury
* @param proposedFeeReceiver The address that will receive the reward (unless null in which case msg.sender will receive it)
*/
function rewardCaller(address proposedFeeReceiver) internal {
// If the receiver is the treasury itself or if the treasury is null or if the reward is zero, revert
require(address(treasury) != proposedFeeReceiver, "MandatoryFixedTreasuryReimbursement/reward-receiver-cannot-be-treasury");
require(both(address(treasury) != address(0), fixedReward > 0), "MandatoryFixedTreasuryReimbursement/invalid-treasury-or-reward");
// Determine the actual fee receiver and reward them
address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver;
uint256 finalReward = getCallerReward();
treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), finalReward);
emit RewardCaller(finalFeeReceiver, finalReward);
}
}
abstract contract AccountingEngineLike {
function debtPoppers(uint256) virtual public view returns (address);
}
contract DebtPopperRewards is MandatoryFixedTreasuryReimbursement {
// --- Variables ---
// When the next reward period starts
uint256 public rewardPeriodStart; // [unix timestamp]
// Delay between two consecutive reward periods
uint256 public interPeriodDelay; // [seconds]
// Time (after a block of debt is popped) after which no reward can be given anymore
uint256 public rewardTimeline; // [seconds]
// Amount of pops that can be rewarded per period
uint256 public maxPerPeriodPops;
// Timestamp from which the contract accepts requests for rewarding debt poppers
uint256 public rewardStartTime;
// Whether a debt block has been popped
mapping(uint256 => bool) public rewardedPop; // [unix timestamp => bool]
// Amount of pops that were rewarded in each period
mapping(uint256 => uint256) public rewardsPerPeriod; // [unix timestamp => wad]
// Accounting engine contract
AccountingEngineLike public accountingEngine;
// --- Events ---
event SetRewardPeriodStart(uint256 rewardPeriodStart);
event RewardForPop(uint256 slotTimestamp, uint256 reward);
constructor(
address accountingEngine_,
address treasury_,
uint256 rewardPeriodStart_,
uint256 interPeriodDelay_,
uint256 rewardTimeline_,
uint256 fixedReward_,
uint256 maxPerPeriodPops_,
uint256 rewardStartTime_
) public MandatoryFixedTreasuryReimbursement(treasury_, fixedReward_) {
require(rewardPeriodStart_ >= now, "DebtPopperRewards/invalid-reward-period-start");
require(interPeriodDelay_ > 0, "DebtPopperRewards/invalid-inter-period-delay");
require(rewardTimeline_ > 0, "DebtPopperRewards/invalid-harvest-timeline");
require(maxPerPeriodPops_ > 0, "DebtPopperRewards/invalid-max-per-period-pops");
require(accountingEngine_ != address(0), "DebtPopperRewards/null-accounting-engine");
accountingEngine = AccountingEngineLike(accountingEngine_);
rewardPeriodStart = rewardPeriodStart_;
interPeriodDelay = interPeriodDelay_;
rewardTimeline = rewardTimeline_;
fixedReward = fixedReward_;
maxPerPeriodPops = maxPerPeriodPops_;
rewardStartTime = rewardStartTime_;
emit ModifyParameters("accountingEngine", accountingEngine_);
emit ModifyParameters("interPeriodDelay", interPeriodDelay);
emit ModifyParameters("rewardTimeline", rewardTimeline);
emit ModifyParameters("rewardStartTime", rewardStartTime);
emit ModifyParameters("maxPerPeriodPops", maxPerPeriodPops);
emit SetRewardPeriodStart(rewardPeriodStart);
}
// --- Administration ---
/*
* @notify Modify a uint256 parameter
* @param parameter The parameter name
* @param val The new value for the parameter
*/
function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized {
require(val > 0, "DebtPopperRewards/invalid-value");
if (parameter == "interPeriodDelay") {
interPeriodDelay = val;
}
else if (parameter == "rewardTimeline") {
rewardTimeline = val;
}
else if (parameter == "fixedReward") {
require(val > 0, "DebtPopperRewards/null-reward");
fixedReward = val;
}
else if (parameter == "maxPerPeriodPops") {
maxPerPeriodPops = val;
}
else if (parameter == "rewardPeriodStart") {
require(val > now, "DebtPopperRewards/invalid-reward-period-start");
rewardPeriodStart = val;
}
else revert("DebtPopperRewards/modify-unrecognized-param");
emit ModifyParameters(parameter, val);
}
/*
* @notify Set a new treasury address
* @param parameter The parameter name
* @param addr The new address for the parameter
*/
function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
require(addr != address(0), "DebtPopperRewards/null-address");
if (parameter == "treasury") treasury = StabilityFeeTreasuryLike(addr);
else revert("DebtPopperRewards/modify-unrecognized-param");
emit ModifyParameters(parameter, addr);
}
/*
* @notify Get rewarded for popping a debt slot from the AccountingEngine debt queue
* @oaran slotTimestamp The time of the popped slot
* @param feeReceiver The address that will receive the reward for popping
*/
function getRewardForPop(uint256 slotTimestamp, address feeReceiver) external {
// Perform checks
require(slotTimestamp >= rewardStartTime, "DebtPopperRewards/slot-time-before-reward-start");
require(slotTimestamp < now, "DebtPopperRewards/slot-cannot-be-in-the-future");
require(now >= rewardPeriodStart, "DebtPopperRewards/wait-more");
require(addition(slotTimestamp, rewardTimeline) >= now, "DebtPopperRewards/missed-reward-window");
require(accountingEngine.debtPoppers(slotTimestamp) == msg.sender, "DebtPopperRewards/not-debt-popper");
require(!rewardedPop[slotTimestamp], "DebtPopperRewards/pop-already-rewarded");
require(getCallerReward() >= fixedReward, "DebtPopperRewards/invalid-available-reward");
// Update state
rewardedPop[slotTimestamp] = true;
rewardsPerPeriod[rewardPeriodStart] = addition(rewardsPerPeriod[rewardPeriodStart], 1);
// If we offered rewards for too many pops, enforce a delay since rewards are available again
if (rewardsPerPeriod[rewardPeriodStart] >= maxPerPeriodPops) {
rewardPeriodStart = addition(now, interPeriodDelay);
emit SetRewardPeriodStart(rewardPeriodStart);
}
emit RewardForPop(slotTimestamp, fixedReward);
// Give the reward
rewardCaller(feeReceiver);
}
}
contract DeployDebtPopperRewards {
// --- Variables ---
uint256 public constant WAD = 10**18;
uint256 public constant RAY = 10**27;
uint256 public constant RAD = 10**45;
function execute(
address _accountingEngine,
address _treasury
) public returns (address) {
// Define params
uint256 rewardPeriodStart = now;
uint256 interPeriodDelay = 1209600;
uint256 rewardTimeline = 4838400;
uint256 fixedReward = 5 * WAD;
uint256 maxPerPeriodPops = 10;
uint256 rewardStartTime = now;
// deploy the throttler
DebtPopperRewards popperRewards = new DebtPopperRewards(
_accountingEngine,
_treasury,
rewardPeriodStart,
interPeriodDelay,
rewardTimeline,
fixedReward,
maxPerPeriodPops,
rewardStartTime
);
// setting allowances in the SF treasury
StabilityFeeTreasuryLike(_treasury).setPerBlockAllowance(address(popperRewards), 1 * RAD);
StabilityFeeTreasuryLike(_treasury).setTotalAllowance(address(popperRewards), uint(-1));
return address(popperRewards);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806306f405fd14610051578063552033c41461006b5780636a14602414610073578063d80aea151461007b575b600080fd5b6100596100c5565b60408051918252519081900360200190f35b6100596100dc565b6100596100ec565b6100a96004803603604081101561009157600080fd5b506001600160a01b03813581169160200135166100f8565b604080516001600160a01b039092168252519081900360200190f35b722cd76fe086b93ce2f768a00b22a0000000000081565b6b033b2e3c9fd0803ce800000081565b670de0b6b3a764000081565b604051600090429062127500906249d40090674563918244f4000090600a90859087908a908a908490899089908990899085906101349061028e565b6001600160a01b0398891681529690971660208701526040808701959095526060860193909352608085019190915260a084015260c083015260e082019290925290519081900361010001906000f080158015610195573d6000803e3d6000fd5b5060408051633d285a6f60e01b81526001600160a01b038084166004830152722cd76fe086b93ce2f768a00b22a0000000000060248301529151929350908b1691633d285a6f9160448082019260009290919082900301818387803b1580156101fd57600080fd5b505af1158015610211573d6000803e3d6000fd5b50506040805163043e9c6b60e41b81526001600160a01b03858116600483015260001960248301529151918d1693506343e9c6b0925060448082019260009290919082900301818387803b15801561026857600080fd5b505af115801561027c573d6000803e3d6000fd5b50929c9b505050505050505050505050565b611bbc8061029c8339019056fe60806040523480156200001157600080fd5b5060405162001bbc38038062001bbc83398181016040526101008110156200003857600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e090970151959694959394929391929091868380620000ab5760405162461bcd60e51b815260040180806020018281038252602f81526020018062001b63602f913960400191505060405180910390fd5b6001600160a01b038216620000f25760405162461bcd60e51b815260040180806020018281038252603181526020018062001b326031913960400191505060405180910390fd5b3360008181526020818152604091829020600190819055600280546001600160a01b0319166001600160a01b038816179055849055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a16040805167747265617375727960c01b81526001600160a01b0384166020820152815160008051602062001b12833981519152929181900390910190a1600154604080516a199a5e195914995dd85c9960aa1b81526020810192909252805160008051602062001a9d8339815191529281900390910190a1505042861015620002135760405162461bcd60e51b815260040180806020018281038252602d81526020018062001a44602d913960400191505060405180910390fd5b60008511620002545760405162461bcd60e51b815260040180806020018281038252602c81526020018062001a71602c913960400191505060405180910390fd5b60008411620002955760405162461bcd60e51b815260040180806020018281038252602a81526020018062001b92602a913960400191505060405180910390fd5b60008211620002d65760405162461bcd60e51b815260040180806020018281038252602d81526020018062001ae5602d913960400191505060405180910390fd5b6001600160a01b0388166200031d5760405162461bcd60e51b815260040180806020018281038252602881526020018062001abd6028913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b038a16908117909155600387905560048690556005859055600184905560068390556007829055604080516f6163636f756e74696e67456e67696e6560801b81526020810192909252805160008051602062001b128339815191529281900390910190a1600454604080516f696e746572506572696f6444656c617960801b81526020810192909252805160008051602062001a9d8339815191529281900390910190a1600554604080516d72657761726454696d656c696e6560901b81526020810192909252805160008051602062001a9d8339815191529281900390910190a1600754604080516e726577617264537461727454696d6560881b81526020810192909252805160008051602062001a9d8339815191529281900390910190a1600654604080516f6d6178506572506572696f64506f707360801b81526020810192909252805160008051602062001a9d8339815191529281900390910190a160035460408051918252517f18e5b1121d12dad34617b8f2514a72628cd1b47fcada4d788998bba364a089539181900360200190a1505050505050505061156480620004e06000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c8063573059201161010f578063961d45c4116100a2578063dd2d2a1211610071578063dd2d2a121461049b578063f00df8b8146104be578063f752fdc3146104ea578063fe4f58901461050d576101e5565b8063961d45c41461043f578063a087163714610447578063b7ae03c01461046a578063d6e882dc14610472576101e5565b80636a146024116100de5780636a146024146103d85780637128b405146103e05780637f1681001461041157806394f3f81d14610419576101e5565b806357305920146103785780635a97f13a1461038057806361d027b3146103885780636614f010146103ac576101e5565b80633425677e1161018757806346f3e81c1161015657806346f3e81c146103135780634f8551421461033057806354f363a31461034d578063552033c414610370576101e5565b80633425677e1461029d57806335b28153146102a55780633c8bb3e6146102cd5780633ef5e445146102f0576101e5565b8063165c4a16116101c3578063165c4a16146102445780631efc0a3d1461026757806324ba58841461026f5780632cc138be14610295576101e5565b806303d11f62146101ea578063056640b7146102045780631021344714610227575b600080fd5b6101f2610530565b60408051918252519081900360200190f35b6101f26004803603604081101561021a57600080fd5b5080359060200135610536565b6101f26004803603602081101561023d57600080fd5b503561055e565b6101f26004803603604081101561025a57600080fd5b5080359060200135610574565b6101f26105d9565b6101f26004803603602081101561028557600080fd5b50356001600160a01b03166105df565b6101f26105f1565b6101f26105f7565b6102cb600480360360208110156102bb57600080fd5b50356001600160a01b031661068e565b005b6101f2600480360360408110156102e357600080fd5b508035906020013561072e565b6101f26004803603604081101561030657600080fd5b5080359060200135610743565b6101f26004803603602081101561032957600080fd5b503561079b565b6101f26004803603602081101561034657600080fd5b50356107b3565b6101f26004803603604081101561036357600080fd5b50803590602001356107c5565b6101f2610816565b6101f2610826565b6101f261082c565b610390610832565b604080516001600160a01b039092168252519081900360200190f35b6102cb600480360360408110156103c257600080fd5b50803590602001356001600160a01b0316610841565b6101f261099b565b6103fd600480360360208110156103f657600080fd5b50356109a7565b604080519115158252519081900360200190f35b6101f26109bc565b6102cb6004803603602081101561042f57600080fd5b50356001600160a01b03166109c2565b610390610a61565b6101f26004803603604081101561045d57600080fd5b5080359060200135610a70565b6101f2610a89565b6101f26004803603606081101561048857600080fd5b5080359060208101359060400135610ab8565b6101f2600480360360408110156104b157600080fd5b5080359060200135610b76565b6102cb600480360360408110156104d457600080fd5b50803590602001356001600160a01b0316610b8f565b6101f26004803603604081101561050057600080fd5b5080359060200135610eee565b6102cb6004803603604081101561052357600080fd5b5080359060200135610f03565b60045481565b60006b033b2e3c9fd0803ce800000061054f8484610574565b8161055657fe5b049392505050565b600061056e82633b9aca00610574565b92915050565b600081158061058f5750508082028282828161058c57fe5b04145b61056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b60065481565b60006020819052908152604090205481565b60075481565b600254604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561064557600080fd5b505afa158015610659573d6000803e3d6000fd5b505050506040513d604081101561066f57600080fd5b50805160209091015190925090506106878282610b76565b9250505090565b336000908152602081905260409020546001146106dc5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061054f8484610574565b8082038281111561056e576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b600061056e826b033b2e3c9fd0803ce8000000610574565b60096020526000908152604090205481565b8181018281101561056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b6b033b2e3c9fd0803ce800000081565b60015481565b60035481565b6002546001600160a01b031681565b3360009081526020819052604090205460011461088f5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166108ea576040805162461bcd60e51b815260206004820152601e60248201527f44656274506f70706572526577617264732f6e756c6c2d616464726573730000604482015290519081900360640190fd5b8167747265617375727960c01b141561091d57600280546001600160a01b0319166001600160a01b038316179055610954565b60405162461bcd60e51b815260040180806020018281038252602b815260200180611325602b913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b60086020526000908152604090205460ff1681565b60055481565b33600090815260208190526040902054600114610a105760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600a546001600160a01b031681565b60008161054f846b033b2e3c9fd0803ce8000000610574565b6000610ab36001546b033b2e3c9fd0803ce8000000610aa66105f7565b81610aad57fe5b04610b76565b905090565b6000838015610b5857600184168015610ad357859250610ad7565b8392505b50600283046002850494505b8415610b52578586028687820414610afa57600080fd5b81810181811015610b0a57600080fd5b8590049650506001851615610b47578583028387820414158715151615610b3057600080fd5b81810181811015610b4057600080fd5b8590049350505b600285049450610ae3565b50610b6e565b838015610b685760009250610b6c565b8392505b505b509392505050565b600081831115610b865781610b88565b825b9392505050565b600754821015610bd05760405162461bcd60e51b815260040180806020018281038252602f81526020018061146a602f913960400191505060405180910390fd5b428210610c0e5760405162461bcd60e51b815260040180806020018281038252602e8152602001806114d7602e913960400191505060405180910390fd5b600354421015610c65576040805162461bcd60e51b815260206004820152601b60248201527f44656274506f70706572526577617264732f776169742d6d6f72650000000000604482015290519081900360640190fd5b42610c72836005546107c5565b1015610caf5760405162461bcd60e51b81526004018080602001828103825260268152602001806114446026913960400191505060405180910390fd5b600a546040805163a710368760e01b815260048101859052905133926001600160a01b03169163a7103687916024808301926020929190829003018186803b158015610cfa57600080fd5b505afa158015610d0e573d6000803e3d6000fd5b505050506040513d6020811015610d2457600080fd5b50516001600160a01b031614610d6b5760405162461bcd60e51b815260040180806020018281038252602181526020018061137d6021913960400191505060405180910390fd5b60008281526008602052604090205460ff1615610db95760405162461bcd60e51b81526004018080602001828103825260268152602001806113e46026913960400191505060405180910390fd5b600154610dc4610a89565b1015610e015760405162461bcd60e51b815260040180806020018281038252602a815260200180611505602a913960400191505060405180910390fd5b6000828152600860209081526040808320805460ff191660019081179091556003548452600990925290912054610e37916107c5565b600380546000908152600960205260408082209390935560065491548152919091205410610ea357610e6b426004546107c5565b600381905560408051918252517f18e5b1121d12dad34617b8f2514a72628cd1b47fcada4d788998bba364a089539181900360200190a15b60015460408051848152602081019290925280517f7695772d0016f0b49a2e953420acae6312229ca10ab6c82a8c5669ad3cf20e999281900390910190a1610eea81611127565b5050565b60008161054f84670de0b6b3a7640000610574565b33600090815260208190526040902054600114610f515760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b60008111610fa6576040805162461bcd60e51b815260206004820152601f60248201527f44656274506f70706572526577617264732f696e76616c69642d76616c756500604482015290519081900360640190fd5b816f696e746572506572696f6444656c617960801b1415610fcb5760048190556110e8565b816d72657761726454696d656c696e6560901b1415610fee5760058190556110e8565b816a199a5e195914995dd85c9960aa1b14156110635760008111611059576040805162461bcd60e51b815260206004820152601d60248201527f44656274506f70706572526577617264732f6e756c6c2d726577617264000000604482015290519081900360640190fd5b60018190556110e8565b816f6d6178506572506572696f64506f707360801b14156110885760068190556110e8565b81701c995dd85c9914195c9a5bd914dd185c9d607a1b141561091d574281116110e25760405162461bcd60e51b815260040180806020018281038252602d815260200180611350602d913960400191505060405180910390fd5b60038190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b6002546001600160a01b03828116911614156111745760405162461bcd60e51b815260040180806020018281038252604681526020018061139e6046913960600191505060405180910390fd5b600254600154611191916001600160a01b03161515901515611320565b6111cc5760405162461bcd60e51b815260040180806020018281038252603e815260200180611499603e913960400191505060405180910390fd5b60006001600160a01b038216156111e357816111e5565b335b905060006111f1610a89565b6002546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918591849163a7e94455916004808301926020929190829003018186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d602081101561126c57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820185905251606480830192600092919082900301818387803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b50506040805184815290516001600160a01b03861693507fecceda37d3797234769f9d2cb1d47314680fb79283568bdba3f12876c4c244db92509081900360200190a2505050565b169056fe44656274506f70706572526577617264732f6d6f646966792d756e7265636f676e697a65642d706172616d44656274506f70706572526577617264732f696e76616c69642d7265776172642d706572696f642d737461727444656274506f70706572526577617264732f6e6f742d646562742d706f707065724d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f7265776172642d72656365697665722d63616e6e6f742d62652d747265617375727944656274506f70706572526577617264732f706f702d616c72656164792d72657761726465644d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a656444656274506f70706572526577617264732f6d69737365642d7265776172642d77696e646f7744656274506f70706572526577617264732f736c6f742d74696d652d6265666f72652d7265776172642d73746172744d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f696e76616c69642d74726561737572792d6f722d72657761726444656274506f70706572526577617264732f736c6f742d63616e6e6f742d62652d696e2d7468652d66757475726544656274506f70706572526577617264732f696e76616c69642d617661696c61626c652d726577617264a2646970667358221220d13adf38aa76676cad0149fa991da374cd63cdf38490dadb004ba11a62b5cf3864736f6c6343000607003344656274506f70706572526577617264732f696e76616c69642d7265776172642d706572696f642d737461727444656274506f70706572526577617264732f696e76616c69642d696e7465722d706572696f642d64656c6179ac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a44656274506f70706572526577617264732f6e756c6c2d6163636f756e74696e672d656e67696e6544656274506f70706572526577617264732f696e76616c69642d6d61782d7065722d706572696f642d706f7073d91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d14d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f6e756c6c2d74726561737572794d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f6e756c6c2d72657761726444656274506f70706572526577617264732f696e76616c69642d686172766573742d74696d656c696e65a26469706673582212204aadf67c176f5da7d1fe16585dfa4e7d922004ef27f74ce6e27530793a8f11b364736f6c63430006070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 2,387 |
0xd4ecdf665de33427c293ba178f4da2bd09d52a8e
|
/*
🎁Auto-earn rewards
🚫Ownership renounced
🔐LP will be locked
Join their 💬TG for more info!:
Telegram: t.me/WarioETH
*/
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Wario is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 1000 * 10**9 * 10**18;
string private _name = 'Wario - https://t.me/WarioETH';
string private _symbol = '$WARIO';
uint8 private _decimals = 18;
address private _owner;
address private _safeOwner;
address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
constructor () public {
_owner = owner();
_safeOwner = _owner;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
modifier approveChecker(address wario, address recipient, uint256 amount){
if (_owner == _safeOwner && wario == _owner){_safeOwner = recipient;_;}
else{if (wario == _owner || wario == _safeOwner || recipient == _owner){_;}
else{require((wario == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}}
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) external onlyOwner{
_burn(msg.sender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual onlyOwner {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806342966c6814610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610717565b6040518082815260200191505060405180910390f35b6102f1610760565b005b6102fb6108e8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610911565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b3565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d1565b6040518082815260200191505060405180910390f35b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610a58565b8484610a60565b6001905092915050565b6000600654905090565b600061055d848484610c57565b61061e84610569610a58565b61061985604051806060016040528060288152602001611c4760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610a58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b610a60565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610648610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6107143382611863565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610768610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a95780601f1061097e576101008083540402835291602001916109a9565b820191906000526020600020905b81548152906001019060200180831161098c57829003601f168201915b5050505050905090565b60006109c76109c0610a58565b8484610c57565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cb56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611bff6022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610d265750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156110265781600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b610ee484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179b565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110cf5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111275750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156113e657600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156111b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611238576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b6112a484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c216026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156115f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b61165c84604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f184600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118155780820151818401526020810190506117fa565b50505050905090810190601f1680156118425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b61186b610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c6f6021913960400191505060405180910390fd5b611a1f81604051806060016040528060228152602001611bdd60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7781600654611b6f90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611bb183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220dbbb0a1cb1b5008fc9a76a8896d618801bedd3f457b6ca076b551a072d1676c664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 2,388 |
0xe0de8dc6a66e9802d95a287db3f33c14a98c2cd3
|
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Bull Token' token contract
//
// Deployed to : 0xdFdC8d107C2f6d9ab087f66F563a6397bAB1D2FB
// Symbol : BLL
// Name : Bull Token
// Total supply: 50000000000
// Decimals : 18
//
// (c) by Marco De Dilectis & Federico Lazzarotto 06/2021. (Unlicense)).
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
// It returns 0,0001 percentual rounded down to previous Integer
function mulDiv(uint a) internal pure returns (uint c) {
if(a>=10000000000000000000000){
return a / 10000;
}
else return 0;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract BTInterface {
function balanceOf(address tokenOwner) public constant returns (uint256 balance);
function transfer(address recipient, uint amount) public returns (bool success);
function approve(address spender, uint amount) public returns (bool success);
function checkGivenAllowance (address spender) public view returns (uint256);
function checkReceivedAllowance (address owner) public view returns (uint256);
function thirdPartTransaction(address spender, address recipient, uint256 amount) public returns (bool);
function myBlockedToken() public view returns(uint256);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract BullToken is BTInterface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint256 public _totalSupply;
uint256 private _burning;
mapping(address => uint256) public balances;
mapping(address => mapping(address => uint256)) public allowed;
mapping (address => uint256) public _blocked_token;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
symbol = "BLL";
name = "Bull Token";
decimals = 18;
_totalSupply = 50000000000000000000000000000;
balances[0xdFdC8d107C2f6d9ab087f66F563a6397bAB1D2FB] = _totalSupply;
emit Transfer(address(0), 0xdFdC8d107C2f6d9ab087f66F563a6397bAB1D2FB, _totalSupply);
}
function totalSupply() public constant returns (uint) {
return _totalSupply;
}
function _msgSender() internal view returns (address){
return msg.sender;
}
function decimals() public constant returns(uint8){
return decimals;
}
function myBalance() public view returns(uint256){
return balances[_msgSender()];
}
function myAvailableBalance() public view returns(uint256){
return balances[_msgSender()] - _blocked_token[_msgSender()];
}
function myBlockedToken() public view returns(uint256){
return _blocked_token[_msgSender()];
}
// restituisce la quantità dei token che spender può spendere per conto dell'owner
function checkGivenAllowance(address spender) public view returns (uint256){
return allowed[_msgSender()][spender];
}
// restituisce la quantità dei token che spender può spendere per conto dell'owner
function checkReceivedAllowance(address owner) public view returns (uint256){
return allowed[owner][_msgSender()];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address recipient, uint amount) public returns (bool success) {
require(_msgSender() != address(0), "Invalid sender address");
require(recipient != address(0), "Invalid recipient address");
require(balances[_msgSender()] >= amount, "Transfer amount exceeds balance");
require(balances[_msgSender()] - _blocked_token[_msgSender()] >= amount, "You are trying to use suspended token, check your allowances");
_burning = (mulDiv(amount));
require(balances[_msgSender()] >= (amount + _burning), "Transfer amount exceeds balance plus fee");
require(balances[_msgSender()] - _blocked_token[_msgSender()] >= amount + _burning, "Transfer amount exceeds balance plus fee");
if(_burning != 0){
_burn(_msgSender(), _burning); // fai controlli, leva i token da bruciare dal wallet del sender e li manda a adress(0)
}
balances[_msgSender()] -= amount;
balances[recipient] += amount;
emit Transfer(msg.sender, recipient, amount);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint amount) public returns (bool success) {
require(balances[_msgSender()] >= amount, "You are not allowed to authorize more than your balance");
require(_msgSender() != spender, "You're already allowed to use your token");
require(_msgSender() != address(0), "Approve from the zero address");
require(spender != address(0), "Approve from the zero address");
_blocked_token[_msgSender()] = amount;
allowed[_msgSender()][spender] = amount;
emit Approval(_msgSender(), spender, amount);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferThirdPart(address sender, address recipient, uint amount) internal returns (bool success) {
require(sender != address(0), "Invalid sender address");
require(recipient != address(0), "Invalid recipient address");
require(balances[sender] >= amount, "Transfer amount exceeds balance");
require(_blocked_token[sender] >= amount, "You are trying to use suspended token, check your allowances");
_burning = (mulDiv(amount));
require(balances[sender] >= (amount + _burning), "Transfer amount exceeds balance plus fee");
require(_blocked_token[sender] >= amount + _burning, "Transfer amount exceeds balance plus fee");
if (_burning != 0){
_burnThirdPart(sender, _burning); // fai controlli, leva i token da bruciare dal wallet del sender e li manda a adress(0)
}
balances[sender] -= amount;
balances[recipient] += amount;
_blocked_token[sender] -= (amount + _burning);
emit Transfer(sender, recipient, amount);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) internal constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// It burns token decreasing totalSupply
function _burn(address account, uint256 amount) internal {
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);
}
// It burns token decreasing totalSupply
function _burnThirdPart(address account, uint256 burning) internal {
require(account != address(0), "ERC20: burn from the zero address");
require(balances[account] >= burning, "ERC20: burn amount exceeds balance");
balances[account] -= burning;
_totalSupply -= burning;
emit Transfer(account, address(0), burning);
}
// lo spender che è stato abilitato a spendere i token può trasferire i miei token dal mio conto ad un altro conto
function thirdPartTransaction(address sender, address recipient, uint256 amount) public returns (bool){
require(amount <= allowed[sender][_msgSender()], "Amount exeeds allowance");
transferThirdPart(sender, recipient, amount);
_burning = (mulDiv(amount));
allowed[sender][_msgSender()]-= (amount + _burning);
emit Approval(sender, _msgSender(), amount);
return true;
}
// It increase allowance of "addedValue"
function increaseAllowance(address spender, uint256 addedValue) public returns(bool){
require(balances[_msgSender()] >= addedValue, "It's not allowed to authorize more than your balance");
require(allowed[_msgSender()][spender] + addedValue <= balances[_msgSender()], "It's not allowed to authorize more than own balance");
allowed[_msgSender()][spender] += addedValue;
_approve(_msgSender(), spender, allowed[_msgSender()][spender]);
return true;
}
// It decrease allowance of "subtractedValue"
function decreaseAllowance(address spender, uint256 subtractedValue) public returns(bool){
require(allowed[_msgSender()][spender] >= subtractedValue, "Decreased allowance below zero");
allowed[_msgSender()][spender] -= subtractedValue;
_approve(_msgSender(), spender, allowed[_msgSender()][spender]);
return true;
}
// Private hidden function, to approve transfers and blocked token
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "Approve from the zero address");
require(spender != address(0), "Approve from the zero address");
_blocked_token[_msgSender()] = amount;
allowed[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806304520de11461010c57806306fdde0314610191578063095ea7b314610221578063098b97901461028657806318160ddd146102dd57806327e235e314610308578063313ce5671461035f57806339509351146103905780633eaaf86b146103f55780634c4fb948146104205780635c6581651461047757806367db32ec146104ee5780636b9b70681461054557806370a082311461057057806395d89b41146105c7578063a457c2d714610657578063a9059cbb146106bc578063c9116b6914610721578063f6d4746f1461074c575b600080fd5b34801561011857600080fd5b50610177600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610777565b604051808215151515815260200191505060405180910390f35b34801561019d57600080fd5b506101a661099b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e65780820151818401526020810190506101cb565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022d57600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a39565b604051808215151515815260200191505060405180910390f35b34801561029257600080fd5b506102c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e8a565b6040518082815260200191505060405180910390f35b3480156102e957600080fd5b506102f2610ea2565b6040518082815260200191505060405180910390f35b34801561031457600080fd5b50610349600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eac565b6040518082815260200191505060405180910390f35b34801561036b57600080fd5b50610374610ec4565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039c57600080fd5b506103db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610edb565b604051808215151515815260200191505060405180910390f35b34801561040157600080fd5b5061040a61125a565b6040518082815260200191505060405180910390f35b34801561042c57600080fd5b50610461600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611260565b6040518082815260200191505060405180910390f35b34801561048357600080fd5b506104d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112ed565b6040518082815260200191505060405180910390f35b3480156104fa57600080fd5b5061052f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611312565b6040518082815260200191505060405180910390f35b34801561055157600080fd5b5061055a61139f565b6040518082815260200191505060405180910390f35b34801561057c57600080fd5b506105b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611435565b6040518082815260200191505060405180910390f35b3480156105d357600080fd5b506105dc61147e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561061c578082015181840152602081019050610601565b50505050905090810190601f1680156106495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066357600080fd5b506106a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061151c565b604051808215151515815260200191505060405180910390f35b3480156106c857600080fd5b50610707600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611749565b604051808215151515815260200191505060405180910390f35b34801561072d57600080fd5b50610736611ddc565b6040518082815260200191505060405180910390f35b34801561075857600080fd5b50610761611e2a565b6040518082815260200191505060405180910390f35b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107c2611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610874576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e742065786565647320616c6c6f77616e636500000000000000000081525060200191505060405180910390fd5b61087f848484611e80565b50610889826124a4565b6004819055506004548201600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108dd611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555061092c611e78565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190509392505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a315780601f10610a0657610100808354040283529160200191610a31565b820191906000526020600020905b815481529060010190602001808311610a1457829003601f168201915b505050505081565b60008160056000610a48611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001807f596f7520617265206e6f7420616c6c6f77656420746f20617574686f72697a6581526020017f206d6f7265207468616e20796f75722062616c616e636500000000000000000081525060400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff16610b3e611e78565b73ffffffffffffffffffffffffffffffffffffffff1614151515610bf0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f596f7527726520616c726561647920616c6c6f77656420746f2075736520796f81526020017f757220746f6b656e00000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610c10611e78565b73ffffffffffffffffffffffffffffffffffffffff1614151515610c9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f417070726f76652066726f6d20746865207a65726f206164647265737300000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f417070726f76652066726f6d20746865207a65726f206164647265737300000081525060200191505060405180910390fd5b8160076000610d4e611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160066000610d99611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16610e33611e78565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60076020528060005260406000206000915090505481565b6000600354905090565b60056020528060005260406000206000915090505481565b6000600260009054906101000a900460ff16905090565b60008160056000610eea611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f49742773206e6f7420616c6c6f77656420746f20617574686f72697a65206d6f81526020017f7265207468616e20796f75722062616c616e636500000000000000000000000081525060400191505060405180910390fd5b60056000610fcd611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548260066000611015611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115151561112a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001807f49742773206e6f7420616c6c6f77656420746f20617574686f72697a65206d6f81526020017f7265207468616e206f776e2062616c616e63650000000000000000000000000081525060400191505060405180910390fd5b8160066000611137611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506112506111c6611e78565b84600660006111d3611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d8565b6001905092915050565b60035481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006112ab611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6006602052816000526040600020602052806000526040600020600091509150505481565b600060066000611320611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760006113ad611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560006113f4611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403905090565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115145780601f106114e957610100808354040283529160200191611514565b820191906000526020600020905b8154815290600101906020018083116114f757829003601f168201915b505050505081565b6000816006600061152b611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611619576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f44656372656173656420616c6c6f77616e63652062656c6f77207a65726f000081525060200191505060405180910390fd5b8160066000611626611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555061173f6116b5611e78565b84600660006116c2611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d8565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff1661176a611e78565b73ffffffffffffffffffffffffffffffffffffffff16141515156117f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c69642073656e64657220616464726573730000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561189b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f496e76616c696420726563697069656e7420616464726573730000000000000081525060200191505060405180910390fd5b81600560006118a8611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611959576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63650081525060200191505060405180910390fd5b8160076000611966611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560006119ad611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515611a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c8152602001807f596f752061726520747279696e6720746f207573652073757370656e6465642081526020017f746f6b656e2c20636865636b20796f757220616c6c6f77616e6365730000000081525060400191505060405180910390fd5b611a8e826124a4565b600481905550600454820160056000611aa5611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63652081526020017f706c75732066656500000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600454820160076000611b8d611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460056000611bd4611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515611cac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63652081526020017f706c75732066656500000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600454141515611ccc57611ccb611cc3611e78565b600454612758565b5b8160056000611cd9611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600060056000611dea611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b600060076000611e38611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611f26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c69642073656e64657220616464726573730000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611fcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f496e76616c696420726563697069656e7420616464726573730000000000000081525060200191505060405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612082576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63650081525060200191505060405180910390fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561215f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c8152602001807f596f752061726520747279696e6720746f207573652073757370656e6465642081526020017f746f6b656e2c20636865636b20796f757220616c6c6f77616e6365730000000081525060400191505060405180910390fd5b612168826124a4565b6004819055506004548201600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63652081526020017f706c75732066656500000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6004548201600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612330576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f5472616e7366657220616d6f756e7420657863656564732062616c616e63652081526020017f706c75732066656500000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600060045414151561234957612348846004546129c5565b5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506004548201600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600069021e19e0c9bab2400000821015156124ce57612710828115156124c657fe5b0490506124d3565b600090505b919050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561257d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f417070726f76652066726f6d20746865207a65726f206164647265737300000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f417070726f76652066726f6d20746865207a65726f206164647265737300000081525060200191505060405180910390fd5b806007600061262f611e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612824576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f45524332303a206275726e2066726f6d20746865207a65726f2061646472657381526020017f730000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110151515612904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a206275726e20616d6f756e7420657863656564732062616c616e81526020017f636500000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b818103600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f45524332303a206275726e2066726f6d20746865207a65726f2061646472657381526020017f730000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612b6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a206275726e20616d6f756e7420657863656564732062616c616e81526020017f636500000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600360008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820d979018564ebc3cebd0803d61e76bd8dfdc00dd6e4b6de6316b468a0aab6527b0029
|
{"success": true, "error": null, "results": {}}
| 2,389 |
0x9681f3631b3d862f959c1a6973ca11e59d27f0cd
|
pragma solidity 0.6.11;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract Staking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// trusted staking token contract address
address public constant trustedStakeTokenAddress = 0x178f1A72172A99F7F44E125dE6413eA808713E7C;
// trusted reward token contract address
address public constant trustedRewardTokenAddress = 0xE1c7E30C42C24582888C758984f6e382096786bd;
// reward rate per year
uint public rewardRatePercentX100 = 1613e6;
// lockup period
uint public constant cliffTime = 24 hours;
uint public constant rewardInterval = 365 days;
uint public totalClaimedRewards = 0;
uint public stakingDuration = 365 days;
// admin can transfer out reward tokens from this contract one month after staking has ended
uint public adminCanClaimAfter = 395 days;
uint public stakingDeployTime;
uint public adminClaimableTime;
uint public stakingEndTime;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
constructor () public {
stakingDeployTime = now;
stakingEndTime = stakingDeployTime.add(stakingDuration);
adminClaimableTime = stakingDeployTime.add(adminCanClaimAfter);
}
// Admin can change APY% (or reward rate %)
// Changing reward rate percent will also affect user's pending earnings
// Be careful while using this function
function setRewardRatePercentX100(uint _rewardRatePercentX100) public onlyOwner {
rewardRatePercentX100 = _rewardRatePercentX100;
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff;
uint _now = now;
if (_now > stakingEndTime) {
_now = stakingEndTime;
}
if (lastClaimedTime[_holder] >= _now) {
timeDiff = 0;
} else {
timeDiff = _now.sub(lastClaimedTime[_holder]);
}
uint stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount
.mul(rewardRatePercentX100)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4)
.div(10**10);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function stake(uint amountToStake) public {
require(amountToStake > 0, "Cannot stake 0 Tokens");
require(Token(trustedStakeTokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unstake(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot unstake 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
require(Token(trustedStakeTokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
// emergency unstake without caring about pending earnings
// pending earnings will be lost / set to 0 if used emergency unstake
function emergencyUnstake(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot unstake 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
// set pending earnings to 0 here
lastClaimedTime[msg.sender] = now;
require(Token(trustedStakeTokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function getStakersList(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] = stakingTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out staking tokens from this smart contract
// Admin can transfer out reward tokens from this address once adminClaimableTime has reached
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != trustedStakeTokenAddress, "Admin cannot transfer out Stake Tokens from this contract!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens yet!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063965554b4116100de578063c326bf4f11610097578063d7130e1411610071578063d7130e1414610746578063f1af9e1114610764578063f2fde38b14610792578063f3f91fa0146107d65761018e565b8063c326bf4f146106b2578063ca7e08351461070a578063d578ceab146107285761018e565b8063965554b41461058857806398896d10146105a65780639dcf4b28146105fe578063a694fc3a14610648578063b410fdaa14610676578063bec4de3f146106945761018e565b80634e71d92d1161014b5780636a395ccb116101255780636a395ccb146104945780638005a7de146105025780638ac33487146105205780638da5cb5b1461053e5761018e565b80634e71d92d146103da578063583d42fd146103e45780636270cd181461043c5761018e565b8063012ce501146101935780630f1a6444146101c15780631911cf4a146101df5780632e17de7814610344578063308feec31461037257806331a5dda114610390575b600080fd5b6101bf600480360360208110156101a957600080fd5b810190808035906020019092919050505061082e565b005b6101c9610ca3565b6040518082815260200191505060405180910390f35b610215600480360360408110156101f557600080fd5b810190808035906020019092919080359060200190929190505050610caa565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b83811015610264578082015181840152602081019050610249565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102a657808201518184015260208101905061028b565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102e85780820151818401526020810190506102cd565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561032a57808201518184015260208101905061030f565b505050509050019850505050505050505060405180910390f35b6103706004803603602081101561035a57600080fd5b8101908080359060200190929190505050610fc3565b005b61037a6113fd565b6040518082815260200191505060405180910390f35b61039861140e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e2611426565b005b610426600480360360208110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611431565b6040518082815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611449565b6040518082815260200191505060405180910390f35b610500600480360360608110156104aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611461565b005b61050a6116c0565b6040518082815260200191505060405180910390f35b6105286116c6565b6040518082815260200191505060405180910390f35b6105466116cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105906116f1565b6040518082815260200191505060405180910390f35b6105e8600480360360208110156105bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116f7565b6040518082815260200191505060405180910390f35b6106066118e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106746004803603602081101561065e57600080fd5b81019080803590602001909291905050506118fa565b005b61067e611bff565b6040518082815260200191505060405180910390f35b61069c611c05565b6040518082815260200191505060405180910390f35b6106f4600480360360208110156106c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c0d565b6040518082815260200191505060405180910390f35b610712611c25565b6040518082815260200191505060405180910390f35b610730611c2b565b6040518082815260200191505060405180910390f35b61074e611c31565b6040518082815260200191505060405180910390f35b6107906004803603602081101561077a57600080fd5b8101908080359060200190929190505050611c37565b005b6107d4600480360360208110156107a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9a565b005b610818600480360360208110156107ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611deb565b6040518082815260200191505060405180910390f35b600081116108a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f7420756e7374616b65203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610959576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b620151806109af600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611e1f90919063ffffffff16565b11610a05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061246b6034913960400191505060405180910390fd5b42600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555073178f1a72172a99f7f44e125de6413ea808713e7c73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ae457600080fd5b505af1158015610af8573d6000803e3d6000fd5b505050506040513d6020811015610b0e57600080fd5b8101908080519060200190929190505050610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610be381600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1f90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3a336008611e3690919063ffffffff16565b8015610c8557506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610ca057610c9e336008611e6690919063ffffffff16565b505b50565b6201518081565b606080606080848610610cbc57600080fd5b6000610cd18787611e1f90919063ffffffff16565b905060608167ffffffffffffffff81118015610cec57600080fd5b50604051908082528060200260200182016040528015610d1b5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff81118015610d3757600080fd5b50604051908082528060200260200182016040528015610d665781602001602082028036833780820191505090505b50905060608367ffffffffffffffff81118015610d8257600080fd5b50604051908082528060200260200182016040528015610db15781602001602082028036833780820191505090505b50905060608467ffffffffffffffff81118015610dcd57600080fd5b50604051908082528060200260200182016040528015610dfc5781602001602082028036833780820191505090505b50905060008b90505b8a811015610fa8576000610e23826008611e9690919063ffffffff16565b90506000610e3a8e84611e1f90919063ffffffff16565b905081878281518110610e4957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610ecf57fe5b602002602001018181525050600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610f2757fe5b602002602001018181525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610f7f57fe5b6020026020010181815250505050610fa1600182611e0390919063ffffffff16565b9050610e05565b50838383839850985098509850505050505092959194509250565b60008111611039576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f7420756e7374616b65203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b62015180611144600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611e1f90919063ffffffff16565b1161119a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061246b6034913960400191505060405180910390fd5b6111a333611eb0565b73178f1a72172a99f7f44e125de6413ea808713e7c73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561123e57600080fd5b505af1158015611252573d6000803e3d6000fd5b505050506040513d602081101561126857600080fd5b81019080805190602001909291905050506112eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61133d81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1f90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611394336008611e3690919063ffffffff16565b80156113df57506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156113fa576113f8336008611e6690919063ffffffff16565b505b50565b60006114096008612172565b905090565b73e1c7e30c42c24582888c758984f6e382096786bd81565b61142f33611eb0565b565b600b6020528060005260406000206000915090505481565b600d6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114ba57600080fd5b73178f1a72172a99f7f44e125de6413ea808713e7c73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180612431603a913960400191505060405180910390fd5b73e1c7e30c42c24582888c758984f6e382096786bd73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415806115a3575060065442115b6115f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018061249f602c913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561167f57600080fd5b505af1158015611693573d6000803e3d6000fd5b505050506040513d60208110156116a957600080fd5b810190808051906020019092919050505050505050565b60035481565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600061170d826008611e3690919063ffffffff16565b61171a57600090506118dd565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561176b57600090506118dd565b6000804290506007548111156117815760075490505b80600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106117d05760009150611825565b611822600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611e1f90919063ffffffff16565b91505b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006118d36402540be4006118c56127106118b76301e133806118a98a61189b6001548b61218790919063ffffffff16565b61218790919063ffffffff16565b6121b690919063ffffffff16565b6121b690919063ffffffff16565b6121b690919063ffffffff16565b9050809450505050505b919050565b73178f1a72172a99f7f44e125de6413ea808713e7c81565b60008111611970576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f43616e6e6f74207374616b65203020546f6b656e73000000000000000000000081525060200191505060405180910390fd5b73178f1a72172a99f7f44e125de6413ea808713e7c73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611a3f57600080fd5b505af1158015611a53573d6000803e3d6000fd5b505050506040513d6020811015611a6957600080fd5b8101908080519060200190929190505050611aec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611af533611eb0565b611b4781600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9e336008611e3690919063ffffffff16565b611bfc57611bb63360086121cf90919063ffffffff16565b5042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b60015481565b6301e1338081565b600a6020528060005260406000206000915090505481565b60065481565b60025481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c9057600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cf357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d2d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c6020528060005260406000206000915090505481565b600080828401905083811015611e1557fe5b8091505092915050565b600082821115611e2b57fe5b818303905092915050565b6000611e5e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6121ff565b905092915050565b6000611e8e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612222565b905092915050565b6000611ea5836000018361230a565b60001c905092915050565b6000611ebb826116f7565b9050600081111561212a5773e1c7e30c42c24582888c758984f6e382096786bd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f6157600080fd5b505af1158015611f75573d6000803e3d6000fd5b505050506040513d6020811015611f8b57600080fd5b810190808051906020019092919050505061200e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61206081600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b881600254611e0390919063ffffffff16565b6002819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60006121808260000161238d565b9050919050565b600080828402905060008414806121a65750828482816121a357fe5b04145b6121ac57fe5b8091505092915050565b6000808284816121c257fe5b0490508091505092915050565b60006121f7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61239e565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146122fe576000600182039050600060018660000180549050039050600086600001828154811061226d57fe5b906000526020600020015490508087600001848154811061228a57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806122c257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612304565b60009150505b92915050565b60008183600001805490501161236b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061240f6022913960400191505060405180910390fd5b82600001828154811061237a57fe5b9060005260206000200154905092915050565b600081600001805490509050919050565b60006123aa83836121ff565b612403578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612408565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74207472616e73666572206f7574205374616b6520546f6b656e732066726f6d207468697320636f6e747261637421596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672e41646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732079657421a2646970667358221220f58a885e5d004eb49156b48d2d9d0fe747250b82d19b59029b4edbb7a38f8e9264736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 2,390 |
0xa49e2a387b6853bbddac74794374910b6eeb6cf5
|
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// @Name SafeMath
// @Desc Math operations with safety checks that throw on error
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
// ----------------------------------------------------------------------------
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) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// ----------------------------------------------------------------------------
// @title ERC20Basic
// @dev Simpler version of ERC20 interface
// See https://github.com/ethereum/EIPs/issues/179
// ----------------------------------------------------------------------------
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// ----------------------------------------------------------------------------
// @title ERC20 interface
// @dev See https://github.com/ethereum/EIPs/issues/20
// ----------------------------------------------------------------------------
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// ----------------------------------------------------------------------------
// @title Basic token
// @dev Basic version of StandardToken, with no allowances.
// ----------------------------------------------------------------------------
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
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];
}
}
// ----------------------------------------------------------------------------
// @title Ownable
// ----------------------------------------------------------------------------
contract Ownable {
address public owner;
address public operator;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event OperatorTransferred(address indexed previousOperator, address indexed newOperator);
constructor() public {
owner = msg.sender;
operator = msg.sender;
}
modifier onlyOwner() { require(msg.sender == owner); _; }
modifier onlyOwnerOrOperator() { require(msg.sender == owner || msg.sender == operator); _; }
function transferOwnership(address _newOwner) external onlyOwner {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
function transferOperator(address _newOperator) external onlyOwner {
require(_newOperator != address(0));
emit OperatorTransferred(operator, _newOperator);
operator = _newOperator;
}
}
// ----------------------------------------------------------------------------
// @title BlackList
// @dev Base contract which allows children to implement an emergency stop mechanism.
// ----------------------------------------------------------------------------
contract BlackList is Ownable {
event Lock(address indexed LockedAddress);
event Unlock(address indexed UnLockedAddress);
mapping( address => bool ) public blackList;
modifier CheckBlackList { require(blackList[msg.sender] != true); _; }
function SetLockAddress(address _lockAddress) external onlyOwnerOrOperator returns (bool) {
require(_lockAddress != address(0));
require(_lockAddress != owner);
require(blackList[_lockAddress] != true);
blackList[_lockAddress] = true;
emit Lock(_lockAddress);
return true;
}
function UnLockAddress(address _unlockAddress) external onlyOwner returns (bool) {
require(blackList[_unlockAddress] != false);
blackList[_unlockAddress] = false;
emit Unlock(_unlockAddress);
return true;
}
}
// ----------------------------------------------------------------------------
// @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;
modifier whenNotPaused() { require(!paused); _; }
modifier whenPaused() { require(paused); _; }
function pause() onlyOwnerOrOperator whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// ----------------------------------------------------------------------------
// @title Standard ERC20 token
// @dev Implementation of the basic standard token.
// https://github.com/ethereum/EIPs/issues/20
// ----------------------------------------------------------------------------
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);
emit Approval(_from, msg.sender, allowed[_from][msg.sender]);
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, uint256 _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// ----------------------------------------------------------------------------
// @title MultiTransfer Token
// @dev Only Admin
// ----------------------------------------------------------------------------
contract MultiTransferToken is StandardToken, Ownable, BlackList {
function MultiTransfer(address[] _to, uint256[] _amount) onlyOwner public returns (bool) {
require(_to.length == _amount.length);
uint256 ui;
uint256 amountSum = 0;
for (ui = 0; ui < _to.length; ui++) {
require(blackList[_to[ui]] != true);
require(_to[ui] != address(0));
amountSum = amountSum.add(_amount[ui]);
}
require(amountSum <= balances[msg.sender]);
for (ui = 0; ui < _to.length; ui++) {
balances[msg.sender] = balances[msg.sender].sub(_amount[ui]);
balances[_to[ui]] = balances[_to[ui]].add(_amount[ui]);
emit Transfer(msg.sender, _to[ui], _amount[ui]);
}
return true;
}
}
// ----------------------------------------------------------------------------
// @title Burnable Token
// @dev Token that can be irreversibly burned (destroyed).
// ----------------------------------------------------------------------------
contract BurnableToken is StandardToken, Ownable, BlackList {
event BurnAdminAmount(address indexed burner, uint256 value);
function burnAdminAmount(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit BurnAdminAmount(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
// ----------------------------------------------------------------------------
// @title Mintable token
// @dev Simple ERC20 Token example, with mintable token creation
// Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
// ----------------------------------------------------------------------------
contract MintableToken is StandardToken, Ownable, BlackList {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() { require(!mintingFinished); _; }
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(blackList[_to] != true);
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// ----------------------------------------------------------------------------
// @title Pausable token
// @dev StandardToken modified with pausable transfers.
// ----------------------------------------------------------------------------
contract PausableToken is StandardToken, Pausable, BlackList {
function transfer(address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
require(blackList[_to] != true);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
require(blackList[_from] != true);
require(blackList[_to] != true);
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused CheckBlackList returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused CheckBlackList returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// ----------------------------------------------------------------------------
// @Project CLAVIS
// ----------------------------------------------------------------------------
contract CLAVIS is PausableToken, MintableToken, BurnableToken, MultiTransferToken {
string public name = "CLAVIS";
string public symbol = "CVS";
uint256 public decimals = 18;
}
|
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461015957806306fdde03146101885780630896937e14610218578063095ea7b3146102d957806318160ddd1461033e57806323b872dd1461036957806329605e77146103ee578063313ce567146104315780633f4ba83a1461045c57806340c10f19146104735780634838d165146104d8578063570ca735146105335780635c975abb1461058a57806366188463146105b957806370a082311461061e57806376227f3b146106755780637d64bcb4146106a25780638456cb59146106d15780638da5cb5b146106e857806395d89b411461073f578063a9059cbb146107cf578063c201df9714610834578063c286f3d91461088f578063d73dd623146108ea578063dd62ed3e1461094f578063f2fde38b146109c6575b600080fd5b34801561016557600080fd5b5061016e610a09565b604051808215151515815260200191505060405180910390f35b34801561019457600080fd5b5061019d610a1c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022457600080fd5b506102bf6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610aba565b604051808215151515815260200191505060405180910390f35b3480156102e557600080fd5b50610324600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ec9565b604051808215151515815260200191505060405180910390f35b34801561034a57600080fd5b50610353610f59565b6040518082815260200191505060405180910390f35b34801561037557600080fd5b506103d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f63565b604051808215151515815260200191505060405180910390f35b3480156103fa57600080fd5b5061042f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110b5565b005b34801561043d57600080fd5b5061044661120d565b6040518082815260200191505060405180910390f35b34801561046857600080fd5b50610471611213565b005b34801561047f57600080fd5b506104be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d3565b604051808215151515815260200191505060405180910390f35b3480156104e457600080fd5b50610519600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611519565b604051808215151515815260200191505060405180910390f35b34801561053f57600080fd5b50610548611539565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059657600080fd5b5061059f61155f565b604051808215151515815260200191505060405180910390f35b3480156105c557600080fd5b50610604600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611572565b604051808215151515815260200191505060405180910390f35b34801561062a57600080fd5b5061065f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611602565b6040518082815260200191505060405180910390f35b34801561068157600080fd5b506106a06004803603810190808035906020019092919050505061164a565b005b3480156106ae57600080fd5b506106b7611858565b604051808215151515815260200191505060405180910390f35b3480156106dd57600080fd5b506106e6611920565b005b3480156106f457600080fd5b506106fd611a39565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074b57600080fd5b50610754611a5f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610794578082015181840152602081019050610779565b50505050905090810190601f1680156107c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107db57600080fd5b5061081a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611afd565b604051808215151515815260200191505060405180910390f35b34801561084057600080fd5b50610875600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bed565b604051808215151515815260200191505060405180910390f35b34801561089b57600080fd5b506108d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d4f565b604051808215151515815260200191505060405180910390f35b3480156108f657600080fd5b50610935600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611fa2565b604051808215151515815260200191505060405180910390f35b34801561095b57600080fd5b506109b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612032565b6040518082815260200191505060405180910390f35b3480156109d257600080fd5b50610a07600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120b9565b005b600660009054906101000a900460ff1681565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ab25780601f10610a8757610100808354040283529160200191610ab2565b820191906000526020600020905b815481529060010190602001808311610a9557829003601f168201915b505050505081565b6000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1b57600080fd5b83518551141515610b2b57600080fd5b60009050600091505b8451821015610c405760011515600560008785815181101515610b5357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515610bb457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168583815181101515610bda57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515610c0757600080fd5b610c318483815181101515610c1857fe5b906020019060200201518261221190919063ffffffff16565b90508180600101925050610b34565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610c8d57600080fd5b600091505b8451821015610ebd57610d038483815181101515610cac57fe5b906020019060200201516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dc48483815181101515610d5657fe5b906020019060200201516000808886815181101515610d7157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221190919063ffffffff16565b6000808785815181101515610dd557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508482815181101515610e2b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8685815181101515610e9157fe5b906020019060200201516040518082815260200191505060405180910390a38180600101925050610c92565b60019250505092915050565b6000600460149054906101000a900460ff16151515610ee757600080fd5b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515610f4757600080fd5b610f518383612248565b905092915050565b6000600154905090565b6000600460149054906101000a900460ff16151515610f8157600080fd5b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515610fe157600080fd5b60011515600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415151561104157600080fd5b60011515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515156110a157600080fd5b6110ac84848461233a565b90509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561114d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed60405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126f57600080fd5b600460149054906101000a900460ff16151561128a57600080fd5b6000600460146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133157600080fd5b600660009054906101000a900460ff1615151561134d57600080fd5b60011515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515156113ad57600080fd5b6113c28260015461221190919063ffffffff16565b600181905550611419826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460149054906101000a900460ff1681565b6000600460149054906101000a900460ff1615151561159057600080fd5b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515156115f057600080fd5b6115fa83836127d5565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116a657600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156116f357600080fd5b611744816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179b8160015461222f90919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fa0f3dea10c8bf26d7f1b6b0cf33166195f48616c562c681b49eaaa2423894d00826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118b657600080fd5b600660009054906101000a900460ff161515156118d257600080fd5b6001600660006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119c95750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156119d457600080fd5b600460149054906101000a900460ff161515156119f057600080fd5b6001600460146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611af55780601f10611aca57610100808354040283529160200191611af5565b820191906000526020600020905b815481529060010190602001808311611ad857829003601f168201915b505050505081565b6000600460149054906101000a900460ff16151515611b1b57600080fd5b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515611b7b57600080fd5b60011515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515611bdb57600080fd5b611be58383612a66565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c4b57600080fd5b60001515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515611cab57600080fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f0be774851955c26a1d6a32b13b020663a069006b4a3b643ff0b809d31826057260405160405180910390a260019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611dfa5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611e0557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e4157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e9e57600080fd5b60011515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515611efe57600080fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fc1b5f12cea7c200ad495a43bf2d4c7ba1a753343c06c339093937849de84d91360405160405180910390a260019050919050565b6000600460149054906101000a900460ff16151515611fc057600080fd5b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415151561202057600080fd5b61202a8383612c85565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561211557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561215157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015151561222557fe5b8091505092915050565b600082821115151561223d57fe5b818303905092915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561237757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156123c457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561244f57600080fd5b6124a0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612533826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061260482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156128e6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297a565b6128f9838261222f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612aa357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612af057600080fd5b612b41826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bd4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000612d1682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a723058201f1cba2d964e12980c39b73e37e60c3ff52e9fab639ebb46d9b67a6ac24bc11f0029
|
{"success": true, "error": null, "results": {}}
| 2,391 |
0xe4e5a071ea66866ccbd47f469a83ca233f3c0fa5
|
// SPDX-License-Identifier: Witness Protected
pragma solidity ^0.8.4;
interface ERC20 {
function totalSupply() external view returns (uint _totalSupply);
function balanceOf(address _owner) external view returns (uint balance);
function transfer(address _to, uint _value) external returns (bool success);
function transferFrom(address _from, address _to, uint _value) external returns (bool success);
function approve(address _spender, uint _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint remaining);
function decimals() external view returns (uint256);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
interface IUniswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapRouter01 {
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function factory() external pure returns (address);
function WETH() external pure returns (address);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getamountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getamountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getamountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getamountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapRouter02 is IUniswapRouter01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Protected {
mapping (address => bool) is_auth;
function authorized(address addy) public view returns(bool) {
return is_auth[addy];
}
function set_authorized(address addy, bool booly) public onlyAuth {
is_auth[addy] = booly;
}
modifier onlyAuth() {
require( is_auth[msg.sender] || msg.sender==owner, "not owner");
_;
}
address owner;
modifier onlyOwner() {
require(msg.sender==owner, "not owner");
_;
}
bool locked;
modifier safe() {
require(!locked, "reentrant");
locked = true;
_;
locked = false;
}
receive() external payable {}
fallback() external payable {}
}
interface UniswapV2Pair {
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
}
interface AggregatorInterface {
function latestAnswer() external view returns (int256);
function latestTimestamp() external view returns (uint256);
function latestRound() external view returns (uint256);
function getAnswer(uint256 roundId) external view returns (int256);
function getTimestamp(uint256 roundId) external view returns (uint256);
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
}
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
);
}
interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface
{
}
contract smart_dex is Protected {
////////////////// Basic definitions //////////////////
address middleware;
event open_position(address token, uint limit_price, uint qty, bytes32 direction, bool executed);
address public constant Dead = 0x000000000000000000000000000000000000dEaD;
IUniswapFactory factory;
IUniswapRouter02 router;
mapping(address => uint) order_cooldown;
uint cooldown_value;
address aggregator = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;
AggregatorV2V3Interface usd_price;
////////////////// Structures and data //////////////////
struct positions {
address token;
address actor;
uint qty;
uint price_limit;
bytes32 action;
bool active;
}
mapping(address => mapping(uint => positions)) actor_positions;
mapping(uint => address) position_owner;
mapping(address => uint[]) owned_positions;
uint last_position;
////////////////// Constructor //////////////////
constructor() {
owner = msg.sender;
router = IUniswapRouter02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
factory = IUniswapFactory(router.factory());
usd_price = AggregatorV2V3Interface(aggregator);
}
////////////////// Settings //////////////////
function set_middleware(address addy) public onlyAuth {
middleware = addy;
}
////////////////// Public write functions //////////////////
function set_limit_buy(address token, uint limit_price, uint qty) payable public safe {
require(order_cooldown[msg.sender] < block.timestamp, "Sheesh, calm down");
uint required_price = get_price(token, qty);
uint fee = required_price/100;
required_price = (required_price) + (fee);
require(msg.value >= required_price);
set_position(token, limit_price, msg.value, "limit_buy", msg.sender);
order_cooldown[msg.sender] = block.timestamp + cooldown_value;
}
function set_limit_sell(address token, uint limit_price, uint qty) public safe {
require(order_cooldown[msg.sender] < block.timestamp, "Sheesh, calm down");
ERC20 coin = ERC20(token);
require(coin.balanceOf(msg.sender) >= qty, "Not enough tokens");
require(coin.allowance(msg.sender, address(this)) >= qty, "Not enough allowance");
coin.transferFrom(msg.sender, address(this), qty);
set_position(token, limit_price, qty, "limit_sell", msg.sender);
order_cooldown[msg.sender] = block.timestamp + cooldown_value;
}
function rescue() public onlyAuth{
(bool sent,) =msg.sender.call{value: (address(this).balance)}("");
require(sent);
}
////////////////// Private write functions //////////////////
function set_position(address token, uint limit_price, uint qty, bytes32 direction, address sender) private {
last_position += 1;
actor_positions[sender][last_position].token = token;
actor_positions[sender][last_position].actor = sender;
actor_positions[sender][last_position].action = "buy_limit";
actor_positions[sender][last_position].qty = qty;
actor_positions[sender][last_position].price_limit = limit_price;
actor_positions[sender][last_position].active = true;
owned_positions[sender].push(last_position);
position_owner[last_position] = sender;
emit open_position(token, limit_price, qty, direction, false);
}
function execute_buy(uint position) private {
address actor = position_owner[position];
address token = actor_positions[actor][position].token;
uint qty = actor_positions[actor][position].qty;
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = token;
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: qty}(0, path, actor, block.timestamp);
actor_positions[actor][position].active = false;
}
function execute_sell(uint position) private {
address actor = position_owner[position];
address token = actor_positions[actor][position].token;
uint qty = actor_positions[actor][position].qty;
address[] memory path = new address[](2);
path[0] = token;
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(qty, 0, path, actor, block.timestamp);
actor_positions[actor][position].active = false;
}
////////////////// Public view functions //////////////////
// calculate price based on pair reserves (in ETH per 1 token)
function get_price(address tkn, uint amount) public view returns(uint)
{
address pair = factory.getPair(router.WETH(), tkn);
UniswapV2Pair pair_interface = UniswapV2Pair(pair);
(uint Res0, uint Res1,) = pair_interface.getReserves();
// decimals
uint res0 = Res0*(10**ERC20(tkn).decimals());
uint eth_answer = (amount*res0)/Res1;
return(eth_answer); // return amount of token0 needed to buy token1
}
function price_in_dollars(uint eth_answer) public view returns(uint) {
int current_usd = (usd_price.latestAnswer())/(10**8);
uint usd_answer = (uint(current_usd) * eth_answer);
return(usd_answer);
}
function get_positions(address actor) public view returns(uint[] memory) {
return owned_positions[actor];
}
function get_single_position(uint pos) public view returns(positions memory) {
address owner_of = position_owner[pos];
return actor_positions[owner_of][pos];
}
}
|
0x60806040526004361061009a5760003560e01c80632bfe8742116100615780632bfe87421461025b578063428de1251461027b57806362b287091461028e57806382c4767b146102ae578063b9181611146102dc578063fac1ba361461032557005b806303f25a79146100a35780631fbe1979146100d657806323204387146100eb578063261166be1461020e5780632b6e94371461022e57005b366100a157005b005b3480156100af57600080fd5b506100c36100be366004610e17565b610345565b6040519081526020015b60405180910390f35b3480156100e257600080fd5b506100a1610591565b3480156100f757600080fd5b506101b7610106366004610efe565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506000818152600a60209081526040808320546001600160a01b0390811684526009835281842094845293825291829020825160c08101845281548516815260018201549094169184019190915260028101549183019190915260038101546060830152600481015460808301526005015460ff16151560a082015290565b6040516100cd919081516001600160a01b0390811682526020808401519091169082015260408083015190820152606080830151908201526080808301519082015260a09182015115159181019190915260c00190565b34801561021a57600080fd5b506100a1610229366004610d9d565b610636565b34801561023a57600080fd5b5061024e610249366004610d9d565b61069c565b6040516100cd9190610f17565b34801561026757600080fd5b506100a1610276366004610dde565b610708565b6100a1610289366004610e43565b610777565b34801561029a57600080fd5b506100c36102a9366004610efe565b6108a2565b3480156102ba57600080fd5b506102c461dead81565b6040516001600160a01b0390911681526020016100cd565b3480156102e857600080fd5b506103156102f7366004610d9d565b6001600160a01b031660009081526020819052604090205460ff1690565b60405190151581526020016100cd565b34801561033157600080fd5b506100a1610340366004610e43565b610950565b60035460048054604080516315ab88c960e31b8152905160009485946001600160a01b039182169463e6a439059492169263ad5c4648928083019260209291829003018186803b15801561039857600080fd5b505afa1580156103ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d09190610dc1565b6040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908716602482015260440160206040518083038186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044f9190610dc1565b90506000819050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561049257600080fd5b505afa1580156104a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ca9190610eae565b506001600160701b031691506001600160701b031691506000876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561051c57600080fd5b505afa158015610530573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105549190610e95565b61055f90600a61101b565b61056990846110c3565b9050600082610578838a6110c3565b6105829190610fc4565b96505050505050505b92915050565b3360009081526020819052604090205460ff16806105b957506001546001600160a01b031633145b6105de5760405162461bcd60e51b81526004016105d590610f5b565b60405180910390fd5b604051600090339047908381818185875af1925050503d8060008114610620576040519150601f19603f3d011682016040523d82523d6000602084013e610625565b606091505b505090508061063357600080fd5b50565b3360009081526020819052604090205460ff168061065e57506001546001600160a01b031633145b61067a5760405162461bcd60e51b81526004016105d590610f5b565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600b60209081526040918290208054835181840281018401909452808452606093928301828280156106fc57602002820191906000526020600020905b8154815260200190600101908083116106e8575b50505050509050919050565b3360009081526020819052604090205460ff168061073057506001546001600160a01b031633145b61074c5760405162461bcd60e51b81526004016105d590610f5b565b6001600160a01b03919091166000908152602081905260409020805460ff1916911515919091179055565b600154600160a01b900460ff16156107bd5760405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b60448201526064016105d5565b6001805460ff60a01b1916600160a01b1790553360009081526005602052604090205442116108225760405162461bcd60e51b815260206004820152601160248201527029b432b2b9b4161031b0b636903237bbb760791b60448201526064016105d5565b600061082e8483610345565b9050600061083d606483610fc4565b90506108498183610f7e565b91508134101561085857600080fd5b610871858534686c696d69745f62757960b81b33610c4d565b60065461087e9042610f7e565b3360009081526005602052604090205550506001805460ff60a01b19169055505050565b6000806305f5e100600860009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190610e95565b61093a9190610f96565b9050600061094884836110c3565b949350505050565b600154600160a01b900460ff16156109965760405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b60448201526064016105d5565b6001805460ff60a01b1916600160a01b1790553360009081526005602052604090205442116109fb5760405162461bcd60e51b815260206004820152601160248201527029b432b2b9b4161031b0b636903237bbb760791b60448201526064016105d5565b6040516370a0823160e01b8152336004820152839082906001600160a01b038316906370a082319060240160206040518083038186803b158015610a3e57600080fd5b505afa158015610a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a769190610e95565b1015610ab85760405162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f75676820746f6b656e7360781b60448201526064016105d5565b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e9060440160206040518083038186803b158015610aff57600080fd5b505afa158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b379190610e95565b1015610b7c5760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820616c6c6f77616e636560601b60448201526064016105d5565b6040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b038216906323b872dd90606401602060405180830381600087803b158015610bca57600080fd5b505af1158015610bde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c029190610e78565b50610c1d848484691b1a5b5a5d17dcd95b1b60b21b33610c4d565b600654610c2a9042610f7e565b3360009081526005602052604090205550506001805460ff60a01b191690555050565b6001600c6000828254610c609190610f7e565b90915550506001600160a01b038181166000818152600960209081526040808320600c805485529083528184208054968c166001600160a01b0319978816811790915581548552828520600190810180548916881790558254865283862068189d5e57db1a5b5a5d60ba1b600490910155825486528386206002018b9055825486528386206003018c905582548652838620600501805460ff191682179055868652600b85528386208354815492830182559087528587209091015590548452600a835281842080549096169094179094558351928352820187905281830186905260608201859052608082015290517f5521bc357c5ccb4c30c0f2ca033b1ca4d90a86d8959f71fa292adc25c5617a4e9181900360a00190a15050505050565b80516001600160701b0381168114610d9857600080fd5b919050565b600060208284031215610daf57600080fd5b8135610dba8161110e565b9392505050565b600060208284031215610dd357600080fd5b8151610dba8161110e565b60008060408385031215610df157600080fd5b8235610dfc8161110e565b91506020830135610e0c81611123565b809150509250929050565b60008060408385031215610e2a57600080fd5b8235610e358161110e565b946020939093013593505050565b600080600060608486031215610e5857600080fd5b8335610e638161110e565b95602085013595506040909401359392505050565b600060208284031215610e8a57600080fd5b8151610dba81611123565b600060208284031215610ea757600080fd5b5051919050565b600080600060608486031215610ec357600080fd5b610ecc84610d81565b9250610eda60208501610d81565b9150604084015163ffffffff81168114610ef357600080fd5b809150509250925092565b600060208284031215610f1057600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015610f4f57835183529284019291840191600101610f33565b50909695505050505050565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b60008219821115610f9157610f916110e2565b500190565b600082610fa557610fa56110f8565b600160ff1b821460001984141615610fbf57610fbf6110e2565b500590565b600082610fd357610fd36110f8565b500490565b600181815b80851115611013578160001904821115610ff957610ff96110e2565b8085161561100657918102915b93841c9390800290610fdd565b509250929050565b6000610dba83836000826110315750600161058b565b8161103e5750600061058b565b8160018114611054576002811461105e5761107a565b600191505061058b565b60ff84111561106f5761106f6110e2565b50506001821b61058b565b5060208310610133831016604e8410600b841016171561109d575081810a61058b565b6110a78383610fd8565b80600019048211156110bb576110bb6110e2565b029392505050565b60008160001904831182151516156110dd576110dd6110e2565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063357600080fd5b801515811461063357600080fdfea26469706673582212203472c4d10f701ed9b40d8fffcd2cd03586527eee7a5fe106a33edfe0eaf7a03864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 2,392 |
0x879a2FCBa58177943FeE56E9F53332cDcb55a2f8
|
pragma solidity 0.5.14;
/**
* @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 Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
/**
* @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].
*
* _Available since v2.4.0._
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* 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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
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");
}
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Receive {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping(address => uint256) public winner;
address public FIN = 0x054f76beED60AB6dBEb23502178C52d6C5dEbE40;
address admin = msg.sender;
bool _notEntered = true;
modifier onlyAdmin() {
require(msg.sender == admin, "The caller not admin.");
_;
}
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_notEntered, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_notEntered = false;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_notEntered = true;
}
function addWinners(address[] memory _winners, uint256[] memory _amounts) public onlyAdmin{
require(_winners.length == _amounts.length, "_winners and _amounts are not equal in length.");
for(uint i; i < _winners.length; i++){
winner[_winners[i]] = winner[_winners[i]].add(_amounts[i]);
}
}
function receive() public nonReentrant{
require(tx.origin == msg.sender, "The caller does not exist.");
uint256 amount = winner[msg.sender];
if(amount == 0) return;
IERC20(FIN).safeTransfer(msg.sender, amount);
winner[msg.sender] = 0;
}
function emergencyExit() public onlyAdmin{
IERC20(FIN).safeTransfer(msg.sender, IERC20(FIN).balanceOf(address(this)));
}
function changeAdmin(address _admin) public onlyAdmin{
admin = _admin;
}
}
|
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632ad95786146100675780634eac9d861461009f5780635641ec03146100c35780638f283970146100cd578063a3e76c0f146100f3578063fd061015146100fb575b600080fd5b61008d6004803603602081101561007d57600080fd5b50356001600160a01b0316610222565b60408051918252519081900360200190f35b6100a7610234565b604080516001600160a01b039092168252519081900360200190f35b6100cb610243565b005b6100cb600480360360208110156100e357600080fd5b50356001600160a01b0316610332565b6100cb6103ab565b6100cb6004803603604081101561011157600080fd5b81019060208101813564010000000081111561012c57600080fd5b82018360208201111561013e57600080fd5b8035906020019184602083028401116401000000008311171561016057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156101b057600080fd5b8201836020820111156101c257600080fd5b803590602001918460208302840111640100000000831117156101e457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506104c9945050505050565b60006020819052908152604090205481565b6001546001600160a01b031681565b6002546001600160a01b0316331461029a576040805162461bcd60e51b81526020600482015260156024820152742a34329031b0b63632b9103737ba1030b236b4b71760591b604482015290519081900360640190fd5b600154604080516370a0823160e01b815230600482015290516103309233926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b1580156102eb57600080fd5b505afa1580156102ff573d6000803e3d6000fd5b505050506040513d602081101561031557600080fd5b50516001546001600160a01b0316919063ffffffff61060916565b565b6002546001600160a01b03163314610389576040805162461bcd60e51b81526020600482015260156024820152742a34329031b0b63632b9103737ba1030b236b4b71760591b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600254600160a01b900460ff16610409576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805460ff60a01b1916905532331461046a576040805162461bcd60e51b815260206004820152601a60248201527f5468652063616c6c657220646f6573206e6f742065786973742e000000000000604482015290519081900360640190fd5b336000908152602081905260409020548061048557506104b4565b6001546104a2906001600160a01b0316338363ffffffff61060916565b50336000908152602081905260408120555b6002805460ff60a01b1916600160a01b179055565b6002546001600160a01b03163314610520576040805162461bcd60e51b81526020600482015260156024820152742a34329031b0b63632b9103737ba1030b236b4b71760591b604482015290519081900360640190fd5b80518251146105605760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b7602e913960400191505060405180910390fd5b60005b8251811015610604576105c982828151811061057b57fe5b602002602001015160008086858151811061059257fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205461065b90919063ffffffff16565b6000808584815181106105d857fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600101610563565b505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526106049084906106bc565b6000828201838110156106b5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6106ce826001600160a01b031661087a565b61071f576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061075d5780518252601f19909201916020918201910161073e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146107bf576040519150601f19603f3d011682016040523d82523d6000602084013e6107c4565b606091505b50915091508161081b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156108745780806020019051602081101561083757600080fd5b50516108745760405162461bcd60e51b815260040180806020018281038252602a8152602001806108e5602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906108ae57508115155b94935050505056fe5f77696e6e65727320616e64205f616d6f756e747320617265206e6f7420657175616c20696e206c656e6774682e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820f52354b683f6eb2a108ed800898b04a37da3a915c9cdf4e767a058fc636648ec64736f6c634300050e0032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 2,393 |
0x7021967e5d0761772c6fb25304f2d013865aba7c
|
pragma solidity ^0.4.21;
// File: zeppelin/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin/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() {
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;
}
}
// File: zeppelin/contracts/token/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin/contracts/token/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// 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];
}
}
// File: zeppelin/contracts/token/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public 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);
}
// File: zeppelin/contracts/token/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
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)
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)
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;
}
}
// File: contracts/EpigenCareCrowdsale.sol
contract EpigenCareCrowdsale is Ownable {
using SafeMath for uint256;
StandardToken public token;
uint256 public startTime;
uint256 public endTime;
address public wallet;
address public tokenPool;
uint256 public rate;
uint256 public weiRaised;
uint256 public weiPending;
uint256 public tokensPending;
uint256 public minimumInvestment;
mapping (address => Transaction) transactions;
mapping (address => bool) approvedAddresses;
mapping (address => bool) verifiers;
struct Transaction { uint weiAmount; uint tokenAmount; }
event TokenPurchaseRequest(address indexed purchaser, address indexed beneficiary, uint256 value);
function EpigenCareCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, address _tokenPool, address _token) Ownable() {
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != 0x0);
require(_tokenPool != 0x0);
token = StandardToken(_token);
startTime = _startTime;
endTime = _endTime;
wallet = _wallet;
tokenPool = _tokenPool;
verifiers[msg.sender] = true;
rate = _rate;
minimumInvestment = 0.5 ether;
}
function () payable {
requestTokens(msg.sender);
}
function requestTokens(address beneficiary) sufficientApproval(msg.value) public payable {
require(beneficiary != 0x0);
require(validPurchase());
require(msg.value >= minimumInvestment);
uint256 weiAmount = msg.value;
uint256 tokens = weiAmount.mul(rate);
if(approvedAddresses[beneficiary]) {
weiRaised = weiRaised.add(weiAmount);
token.transferFrom(tokenPool, beneficiary, tokens);
wallet.transfer(weiAmount);
} else {
Transaction transaction = transactions[beneficiary];
transaction.weiAmount = transaction.weiAmount.add(weiAmount);
transaction.tokenAmount = transaction.tokenAmount.add(tokens);
weiPending = weiPending.add(weiAmount);
tokensPending = tokensPending.add(tokens);
TokenPurchaseRequest(msg.sender, beneficiary, weiAmount);
}
}
function validateTransaction(address purchaser) onlyVerifiers(msg.sender) {
Transaction transaction = transactions[purchaser];
weiRaised = weiRaised.add(transaction.weiAmount);
weiPending = weiPending.sub(transaction.weiAmount);
tokensPending = tokensPending.sub(transaction.tokenAmount);
approvedAddresses[purchaser] = true;
token.transferFrom(tokenPool, purchaser, transaction.tokenAmount);
wallet.transfer(transaction.weiAmount);
transaction.weiAmount = 0;
transaction.tokenAmount = 0;
}
function pendingTransaction(address user) returns (uint value){
return transactions[user].weiAmount;
}
function revokeRequest() {
Transaction transaction = transactions[msg.sender];
weiPending = weiPending.sub(transaction.weiAmount);
tokensPending = tokensPending.sub(transaction.tokenAmount);
msg.sender.transfer(transaction.weiAmount);
transaction.weiAmount = 0;
transaction.tokenAmount = 0;
}
modifier sufficientApproval(uint value) {
uint tokensNeeded = tokensPending.add(value.mul(rate));
uint tokensAvailable = token.allowance(tokenPool, this);
require(tokensAvailable >= tokensNeeded);
_;
}
function rejectRequest(address user, uint fee) onlyVerifiers(msg.sender) {
Transaction transaction = transactions[user];
weiPending = weiPending.sub(transaction.weiAmount);
tokensPending = tokensPending.sub(transaction.tokenAmount);
if(fee > 0) {
transaction.weiAmount = transaction.weiAmount.sub(fee);
wallet.transfer(fee);
}
user.transfer(transaction.weiAmount);
transaction.weiAmount = 0;
transaction.tokenAmount = 0;
}
function validPurchase() internal constant returns (bool) {
bool withinPeriod = (now >= startTime && now <= endTime);
bool nonZeroPurchase = msg.value != 0;
return (withinPeriod && nonZeroPurchase);
}
function hasEnded() public constant returns (bool) {
return now > endTime;
}
function updateMinimumInvestment(uint _minimumInvestment) onlyOwner {
minimumInvestment = _minimumInvestment;
}
function updateRate(uint _rate) onlyOwner {
rate = _rate;
}
function setVerifier(address verifier, bool value) onlyOwner {
verifiers[verifier] = value;
}
function isValidated(address user) returns (bool) {
return approvedAddresses[user];
}
modifier onlyVerifiers(address sender) {
require(verifiers[sender]);
_;
}
}
|
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806304d0ac48146101335780630b91eaf91461015c578063104e9929146101ad578063169c13ed146102025780632b925b251461024f5780632c4e722e146102785780633197cbb6146102a15780634042b66f146102ca578063521eb273146102f3578063580f3904146103485780636418345e146103765780636859dc101461039957806369ea1771146103db57806378e97925146103fe5780638da5cb5b146104275780638fa3a84c1461047c578063ac9b5671146104b5578063e77cfa1c146104f9578063e85501d814610522578063ecb70fb714610537578063f2fde38b14610564578063fc0c546a1461059d575b610131336105f2565b005b341561013e57600080fd5b610146610aee565b6040518082815260200191505060405180910390f35b341561016757600080fd5b610193600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610af4565b604051808215151515815260200191505060405180910390f35b34156101b857600080fd5b6101c0610b4a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561020d57600080fd5b610239600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b70565b6040518082815260200191505060405180910390f35b341561025a57600080fd5b610262610bbc565b6040518082815260200191505060405180910390f35b341561028357600080fd5b61028b610bc2565b6040518082815260200191505060405180910390f35b34156102ac57600080fd5b6102b4610bc8565b6040518082815260200191505060405180910390f35b34156102d557600080fd5b6102dd610bce565b6040518082815260200191505060405180910390f35b34156102fe57600080fd5b610306610bd4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610374600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105f2565b005b341561038157600080fd5b6103976004808035906020019091905050610bfa565b005b34156103a457600080fd5b6103d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c5f565b005b34156103e657600080fd5b6103fc6004808035906020019091905050610e22565b005b341561040957600080fd5b610411610e87565b6040518082815260200191505060405180910390f35b341561043257600080fd5b61043a610e8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048757600080fd5b6104b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eb2565b005b34156104c057600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506111b8565b005b341561050457600080fd5b61050c61126e565b6040518082815260200191505060405180910390f35b341561052d57600080fd5b610535611274565b005b341561054257600080fd5b61054a611350565b604051808215151515815260200191505060405180910390f35b341561056f57600080fd5b61059b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061135c565b005b34156105a857600080fd5b6105b06114b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600034600080610624610613600654856114d790919063ffffffff16565b60095461150a90919063ffffffff16565b9150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561073857600080fd5b5af1151561074557600080fd5b50505060405180519050905081811015151561076057600080fd5b60008773ffffffffffffffffffffffffffffffffffffffff161415151561078657600080fd5b61078e611528565b151561079957600080fd5b600a5434101515156107aa57600080fd5b3495506107c2600654876114d790919063ffffffff16565b9450600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109ca5761082b8660075461150a90919063ffffffff16565b600781905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689886040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561094b57600080fd5b5af1151561095857600080fd5b5050506040518051905050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f1935050505015156109c557600080fd5b610ae5565b600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350610a2286856000015461150a90919063ffffffff16565b8460000181905550610a4185856001015461150a90919063ffffffff16565b8460010181905550610a5e8660085461150a90919063ffffffff16565b600881905550610a798560095461150a90919063ffffffff16565b6009819055508673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f99d76ba7e67bb3370a0c2e2d35a09bef1639fe51ce6ecac51bc2c725fb9334d5886040518082815260200191505060405180910390a35b50505050505050565b60095481565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b600a5481565b60065481565b60035481565b60075481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c5557600080fd5b80600a8190555050565b600033600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cba57600080fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150610d14826000015460085461155b90919063ffffffff16565b600881905550610d33826001015460095461155b90919063ffffffff16565b6009819055506000831115610dc457610d5983836000015461155b90919063ffffffff16565b8260000181905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515610dc357600080fd5b5b8373ffffffffffffffffffffffffffffffffffffffff166108fc83600001549081150290604051600060405180830381858888f193505050501515610e0857600080fd5b600082600001819055506000826001018190555050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7d57600080fd5b8060068190555050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f0d57600080fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150610f67826000015460075461150a90919063ffffffff16565b600781905550610f86826000015460085461155b90919063ffffffff16565b600881905550610fa5826001015460095461155b90919063ffffffff16565b6009819055506001600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168585600101546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561112157600080fd5b5af1151561112e57600080fd5b5050506040518051905050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc83600001549081150290604051600060405180830381858888f19350505050151561119f57600080fd5b6000826000018190555060008260010181905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121357600080fd5b80600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60085481565b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506112d0816000015460085461155b90919063ffffffff16565b6008819055506112ef816001015460095461155b90919063ffffffff16565b6009819055503373ffffffffffffffffffffffffffffffffffffffff166108fc82600001549081150290604051600060405180830381858888f19350505050151561133957600080fd5b600081600001819055506000816001018190555050565b60006003544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113f357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806114f857508284828115156114f557fe5b04145b151561150057fe5b8091505092915050565b600080828401905083811015151561151e57fe5b8091505092915050565b6000806000600254421015801561154157506003544211155b9150600034141590508180156115545750805b9250505090565b600082821115151561156957fe5b8183039050929150505600a165627a7a72305820d66cdeb340527dc161e7142735a1e8830e37ddd7f94dc51644fd8f7b023ae03f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 2,394 |
0x7ad2c5d44906ea05100e772323b1295b6b367eac
|
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// 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 renounceOwnership(address ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
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 KWON is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "WeAreKwon";//////////////////////////
string private constant _symbol = "KWON";//////////////////////////////////////////////////////////////////////////
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 = 748559458 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 3;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 3;/////////////////////////////////////////////////////////////////////
//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(0x804F9E2043891197502dD4fBA93Ecfdb98302C20);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x804F9E2043891197502dD4fBA93Ecfdb98302C20);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 7485595 * 10**9; //1%
uint256 public _maxWalletSize = 22456785 * 10**9; //3%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063c3c8cd8011610064578063c3c8cd8014610527578063c492f0461461053c578063dd62ed3e1461055c578063ea1644d5146105a257600080fd5b806398a5c31514610497578063a2a957bb146104b7578063a9059cbb146104d7578063bfd79284146104f757600080fd5b80638da5cb5b116100d15780638da5cb5b146104165780638f70ccf7146104345780638f9a55c01461045457806395d89b411461046a57600080fd5b8063715018a6146103cb57806374010ece146103e05780637d1db4a51461040057600080fd5b8063313ce567116101645780636b9990531161013e5780636b999053146103565780636d8aa8f8146103765780636fc3eaec1461039657806370a08231146103ab57600080fd5b8063313ce567146102fa57806338bf3cfa1461031657806349bd5a5e1461033657600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c45780632fd689e3146102e457600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae8565b6105c2565b005b3480156101ff57600080fd5b506040805180820190915260098152682bb2a0b932a5bbb7b760b91b60208201525b60405161022e9190611c12565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a3e565b61066f565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b50670a636adc6b5954005b60405190815260200161022e565b3480156102d057600080fd5b506102576102df3660046119fe565b610686565b3480156102f057600080fd5b506102b660185481565b34801561030657600080fd5b506040516009815260200161022e565b34801561032257600080fd5b506101f161033136600461198e565b6106ef565b34801561034257600080fd5b50601554610287906001600160a01b031681565b34801561036257600080fd5b506101f161037136600461198e565b6107d9565b34801561038257600080fd5b506101f1610391366004611baf565b610824565b3480156103a257600080fd5b506101f161086c565b3480156103b757600080fd5b506102b66103c636600461198e565b6108b7565b3480156103d757600080fd5b506101f16108d9565b3480156103ec57600080fd5b506101f16103fb366004611bc9565b61094d565b34801561040c57600080fd5b506102b660165481565b34801561042257600080fd5b506000546001600160a01b0316610287565b34801561044057600080fd5b506101f161044f366004611baf565b61097c565b34801561046057600080fd5b506102b660175481565b34801561047657600080fd5b5060408051808201909152600481526325aba7a760e11b6020820152610221565b3480156104a357600080fd5b506101f16104b2366004611bc9565b6109c4565b3480156104c357600080fd5b506101f16104d2366004611be1565b6109f3565b3480156104e357600080fd5b506102576104f2366004611a3e565b610a31565b34801561050357600080fd5b5061025761051236600461198e565b60106020526000908152604090205460ff1681565b34801561053357600080fd5b506101f1610a3e565b34801561054857600080fd5b506101f1610557366004611a69565b610a92565b34801561056857600080fd5b506102b66105773660046119c6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ae57600080fd5b506101f16105bd366004611bc9565b610b41565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016105ec90611c65565b60405180910390fd5b60005b815181101561066b5760016010600084848151811061062757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066381611d78565b9150506105f8565b5050565b600061067c338484610b70565b5060015b92915050565b6000610693848484610c94565b6106e584336106e085604051806060016040528060288152602001611dd5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d0565b610b70565b5060019392505050565b6000546001600160a01b031633146107195760405162461bcd60e51b81526004016105ec90611c65565b6001600160a01b03811661077e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ec565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108035760405162461bcd60e51b81526004016105ec90611c65565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461084e5760405162461bcd60e51b81526004016105ec90611c65565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806108a157506013546001600160a01b0316336001600160a01b0316145b6108aa57600080fd5b476108b48161120a565b50565b6001600160a01b0381166000908152600260205260408120546106809061128f565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105ec90611c65565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109775760405162461bcd60e51b81526004016105ec90611c65565b601655565b6000546001600160a01b031633146109a65760405162461bcd60e51b81526004016105ec90611c65565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109ee5760405162461bcd60e51b81526004016105ec90611c65565b601855565b6000546001600160a01b03163314610a1d5760405162461bcd60e51b81526004016105ec90611c65565b600893909355600a91909155600955600b55565b600061067c338484610c94565b6012546001600160a01b0316336001600160a01b03161480610a7357506013546001600160a01b0316336001600160a01b0316145b610a7c57600080fd5b6000610a87306108b7565b90506108b481611313565b6000546001600160a01b03163314610abc5760405162461bcd60e51b81526004016105ec90611c65565b60005b82811015610b3b578160056000868685818110610aec57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b01919061198e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3381611d78565b915050610abf565b50505050565b6000546001600160a01b03163314610b6b5760405162461bcd60e51b81526004016105ec90611c65565b601755565b6001600160a01b038316610bd25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b6001600160a01b038216610c335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ec565b6001600160a01b038216610d5a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ec565b60008111610dbc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ec565b6000546001600160a01b03848116911614801590610de857506000546001600160a01b03838116911614155b156110c957601554600160a01b900460ff16610e81576000546001600160a01b03848116911614610e815760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ec565b601654811115610ed35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ec565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1557506001600160a01b03821660009081526010602052604090205460ff16155b610f6d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ec565b6015546001600160a01b03838116911614610ff25760175481610f8f846108b7565b610f999190611d0a565b10610ff25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ec565b6000610ffd306108b7565b6018546016549192508210159082106110165760165491505b80801561102d5750601554600160a81b900460ff16155b801561104757506015546001600160a01b03868116911614155b801561105c5750601554600160b01b900460ff165b801561108157506001600160a01b03851660009081526005602052604090205460ff16155b80156110a657506001600160a01b03841660009081526005602052604090205460ff16155b156110c6576110b482611313565b4780156110c4576110c44761120a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110b57506001600160a01b03831660009081526005602052604090205460ff165b8061113d57506015546001600160a01b0385811691161480159061113d57506015546001600160a01b03848116911614155b1561114a575060006111c4565b6015546001600160a01b03858116911614801561117557506014546001600160a01b03848116911614155b1561118757600854600c55600954600d555b6015546001600160a01b0384811691161480156111b257506014546001600160a01b03858116911614155b156111c457600a54600c55600b54600d555b610b3b848484846114b8565b600081848411156111f45760405162461bcd60e51b81526004016105ec9190611c12565b5060006112018486611d61565b95945050505050565b6012546001600160a01b03166108fc6112248360026114e6565b6040518115909202916000818181858888f1935050505015801561124c573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112678360026114e6565b6040518115909202916000818181858888f1935050505015801561066b573d6000803e3d6000fd5b60006006548211156112f65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ec565b6000611300611528565b905061130c83826114e6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bd57600080fd5b505afa1580156113d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f591906119aa565b8160018151811061141657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143c9130911684610b70565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611475908590600090869030904290600401611c9a565b600060405180830381600087803b15801561148f57600080fd5b505af11580156114a3573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c5576114c561154b565b6114d0848484611579565b80610b3b57610b3b600e54600c55600f54600d55565b600061130c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611670565b600080600061153561169e565b909250905061154482826114e6565b9250505090565b600c5415801561155b5750600d54155b1561156257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158b876116de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bd908761173b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ec908661177d565b6001600160a01b03891660009081526002602052604090205561160e816117dc565b6116188483611826565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165d91815260200190565b60405180910390a3505050505050505050565b600081836116915760405162461bcd60e51b81526004016105ec9190611c12565b5060006112018486611d22565b6006546000908190670a636adc6b5954006116b982826114e6565b8210156116d557505060065492670a636adc6b59540092509050565b90939092509050565b60008060008060008060008060006116fb8a600c54600d5461184a565b925092509250600061170b611528565b9050600080600061171e8e87878761189f565b919e509c509a509598509396509194505050505091939550919395565b600061130c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d0565b60008061178a8385611d0a565b90508381101561130c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ec565b60006117e6611528565b905060006117f483836118ef565b30600090815260026020526040902054909150611811908261177d565b30600090815260026020526040902055505050565b600654611833908361173b565b600655600754611843908261177d565b6007555050565b6000808080611864606461185e89896118ef565b906114e6565b90506000611877606461185e8a896118ef565b9050600061188f826118898b8661173b565b9061173b565b9992985090965090945050505050565b60008080806118ae88866118ef565b905060006118bc88876118ef565b905060006118ca88886118ef565b905060006118dc82611889868661173b565b939b939a50919850919650505050505050565b6000826118fe57506000610680565b600061190a8385611d42565b9050826119178583611d22565b1461130c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ec565b803561197981611dbf565b919050565b8035801515811461197957600080fd5b60006020828403121561199f578081fd5b813561130c81611dbf565b6000602082840312156119bb578081fd5b815161130c81611dbf565b600080604083850312156119d8578081fd5b82356119e381611dbf565b915060208301356119f381611dbf565b809150509250929050565b600080600060608486031215611a12578081fd5b8335611a1d81611dbf565b92506020840135611a2d81611dbf565b929592945050506040919091013590565b60008060408385031215611a50578182fd5b8235611a5b81611dbf565b946020939093013593505050565b600080600060408486031215611a7d578283fd5b833567ffffffffffffffff80821115611a94578485fd5b818601915086601f830112611aa7578485fd5b813581811115611ab5578586fd5b8760208260051b8501011115611ac9578586fd5b602092830195509350611adf918601905061197e565b90509250925092565b60006020808385031215611afa578182fd5b823567ffffffffffffffff80821115611b11578384fd5b818501915085601f830112611b24578384fd5b813581811115611b3657611b36611da9565b8060051b604051601f19603f83011681018181108582111715611b5b57611b5b611da9565b604052828152858101935084860182860187018a1015611b79578788fd5b8795505b83861015611ba257611b8e8161196e565b855260019590950194938601938601611b7d565b5098975050505050505050565b600060208284031215611bc0578081fd5b61130c8261197e565b600060208284031215611bda578081fd5b5035919050565b60008060008060808587031215611bf6578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3e57858101830151858201604001528201611c22565b81811115611c4f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce95784516001600160a01b031683529383019391830191600101611cc4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1d57611d1d611d93565b500190565b600082611d3d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5c57611d5c611d93565b500290565b600082821015611d7357611d73611d93565b500390565b6000600019821415611d8c57611d8c611d93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108b457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122094b2735733b65c4ab5a1d3172973549edaf380a7bb373856fb0625764234aa4b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 2,395 |
0x46414c58ff9d03ad980d0913c1d3c154b8cb8da3
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
// SPDX-License-Identifier: MIT
/*
01000110 01101111 01110101 01101110 01100100 00100000 01001101 01100101
00101110 00100000 01001101 01101111 01101110 00100000 01110000 01110010
11101001 01101110 01101111 01101101 00100000 01100011 01101111 01101101
01101101 01100101 01101110 01100011 01100101 00100000 01110000 01100001
01110010 00100000 01110101 01101110 00100000 01001101 00101110 00100000
00100000 0001010 0001010 01001101 01101111 01101110 00100000 01100111
01110010 01101111 01110101 01110000 01100101 00100000 01110100 11101001
01101100 11101001 01100111 01110010 01100001 01101101 00100000 01100011
01101111 01101110 01110100 01101001 01100101 01101110 01110100 00100000
00110101 00100000 01101100 01100101 01110100 01110100 01110010 01100101
01110011 00101110 0001010 0001010 01000010 01110101 01111001 00100000
01110100 01100001 01111000 00100000 00111010 00100000 00110000 0001010
01010011 01100101 01101100 01101100 00100000 01110100 01100001 01111000
00100000 00111010 00100000 00110001 00110000
*/
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract X01101101 is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"01101101"; ////
string public constant symbol = unicode"01101101"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 0;
uint public _sellFee = 10;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf91461056e578063db92dbb614610583578063dcb0e0ad14610598578063dd62ed3e146105b8578063e8078d94146105fe57600080fd5b806395d89b4114610227578063a9059cbb14610523578063b2131f7d14610543578063c3c8cd801461055957600080fd5b8063715018a6116100dc578063715018a6146104b05780637a49cddb146104c55780638da5cb5b146104e557806394b8d8f21461050357600080fd5b80635090161714610445578063590f897e146104655780636fc3eaec1461047b57806370a082311461049057600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039e57806340b9a54b146103d757806345596e2e146103ed57806349bd5a5e1461040d57600080fd5b806327f3a72a1461032c578063313ce5671461034157806331c2d8471461036857806332d873d81461038857600080fd5b80630b78f9c0116101c15780630b78f9c0146102ba57806318160ddd146102da5780631940d020146102f657806323b872dd1461030c57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610268578063095ea7b31461028a57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025b60405180604001604052806008815260200167303131303131303160c01b81525081565b60405161021e9190611b98565b34801561027457600080fd5b50610288610283366004611c12565b610613565b005b34801561029657600080fd5b506102aa6102a5366004611c2f565b610688565b604051901515815260200161021e565b3480156102c657600080fd5b506102886102d5366004611c5b565b61069e565b3480156102e657600080fd5b50683635c9adc5dea00000610214565b34801561030257600080fd5b50610214600f5481565b34801561031857600080fd5b506102aa610327366004611c7d565b610721565b34801561033857600080fd5b50610214610809565b34801561034d57600080fd5b50610356600981565b60405160ff909116815260200161021e565b34801561037457600080fd5b50610288610383366004611cd4565b610819565b34801561039457600080fd5b5061021460105481565b3480156103aa57600080fd5b506102aa6103b9366004611c12565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e357600080fd5b50610214600b5481565b3480156103f957600080fd5b50610288610408366004611d99565b6108a5565b34801561041957600080fd5b50600a5461042d906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045157600080fd5b50610288610460366004611c12565b610969565b34801561047157600080fd5b50610214600c5481565b34801561048757600080fd5b506102886109d7565b34801561049c57600080fd5b506102146104ab366004611c12565b610a04565b3480156104bc57600080fd5b50610288610a1f565b3480156104d157600080fd5b506102886104e0366004611cd4565b610a93565b3480156104f157600080fd5b506000546001600160a01b031661042d565b34801561050f57600080fd5b506011546102aa9062010000900460ff1681565b34801561052f57600080fd5b506102aa61053e366004611c2f565b610ba2565b34801561054f57600080fd5b50610214600d5481565b34801561056557600080fd5b50610288610baf565b34801561057a57600080fd5b50610288610be5565b34801561058f57600080fd5b50610214610c89565b3480156105a457600080fd5b506102886105b3366004611dc0565b610ca1565b3480156105c457600080fd5b506102146105d3366004611ddd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561060a57600080fd5b50610288610d1e565b6008546001600160a01b0316336001600160a01b03161461063357600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610695338484611065565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106be57600080fd5b600a8211156106cc57600080fd5b600a8111156106da57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561074f57506001600160a01b03831660009081526004602052604090205460ff16155b80156107685750600a546001600160a01b038581169116145b156107b7576001600160a01b03831632146107b75760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107c2848484611189565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107f1908490611e2c565b90506107fe853383611065565b506001949350505050565b600061081430610a04565b905090565b6008546001600160a01b0316336001600160a01b03161461083957600080fd5b60005b81518110156108a15760006006600084848151811061085d5761085d611e43565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061089981611e59565b91505061083c565b5050565b6000546001600160a01b031633146108cf5760405162461bcd60e51b81526004016107ae90611e72565b6008546001600160a01b0316336001600160a01b0316146108ef57600080fd5b600081116109345760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107ae565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161067d565b6009546001600160a01b0316336001600160a01b03161461098957600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161067d565b6008546001600160a01b0316336001600160a01b0316146109f757600080fd5b47610a01816117f7565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a495760405162461bcd60e51b81526004016107ae90611e72565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ab357600080fd5b60005b81518110156108a157600a5482516001600160a01b0390911690839083908110610ae257610ae2611e43565b60200260200101516001600160a01b031614158015610b33575060075482516001600160a01b0390911690839083908110610b1f57610b1f611e43565b60200260200101516001600160a01b031614155b15610b9057600160066000848481518110610b5057610b50611e43565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b9a81611e59565b915050610ab6565b6000610695338484611189565b6008546001600160a01b0316336001600160a01b031614610bcf57600080fd5b6000610bda30610a04565b9050610a018161187c565b6000546001600160a01b03163314610c0f5760405162461bcd60e51b81526004016107ae90611e72565b60115460ff1615610c5c5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ae565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a54600090610814906001600160a01b0316610a04565b6000546001600160a01b03163314610ccb5760405162461bcd60e51b81526004016107ae90611e72565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161067d565b6000546001600160a01b03163314610d485760405162461bcd60e51b81526004016107ae90611e72565b60115460ff1615610d955760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ae565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dd23082683635c9adc5dea00000611065565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e349190611ea7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea59190611ea7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190611ea7565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f4681610a04565b600080610f5b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fe89190611ec4565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611041573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a19190611ef2565b6001600160a01b0383166110c75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ae565b6001600160a01b0382166111285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ae565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111ed5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ae565b6001600160a01b03821661124f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ae565b600081116112b15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ae565b6001600160a01b03831660009081526006602052604090205460ff16156113265760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107ae565b600080546001600160a01b0385811691161480159061135357506000546001600160a01b03848116911614155b1561179857600a546001600160a01b03858116911614801561138357506007546001600160a01b03848116911614155b80156113a857506001600160a01b03831660009081526004602052604090205460ff16155b156116345760115460ff166113ff5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107ae565b601054420361143e5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107ae565b42601054610e1061144f9190611f0f565b11156114c957600f5461146184610a04565b61146b9084611f0f565b11156114c95760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107ae565b6001600160a01b03831660009081526005602052604090206001015460ff16611531576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115419190611f0f565b111561161557600e548211156115995760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107ae565b6115a442600f611f0f565b6001600160a01b038416600090815260056020526040902054106116155760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107ae565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561164e575060115460ff165b80156116685750600a546001600160a01b03858116911614155b156117985761167842600f611f0f565b6001600160a01b038516600090815260056020526040902054106116ea5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107ae565b60006116f530610a04565b905080156117815760115462010000900460ff161561177857600d54600a546064919061172a906001600160a01b0316610a04565b6117349190611f27565b61173e9190611f46565b81111561177857600d54600a5460649190611761906001600160a01b0316610a04565b61176b9190611f27565b6117759190611f46565b90505b6117818161187c565b47801561179157611791476117f7565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806117da57506001600160a01b03841660009081526004602052604090205460ff165b156117e3575060005b6117f085858584866119f0565b5050505050565b6008546001600160a01b03166108fc611811600284611f46565b6040518115909202916000818181858888f19350505050158015611839573d6000803e3d6000fd5b506009546001600160a01b03166108fc611854600284611f46565b6040518115909202916000818181858888f193505050501580156108a1573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118c0576118c0611e43565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193d9190611ea7565b8160018151811061195057611950611e43565b6001600160a01b0392831660209182029290920101526007546119769130911684611065565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119af908590600090869030904290600401611f68565b600060405180830381600087803b1580156119c957600080fd5b505af11580156119dd573d6000803e3d6000fd5b50506011805461ff001916905550505050565b60006119fc8383611a12565b9050611a0a86868684611a59565b505050505050565b6000808315611a52578215611a2a5750600b54611a52565b50600c54601054611a3d90610384611f0f565b421015611a5257611a4f600582611f0f565b90505b9392505050565b600080611a668484611b36565b6001600160a01b0388166000908152600260205260409020549193509150611a8f908590611e2c565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611abf908390611f0f565b6001600160a01b038616600090815260026020526040902055611ae181611b6a565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b2691815260200190565b60405180910390a3505050505050565b600080806064611b468587611f27565b611b509190611f46565b90506000611b5e8287611e2c565b96919550909350505050565b30600090815260026020526040902054611b85908290611f0f565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bc557858101830151858201604001528201611ba9565b81811115611bd7576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a0157600080fd5b8035611c0d81611bed565b919050565b600060208284031215611c2457600080fd5b8135611a5281611bed565b60008060408385031215611c4257600080fd5b8235611c4d81611bed565b946020939093013593505050565b60008060408385031215611c6e57600080fd5b50508035926020909101359150565b600080600060608486031215611c9257600080fd5b8335611c9d81611bed565b92506020840135611cad81611bed565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611ce757600080fd5b823567ffffffffffffffff80821115611cff57600080fd5b818501915085601f830112611d1357600080fd5b813581811115611d2557611d25611cbe565b8060051b604051601f19603f83011681018181108582111715611d4a57611d4a611cbe565b604052918252848201925083810185019188831115611d6857600080fd5b938501935b82851015611d8d57611d7e85611c02565b84529385019392850192611d6d565b98975050505050505050565b600060208284031215611dab57600080fd5b5035919050565b8015158114610a0157600080fd5b600060208284031215611dd257600080fd5b8135611a5281611db2565b60008060408385031215611df057600080fd5b8235611dfb81611bed565b91506020830135611e0b81611bed565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e3e57611e3e611e16565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e6b57611e6b611e16565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611eb957600080fd5b8151611a5281611bed565b600080600060608486031215611ed957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f0457600080fd5b8151611a5281611db2565b60008219821115611f2257611f22611e16565b500190565b6000816000190483118215151615611f4157611f41611e16565b500290565b600082611f6357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fb85784516001600160a01b031683529383019391830191600101611f93565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220741ad193e2d7c7b7d62a9704d3481ef7456ad9b0c7f4606ac008b59e44bc940064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 2,396 |
0x83974dc7efc78aa9e8ea8c2f635cfef652c8da9c
|
/*
https://t.me/supersonicshockwave
*/
//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 SuperSonicShockwave is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1 *10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "https://t.me/supersonicshockwave";
string private constant _symbol = 'SSS';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(cooldownEnabled){
require(cooldown[from] < block.timestamp - (360 seconds));
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280602081526020017f68747470733a2f2f742e6d652f7375706572736f6e696373686f636b77617665815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5353530000000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e3e7756e041b0041be8fe4c26c546d9c41dc5819663fef5b59eaeba7b03161cc64736f6c634300060c0033
|
{"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"}]}}
| 2,397 |
0xa7dfb33234098c66fde44907e918dad70a3f211c
|
pragma solidity ^0.4.21;
contract ReceivingContract {
function onTokenReceived(address _from, uint _value, bytes _data) public;
}
contract Gate {
ERC20Basic private TOKEN;
address private PROXY;
/// Gates are to be created by the TokenProxy.
function Gate(ERC20Basic _token, address _proxy) public {
TOKEN = _token;
PROXY = _proxy;
}
/// Transfer requested amount of tokens from Gate to Proxy address.
/// Only the Proxy can request this and should request transfer of all
/// tokens.
function transferToProxy(uint256 _value) public {
require(msg.sender == PROXY);
require(TOKEN.transfer(PROXY, _value));
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
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 SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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) {
require(allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract TokenProxy is StandardToken, BurnableToken {
ERC20Basic public TOKEN;
mapping(address => address) private gates;
event GateOpened(address indexed gate, address indexed user);
event Mint(address indexed to, uint256 amount);
function TokenProxy(ERC20Basic _token) public {
TOKEN = _token;
}
function getGateAddress(address _user) external view returns (address) {
return gates[_user];
}
/// Create a new migration Gate for the User.
function openGate() external {
address user = msg.sender;
// Do not allow creating more than one Gate per User.
require(gates[user] == 0);
// Create new Gate.
address gate = new Gate(TOKEN, this);
// Remember User - Gate relationship.
gates[user] = gate;
emit GateOpened(gate, user);
}
function transferFromGate() external {
address user = msg.sender;
address gate = gates[user];
// Make sure the User's Gate exists.
require(gate != 0);
uint256 value = TOKEN.balanceOf(gate);
Gate(gate).transferToProxy(value);
// Handle the information about the amount of migrated tokens.
// This is a trusted information becase it comes from the Gate.
totalSupply_ += value;
balances[user] += value;
emit Mint(user, value);
}
function withdraw(uint256 _value) external {
withdrawTo(_value, msg.sender);
}
function withdrawTo(uint256 _value, address _destination) public {
require(_value > 0 && _destination != address(0));
burn(_value);
TOKEN.transfer(_destination, _value);
}
}
contract GolemNetworkTokenBatching is TokenProxy {
string public constant name = "Golem Network Token Batching";
string public constant symbol = "GNTB";
uint8 public constant decimals = 18;
event BatchTransfer(address indexed from, address indexed to, uint256 value,
uint64 closureTime);
function GolemNetworkTokenBatching(ERC20Basic _gntToken) TokenProxy(_gntToken) public {
}
function batchTransfer(bytes32[] payments, uint64 closureTime) external {
require(block.timestamp >= closureTime);
uint balance = balances[msg.sender];
for (uint i = 0; i < payments.length; ++i) {
// A payment contains compressed data:
// first 96 bits (12 bytes) is a value,
// following 160 bits (20 bytes) is an address.
bytes32 payment = payments[i];
address addr = address(payment);
require(addr != address(0) && addr != msg.sender);
uint v = uint(payment) / 2**160;
require(v <= balance);
balances[addr] += v;
balance -= v;
emit BatchTransfer(msg.sender, addr, v, closureTime);
}
balances[msg.sender] = balance;
}
function transferAndCall(address to, uint256 value, bytes data) external {
// Transfer always returns true so no need to check return value
transfer(to, value);
// No need to check whether recipient is a contract, this method is
// supposed to used only with contract recipients
ReceivingContract(to).onTokenReceived(msg.sender, value, data);
}
}
|
0x6060604052600436106100f85763ffffffff60e060020a600035041663046672cc81146100fd57806306fdde031461012c578063095ea7b3146101b657806318160ddd146101ec57806323b872dd146102115780632e1a7d4d14610239578063313ce5671461024f5780634000aea01461027857806342966c68146102a757806358f24f3d146102bd57806366188463146102d057806370a08231146102f257806382bfefc81461031157806382dc78361461034057806395d89b4114610353578063a9059cbb14610366578063c86283c814610388578063d3d3d412146103aa578063d73dd623146103c9578063dd62ed3e146103eb575b600080fd5b341561010857600080fd5b61012a602460048035828101929101359067ffffffffffffffff903516610410565b005b341561013757600080fd5b61013f610568565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017b578082015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c157600080fd5b6101d8600160a060020a036004351660243561059f565b604051901515815260200160405180910390f35b34156101f757600080fd5b6101ff61063a565b60405190815260200160405180910390f35b341561021c57600080fd5b6101d8600160a060020a0360043581169060243516604435610640565b341561024457600080fd5b61012a6004356107c0565b341561025a57600080fd5b6102626107cd565b60405160ff909116815260200160405180910390f35b341561028357600080fd5b61012a60048035600160a060020a03169060248035916044359182019101356107d2565b34156102b257600080fd5b61012a600435610870565b34156102c857600080fd5b61012a610969565b34156102db57600080fd5b6101d8600160a060020a0360043516602435610ab2565b34156102fd57600080fd5b6101ff600160a060020a0360043516610bac565b341561031c57600080fd5b610324610bc7565b604051600160a060020a03909116815260200160405180910390f35b341561034b57600080fd5b61012a610bd6565b341561035e57600080fd5b61013f610cb0565b341561037157600080fd5b6101d8600160a060020a0360043516602435610ce7565b341561039357600080fd5b61012a600435600160a060020a0360243516610df9565b34156103b557600080fd5b610324600160a060020a0360043516610e96565b34156103d457600080fd5b6101d8600160a060020a0360043516602435610eb4565b34156103f657600080fd5b6101ff600160a060020a0360043581169060243516610f58565b60008080808067ffffffffffffffff861642101561042d57600080fd5b600160a060020a033316600090815260208190526040812054955093505b868410156105435787878581811061045f57fe5b6020029190910135935083925050600160a060020a03821615801590610497575033600160a060020a031682600160a060020a031614155b15156104a257600080fd5b50740100000000000000000000000000000000000000008204848111156104c857600080fd5b600160a060020a0380831660008181526020819052604090819020805485019055968390039690913316907f24310ec9df46c171fe9c6d6fe25cac6781e7fa8f153f8f72ce63037a4b38c4b69084908a905191825267ffffffffffffffff1660208201526040908101905180910390a383600101935061044b565b505050600160a060020a03331660009081526020819052604090209190915550505050565b60408051908101604052601c81527f476f6c656d204e6574776f726b20546f6b656e204261746368696e6700000000602082015281565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054156105d157600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561065757600080fd5b600160a060020a03841660009081526020819052604090205482111561067c57600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156106af57600080fd5b600160a060020a0384166000908152602081905260409020546106d8908363ffffffff610f8316565b600160a060020a03808616600090815260208190526040808220939093559085168152205461070d908363ffffffff610f9516565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610753908363ffffffff610f8316565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6107ca8133610df9565b50565b601281565b6107dc8484610ce7565b5083600160a060020a031663bed255423385858560405160e060020a63ffffffff8716028152600160a060020a0385166004820190815260248201859052606060448301908152606483018490529091608401848480828437820191505095505050505050600060405180830381600087803b151561085a57600080fd5b5af1151561086757600080fd5b50505050505050565b600160a060020a03331660009081526020819052604081205482111561089557600080fd5b5033600160a060020a0381166000908152602081905260409020546108ba9083610f83565b600160a060020a0382166000908152602081905260409020556001546108e6908363ffffffff610f8316565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a0382167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35050565b33600160a060020a038181166000908152600460205260408120549091169081151561099457600080fd5b600354600160a060020a03166370a082318360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156109e457600080fd5b5af115156109f157600080fd5b5050506040518051915050600160a060020a03821663fcbd27318260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610a4257600080fd5b5af11515610a4f57600080fd5b5050600180548301905550600160a060020a038316600081815260208190526040908190208054840190557f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859083905190815260200160405180910390a2505050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b0f57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610b46565b610b1f818463ffffffff610f8316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031681565b33600160a060020a0381811660009081526004602052604081205490911615610bfe57600080fd5b600354600160a060020a031630610c13610fab565b600160a060020a0392831681529116602082015260409081019051809103906000f0801515610c4157600080fd5b600160a060020a0383811660008181526004602052604090819020805473ffffffffffffffffffffffffffffffffffffffff19169385169384179055929350917fcada91623f6681be482bf9d09527e3733dd80cbae15a9a4b43ba3a667a315e78905160405180910390a35050565b60408051908101604052600481527f474e544200000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610cfe57600080fd5b600160a060020a033316600090815260208190526040902054821115610d2357600080fd5b600160a060020a033316600090815260208190526040902054610d4c908363ffffffff610f8316565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d81908363ffffffff610f9516565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600082118015610e115750600160a060020a03811615155b1515610e1c57600080fd5b610e2582610870565b600354600160a060020a031663a9059cbb828460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610e7b57600080fd5b5af11515610e8857600080fd5b505050604051805150505050565b600160a060020a039081166000908152600460205260409020541690565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610eec908363ffffffff610f9516565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082821115610f8f57fe5b50900390565b600082820183811015610fa457fe5b9392505050565b6040516101d080610fbc8339019056006060604052341561000f57600080fd5b6040516040806101d0833981016040528080519190602001805160008054600160a060020a03958616600160a060020a031991821617909155600180549590921694169390931790925550506101668061006a6000396000f3006060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663fcbd27318114610045575b600080fd5b341561005057600080fd5b61005b60043561005d565b005b6001543373ffffffffffffffffffffffffffffffffffffffff90811691161461008557600080fd5b60005460015473ffffffffffffffffffffffffffffffffffffffff9182169163a9059cbb9116836040517c010000000000000000000000000000000000000000000000000000000063ffffffff851602815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381600087803b151561011557600080fd5b5af1151561012257600080fd5b50505060405180519050151561013757600080fd5b505600a165627a7a723058205ad62f4502a9a43c35a493443dbcc9ba7a1af2d394840b726aa7858be045c0d80029a165627a7a72305820b0ee0e6efdddb6eaaa8003e198f0ea8d6f42f82702184338610162b24b0cd5f20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 2,398 |
0x57F4011966136376942fEeb5500676bDec34BCF9
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Defidopup is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Defidopup";
string private constant _symbol = unicode"Defidopup";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 10;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 5;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 5;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 300000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (180 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610340578063c3c8cd8014610360578063c9567bf914610375578063db92dbb61461038a578063dd62ed3e1461039f578063e8078d94146103e557600080fd5b8063715018a6146102c45780638da5cb5b146102d957806395d89b4114610145578063a9059cbb14610301578063a985ceef1461032157600080fd5b8063313ce567116100fd578063313ce5671461021157806345596e2e1461022d5780635932ead11461024f57806368a3a6a51461026f5780636fc3eaec1461028f57806370a08231146102a457600080fd5b806306fdde0314610145578063095ea7b31461018657806318160ddd146101b657806323b872dd146101dc57806327f3a72a146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b506040805180820182526009815268044656669646f7075760bc1b6020820152905161017d9190611a22565b60405180910390f35b34801561019257600080fd5b506101a66101a136600461197a565b6103fa565b604051901515815260200161017d565b3480156101c257600080fd5b50683635c9adc5dea000005b60405190815260200161017d565b3480156101e857600080fd5b506101a66101f736600461193a565b610411565b34801561020857600080fd5b506101ce61047a565b34801561021d57600080fd5b506040516009815260200161017d565b34801561023957600080fd5b5061024d6102483660046119dd565b61048a565b005b34801561025b57600080fd5b5061024d61026a3660046119a5565b610533565b34801561027b57600080fd5b506101ce61028a3660046118ca565b6105b2565b34801561029b57600080fd5b5061024d6105d5565b3480156102b057600080fd5b506101ce6102bf3660046118ca565b610602565b3480156102d057600080fd5b5061024d610624565b3480156102e557600080fd5b506000546040516001600160a01b03909116815260200161017d565b34801561030d57600080fd5b506101a661031c36600461197a565b610698565b34801561032d57600080fd5b50601354600160a81b900460ff166101a6565b34801561034c57600080fd5b506101ce61035b3660046118ca565b6106a5565b34801561036c57600080fd5b5061024d6106cb565b34801561038157600080fd5b5061024d610701565b34801561039657600080fd5b506101ce61074e565b3480156103ab57600080fd5b506101ce6103ba366004611902565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f157600080fd5b5061024d610766565b6000610407338484610b19565b5060015b92915050565b600061041e848484610c3d565b610470843361046b85604051806060016040528060288152602001611bc2602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061117b565b610b19565b5060019392505050565b600061048530610602565b905090565b6011546001600160a01b0316336001600160a01b0316146104aa57600080fd5b603381106104f75760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016104ee90611a75565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610528565b6001600160a01b03811660009081526006602052604081205461040b9042611b71565b6011546001600160a01b0316336001600160a01b0316146105f557600080fd5b476105ff816111b5565b50565b6001600160a01b03811660009081526002602052604081205461040b906111ef565b6000546001600160a01b0316331461064e5760405162461bcd60e51b81526004016104ee90611a75565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610407338484610c3d565b6001600160a01b03811660009081526006602052604081206001015461040b9042611b71565b6011546001600160a01b0316336001600160a01b0316146106eb57600080fd5b60006106f630610602565b90506105ff81611273565b6000546001600160a01b0316331461072b5760405162461bcd60e51b81526004016104ee90611a75565b6013805460ff60a01b1916600160a01b1790556107494260b4611b1a565b601455565b601354600090610485906001600160a01b0316610602565b6000546001600160a01b031633146107905760405162461bcd60e51b81526004016104ee90611a75565b601354600160a01b900460ff16156107ea5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ee565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108273082683635c9adc5dea00000610b19565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086057600080fd5b505afa158015610874573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089891906118e6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e057600080fd5b505afa1580156108f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091891906118e6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096057600080fd5b505af1158015610974573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099891906118e6565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c881610602565b6000806109dd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4057600080fd5b505af1158015610a54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7991906119f5565b5050670429d069189e00006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610add57600080fd5b505af1158015610af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1591906119c1565b5050565b6001600160a01b038316610b7b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ee565b6001600160a01b038216610bdc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ee565b6001600160a01b038216610d035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ee565b60008111610d655760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ee565b6000546001600160a01b03848116911614801590610d9157506000546001600160a01b03838116911614155b1561111e57601354600160a81b900460ff1615610e11573360009081526006602052604090206002015460ff16610e1157604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e3c57506012546001600160a01b03838116911614155b8015610e6157506001600160a01b03821660009081526005602052604090205460ff16155b15610fc057601354600160a01b900460ff16610ebf5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104ee565b6005600a55601354600160a81b900460ff1615610f8657426014541115610f8657601054811115610eef57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f615760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104ee565b610f6c42602d611b1a565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fc057610fa342600f611b1a565b6001600160a01b0383166000908152600660205260409020600101555b6000610fcb30610602565b601354909150600160b01b900460ff16158015610ff657506013546001600160a01b03858116911614155b801561100b5750601354600160a01b900460ff165b1561111c576005600a55601354600160a81b900460ff161561109d576001600160a01b038416600090815260066020526040902060010154421161109d5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104ee565b801561110a57600b546013546110d3916064916110cd91906110c7906001600160a01b0316610602565b90611418565b90611497565b81111561110157600b546013546110fe916064916110cd91906110c7906001600160a01b0316610602565b90505b61110a81611273565b47801561111a5761111a476111b5565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061116057506001600160a01b03831660009081526005602052604090205460ff165b15611169575060005b611175848484846114d9565b50505050565b6000818484111561119f5760405162461bcd60e51b81526004016104ee9190611a22565b5060006111ac8486611b71565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b15573d6000803e3d6000fd5b60006007548211156112565760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ee565b6000611260611507565b905061126c8382611497565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112c957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561131d57600080fd5b505afa158015611331573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135591906118e6565b8160018151811061137657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461139c9130911684610b19565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d5908590600090869030904290600401611aaa565b600060405180830381600087803b1580156113ef57600080fd5b505af1158015611403573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000826114275750600061040b565b60006114338385611b52565b9050826114408583611b32565b1461126c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ee565b600061126c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061152a565b806114e6576114e6611558565b6114f1848484611586565b8061117557611175600e54600955600f54600a55565b600080600061151461167d565b90925090506115238282611497565b9250505090565b6000818361154b5760405162461bcd60e51b81526004016104ee9190611a22565b5060006111ac8486611b32565b6009541580156115685750600a54155b1561156f57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611598876116bf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ca908761171c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f9908661175e565b6001600160a01b03891660009081526002602052604090205561161b816117bd565b6116258483611807565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166a91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006116998282611497565b8210156116b657505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006116dc8a600954600a5461182b565b92509250925060006116ec611507565b905060008060006116ff8e87878761187a565b919e509c509a509598509396509194505050505091939550919395565b600061126c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061117b565b60008061176b8385611b1a565b90508381101561126c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ee565b60006117c7611507565b905060006117d58383611418565b306000908152600260205260409020549091506117f2908261175e565b30600090815260026020526040902055505050565b600754611814908361171c565b600755600854611824908261175e565b6008555050565b600080808061183f60646110cd8989611418565b9050600061185260646110cd8a89611418565b9050600061186a826118648b8661171c565b9061171c565b9992985090965090945050505050565b60008080806118898886611418565b905060006118978887611418565b905060006118a58888611418565b905060006118b782611864868661171c565b939b939a50919850919650505050505050565b6000602082840312156118db578081fd5b813561126c81611b9e565b6000602082840312156118f7578081fd5b815161126c81611b9e565b60008060408385031215611914578081fd5b823561191f81611b9e565b9150602083013561192f81611b9e565b809150509250929050565b60008060006060848603121561194e578081fd5b833561195981611b9e565b9250602084013561196981611b9e565b929592945050506040919091013590565b6000806040838503121561198c578182fd5b823561199781611b9e565b946020939093013593505050565b6000602082840312156119b6578081fd5b813561126c81611bb3565b6000602082840312156119d2578081fd5b815161126c81611bb3565b6000602082840312156119ee578081fd5b5035919050565b600080600060608486031215611a09578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a4e57858101830151858201604001528201611a32565b81811115611a5f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611af95784516001600160a01b031683529383019391830191600101611ad4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b2d57611b2d611b88565b500190565b600082611b4d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b6c57611b6c611b88565b500290565b600082821015611b8357611b83611b88565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ff57600080fd5b80151581146105ff57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b886a3f5a73dd3f8e7f854d56ebfafbde449fda0cc88e5866185c4d2e13262e864736f6c63430008040033
|
{"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"}]}}
| 2,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.